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 e2457a78a36..9c9fd2276a7 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 @@ -27,154 +27,522 @@ namespace Elastic.Clients.Elasticsearch.Core.MSearch; +internal sealed partial class MultisearchBodyConverter : JsonConverter +{ + public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new MultisearchBody(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "_source") + { + variant.Source = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "aggregations" || property == "aggs") + { + variant.Aggregations = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "collapse") + { + variant.Collapse = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "docvalue_fields") + { + variant.DocvalueFields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "explain") + { + variant.Explain = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "ext") + { + variant.Ext = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "fields") + { + variant.Fields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "from") + { + variant.From = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "highlight") + { + variant.Highlight = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indices_boost") + { + variant.IndicesBoost = JsonSerializer.Deserialize>?>(ref reader, options); + continue; + } + + if (property == "knn") + { + variant.Knn = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "min_score") + { + variant.MinScore = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "pit") + { + variant.Pit = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "post_filter") + { + variant.PostFilter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "profile") + { + variant.Profile = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "rescore") + { + variant.Rescore = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "runtime_mappings") + { + variant.RuntimeMappings = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "script_fields") + { + variant.ScriptFields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "search_after") + { + variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "seq_no_primary_term") + { + variant.SeqNoPrimaryTerm = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "size") + { + variant.Size = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "sort") + { + variant.Sort = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "stats") + { + variant.Stats = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "stored_fields") + { + variant.StoredFields = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "suggest") + { + variant.Suggest = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "terminate_after") + { + variant.TerminateAfter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "timeout") + { + variant.Timeout = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "track_scores") + { + variant.TrackScores = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "track_total_hits") + { + variant.TrackTotalHits = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "version") + { + variant.Version = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, MultisearchBody value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Source is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, value.Source, options); + } + + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.Collapse is not null) + { + writer.WritePropertyName("collapse"); + JsonSerializer.Serialize(writer, value.Collapse, options); + } + + if (value.DocvalueFields is not null) + { + writer.WritePropertyName("docvalue_fields"); + JsonSerializer.Serialize(writer, value.DocvalueFields, options); + } + + if (value.Explain.HasValue) + { + writer.WritePropertyName("explain"); + writer.WriteBooleanValue(value.Explain.Value); + } + + if (value.Ext is not null) + { + writer.WritePropertyName("ext"); + JsonSerializer.Serialize(writer, value.Ext, options); + } + + if (value.Fields is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, value.Fields, options); + } + + if (value.From.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(value.From.Value); + } + + if (value.Highlight is not null) + { + writer.WritePropertyName("highlight"); + JsonSerializer.Serialize(writer, value.Highlight, options); + } + + if (value.IndicesBoost is not null) + { + writer.WritePropertyName("indices_boost"); + JsonSerializer.Serialize(writer, value.IndicesBoost, options); + } + + if (value.Knn is not null) + { + writer.WritePropertyName("knn"); + JsonSerializer.Serialize(writer, value.Knn, options); + } + + if (value.MinScore.HasValue) + { + writer.WritePropertyName("min_score"); + writer.WriteNumberValue(value.MinScore.Value); + } + + if (value.Pit is not null) + { + writer.WritePropertyName("pit"); + JsonSerializer.Serialize(writer, value.Pit, options); + } + + if (value.PostFilter is not null) + { + writer.WritePropertyName("post_filter"); + JsonSerializer.Serialize(writer, value.PostFilter, options); + } + + if (value.Profile.HasValue) + { + writer.WritePropertyName("profile"); + writer.WriteBooleanValue(value.Profile.Value); + } + + if (value.Query is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + } + + if (value.Rescore is not null) + { + writer.WritePropertyName("rescore"); + JsonSerializer.Serialize(writer, value.Rescore, options); + } + + if (value.RuntimeMappings is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, value.RuntimeMappings, options); + } + + if (value.ScriptFields is not null) + { + writer.WritePropertyName("script_fields"); + JsonSerializer.Serialize(writer, value.ScriptFields, options); + } + + if (value.SearchAfter is not null) + { + writer.WritePropertyName("search_after"); + JsonSerializer.Serialize(writer, value.SearchAfter, options); + } + + if (value.SeqNoPrimaryTerm.HasValue) + { + writer.WritePropertyName("seq_no_primary_term"); + writer.WriteBooleanValue(value.SeqNoPrimaryTerm.Value); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + if (value.Sort is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, value.Sort, options); + } + + if (value.Stats is not null) + { + writer.WritePropertyName("stats"); + JsonSerializer.Serialize(writer, value.Stats, options); + } + + if (value.StoredFields is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, value.StoredFields, options); + } + + if (value.Suggest is not null) + { + writer.WritePropertyName("suggest"); + JsonSerializer.Serialize(writer, value.Suggest, options); + } + + if (value.TerminateAfter.HasValue) + { + writer.WritePropertyName("terminate_after"); + writer.WriteNumberValue(value.TerminateAfter.Value); + } + + if (!string.IsNullOrEmpty(value.Timeout)) + { + writer.WritePropertyName("timeout"); + writer.WriteStringValue(value.Timeout); + } + + if (value.TrackScores.HasValue) + { + writer.WritePropertyName("track_scores"); + writer.WriteBooleanValue(value.TrackScores.Value); + } + + if (value.TrackTotalHits is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, value.TrackTotalHits, options); + } + + if (value.Version.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteBooleanValue(value.Version.Value); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(MultisearchBodyConverter))] public sealed partial class MultisearchBody { /// /// Indicates which source fields are returned for matching documents. These
fields are returned in the hits._source property of the search response.
///
- [JsonInclude, JsonPropertyName("_source")] public Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? Source { get; set; } - [JsonInclude, JsonPropertyName("collapse")] + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? Aggregations { get; set; } public Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? Collapse { get; set; } /// /// Array of wildcard (*) patterns. The request returns doc values for field
names matching these patterns in the hits.fields property of the response.
///
- [JsonInclude, JsonPropertyName("docvalue_fields")] public ICollection? DocvalueFields { get; set; } /// /// If true, returns detailed information about score computation as part of a hit. /// - [JsonInclude, JsonPropertyName("explain")] public bool? Explain { get; set; } /// /// Configuration of search extensions defined by Elasticsearch plugins. /// - [JsonInclude, JsonPropertyName("ext")] public IDictionary? Ext { get; set; } /// /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
///
- [JsonInclude, JsonPropertyName("fields")] public ICollection? Fields { get; set; } /// /// Starting document offset. By default, you cannot page through more than 10,000
hits using the from and size parameters. To page through more hits, use the
search_after parameter.
///
- [JsonInclude, JsonPropertyName("from")] public int? From { get; set; } - [JsonInclude, JsonPropertyName("highlight")] public Elastic.Clients.Elasticsearch.Core.Search.Highlight? Highlight { get; set; } /// /// Boosts the _score of documents from specified indices. /// - [JsonInclude, JsonPropertyName("indices_boost")] public ICollection>? IndicesBoost { get; set; } /// /// Defines the approximate kNN search to run. /// - [JsonInclude, JsonPropertyName("knn"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.KnnQuery))] public ICollection? Knn { get; set; } /// /// Minimum _score for matching documents. Documents with a lower _score are
not included in the search results.
///
- [JsonInclude, JsonPropertyName("min_score")] public double? MinScore { get; set; } /// /// Limits the search to a point in time (PIT). If you provide a PIT, you
cannot specify an in the request path.
///
- [JsonInclude, JsonPropertyName("pit")] public Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference? Pit { get; set; } - [JsonInclude, JsonPropertyName("post_filter")] public Elastic.Clients.Elasticsearch.QueryDsl.Query? PostFilter { get; set; } - [JsonInclude, JsonPropertyName("profile")] public bool? Profile { get; set; } /// /// Defines the search definition using the Query DSL. /// - [JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } - [JsonInclude, JsonPropertyName("rescore"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Rescore))] public ICollection? Rescore { get; set; } /// /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
///
- [JsonInclude, JsonPropertyName("runtime_mappings")] public IDictionary? RuntimeMappings { get; set; } /// /// Retrieve a script evaluation (based on different fields) for each hit. /// - [JsonInclude, JsonPropertyName("script_fields")] public IDictionary? ScriptFields { get; set; } - [JsonInclude, JsonPropertyName("search_after")] public ICollection? SearchAfter { get; set; } /// /// If true, returns sequence number and primary term of the last modification
of each hit. See Optimistic concurrency control.
///
- [JsonInclude, JsonPropertyName("seq_no_primary_term")] public bool? SeqNoPrimaryTerm { get; set; } /// /// The number of hits to return. By default, you cannot page through more
than 10,000 hits using the from and size parameters. To page through more
hits, use the search_after parameter.
///
- [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } - [JsonInclude, JsonPropertyName("sort"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.SortOptions))] public ICollection? Sort { get; set; } /// /// Stats groups to associate with the search. Each group maintains a statistics
aggregation for its associated searches. You can retrieve these stats using
the indices stats API.
///
- [JsonInclude, JsonPropertyName("stats")] public ICollection? Stats { get; set; } /// /// List of stored fields to return as part of a hit. If no fields are specified,
no stored fields are included in the response. If this field is specified, the _source
parameter defaults to false. You can pass _source: true to return both source fields
and stored fields in the search response.
///
- [JsonInclude, JsonPropertyName("stored_fields")] public Elastic.Clients.Elasticsearch.Fields? StoredFields { get; set; } - [JsonInclude, JsonPropertyName("suggest")] public Elastic.Clients.Elasticsearch.Core.Search.Suggester? Suggest { get; set; } /// /// Maximum number of documents to collect for each shard. If a query reaches this
limit, Elasticsearch terminates the query early. Elasticsearch collects documents
before sorting. Defaults to 0, which does not terminate query execution early.
///
- [JsonInclude, JsonPropertyName("terminate_after")] public long? TerminateAfter { get; set; } /// /// Specifies the period of time to wait for a response from each shard. If no response
is received before the timeout expires, the request fails and returns an error.
Defaults to no timeout.
///
- [JsonInclude, JsonPropertyName("timeout")] public string? Timeout { get; set; } /// /// If true, calculate and return document scores, even if the scores are not used for sorting. /// - [JsonInclude, JsonPropertyName("track_scores")] public bool? TrackScores { get; set; } /// /// Number of hits matching the query to count accurately. If true, the exact
number of hits is returned at the cost of some performance. If false, the
response does not include the total number of hits matching the query.
Defaults to 10,000 hits.
///
- [JsonInclude, JsonPropertyName("track_total_hits")] public Elastic.Clients.Elasticsearch.Core.Search.TrackHits? TrackTotalHits { get; set; } /// /// If true, returns document version as part of a hit. /// - [JsonInclude, JsonPropertyName("version")] public bool? Version { get; set; } } @@ -186,6 +554,9 @@ public MultisearchBodyDescriptor() : base() { } + private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? CollapseValue { get; set; } private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } private Action> CollapseDescriptorAction { get; set; } @@ -244,6 +615,30 @@ public MultisearchBodyDescriptor() : base() private Elastic.Clients.Elasticsearch.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } private bool? VersionValue { get; set; } + public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Aggregations(Action> configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + public MultisearchBodyDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? collapse) { CollapseDescriptor = null; @@ -751,6 +1146,22 @@ public MultisearchBodyDescriptor Version(bool? version = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + if (CollapseDescriptor is not null) { writer.WritePropertyName("collapse"); @@ -1122,6 +1533,9 @@ public MultisearchBodyDescriptor() : base() { } + private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } + private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? CollapseValue { get; set; } private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } private Action CollapseDescriptorAction { get; set; } @@ -1180,6 +1594,30 @@ public MultisearchBodyDescriptor() : base() private Elastic.Clients.Elasticsearch.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } private bool? VersionValue { get; set; } + public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) + { + AggregationsDescriptor = null; + AggregationsDescriptorAction = null; + AggregationsValue = aggregations; + return Self; + } + + public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) + { + AggregationsValue = null; + AggregationsDescriptorAction = null; + AggregationsDescriptor = descriptor; + return Self; + } + + public MultisearchBodyDescriptor Aggregations(Action configure) + { + AggregationsValue = null; + AggregationsDescriptor = null; + AggregationsDescriptorAction = configure; + return Self; + } + public MultisearchBodyDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? collapse) { CollapseDescriptor = null; @@ -1687,6 +2125,22 @@ public MultisearchBodyDescriptor Version(bool? version = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (AggregationsDescriptor is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + } + else if (AggregationsDescriptorAction is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); + } + else if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + if (CollapseDescriptor is not null) { writer.WritePropertyName("collapse"); 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 de91ffbe541..f68dcb3a6cd 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 @@ -62,7 +62,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WriteStartObject(); writer.WritePropertyName("id"); - JsonSerializer.Serialize(writer, IdValue, options); + writer.WriteStringValue(IdValue); if (KeepAliveValue is not null) { writer.WritePropertyName("keep_alive"); 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 ed23e9bf2d0..35c00f5c7a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.g.cs @@ -138,7 +138,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "indexing.slowlog") { - variant.IndexingSlowlog = JsonSerializer.Deserialize(ref reader, options); + variant.IndexingSlowlog = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -778,7 +778,7 @@ public sealed partial class IndexSettings /// Configure indexing back pressure limits. /// public Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressure? IndexingPressure { get; set; } - public Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettings? IndexingSlowlog { get; set; } + public Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings? IndexingSlowlog { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycle? Lifecycle { get; set; } public bool? LoadFixedBitsetFiltersEagerly { get; set; } @@ -877,9 +877,9 @@ public IndexSettingsDescriptor() : base() private Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressure? IndexingPressureValue { get; set; } private IndexingPressureDescriptor IndexingPressureDescriptor { get; set; } private Action IndexingPressureDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettings? IndexingSlowlogValue { get; set; } - private SlowlogSettingsDescriptor IndexingSlowlogDescriptor { get; set; } - private Action IndexingSlowlogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings? IndexingSlowlogValue { get; set; } + private IndexingSlowlogSettingsDescriptor IndexingSlowlogDescriptor { get; set; } + private Action IndexingSlowlogDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycle? LifecycleValue { get; set; } private IndexSettingsLifecycleDescriptor LifecycleDescriptor { get; set; } private Action LifecycleDescriptorAction { get; set; } @@ -1204,7 +1204,7 @@ public IndexSettingsDescriptor IndexingPressure(Action IndexingSlowlog(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettings? indexingSlowlog) + public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings? indexingSlowlog) { IndexingSlowlogDescriptor = null; IndexingSlowlogDescriptorAction = null; @@ -1212,7 +1212,7 @@ public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasti return Self; } - public IndexSettingsDescriptor IndexingSlowlog(SlowlogSettingsDescriptor descriptor) + public IndexSettingsDescriptor IndexingSlowlog(IndexingSlowlogSettingsDescriptor descriptor) { IndexingSlowlogValue = null; IndexingSlowlogDescriptorAction = null; @@ -1220,7 +1220,7 @@ public IndexSettingsDescriptor IndexingSlowlog(SlowlogSettingsDescrip return Self; } - public IndexSettingsDescriptor IndexingSlowlog(Action configure) + public IndexSettingsDescriptor IndexingSlowlog(Action configure) { IndexingSlowlogValue = null; IndexingSlowlogDescriptor = null; @@ -1904,7 +1904,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexingSlowlogDescriptorAction is not null) { writer.WritePropertyName("indexing.slowlog"); - JsonSerializer.Serialize(writer, new SlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); + JsonSerializer.Serialize(writer, new IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); } else if (IndexingSlowlogValue is not null) { @@ -2325,9 +2325,9 @@ public IndexSettingsDescriptor() : base() private Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressure? IndexingPressureValue { get; set; } private IndexingPressureDescriptor IndexingPressureDescriptor { get; set; } private Action IndexingPressureDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettings? IndexingSlowlogValue { get; set; } - private SlowlogSettingsDescriptor IndexingSlowlogDescriptor { get; set; } - private Action IndexingSlowlogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings? IndexingSlowlogValue { get; set; } + private IndexingSlowlogSettingsDescriptor IndexingSlowlogDescriptor { get; set; } + private Action IndexingSlowlogDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycle? LifecycleValue { get; set; } private IndexSettingsLifecycleDescriptor LifecycleDescriptor { get; set; } private Action LifecycleDescriptorAction { get; set; } @@ -2652,7 +2652,7 @@ public IndexSettingsDescriptor IndexingPressure(Action configure) + public IndexSettingsDescriptor IndexingSlowlog(Action configure) { IndexingSlowlogValue = null; IndexingSlowlogDescriptor = null; @@ -3352,7 +3352,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexingSlowlogDescriptorAction is not null) { writer.WritePropertyName("indexing.slowlog"); - JsonSerializer.Serialize(writer, new SlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); + JsonSerializer.Serialize(writer, new IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); } else if (IndexingSlowlogValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs new file mode 100644 index 00000000000..9ff49066c4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.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 Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class IndexingSlowlogSettings +{ + [JsonInclude, JsonPropertyName("level")] + public string? Level { get; set; } + [JsonInclude, JsonPropertyName("reformat")] + public bool? Reformat { get; set; } + [JsonInclude, JsonPropertyName("source")] + public int? Source { get; set; } + [JsonInclude, JsonPropertyName("threshold")] + public Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholds? Threshold { get; set; } +} + +public sealed partial class IndexingSlowlogSettingsDescriptor : SerializableDescriptor +{ + internal IndexingSlowlogSettingsDescriptor(Action configure) => configure.Invoke(this); + + public IndexingSlowlogSettingsDescriptor() : base() + { + } + + private string? LevelValue { get; set; } + private bool? ReformatValue { get; set; } + private int? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholds? ThresholdValue { get; set; } + private IndexingSlowlogTresholdsDescriptor ThresholdDescriptor { get; set; } + private Action ThresholdDescriptorAction { get; set; } + + public IndexingSlowlogSettingsDescriptor Level(string? level) + { + LevelValue = level; + return Self; + } + + public IndexingSlowlogSettingsDescriptor Reformat(bool? reformat = true) + { + ReformatValue = reformat; + return Self; + } + + public IndexingSlowlogSettingsDescriptor Source(int? source) + { + SourceValue = source; + return Self; + } + + public IndexingSlowlogSettingsDescriptor Threshold(Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholds? threshold) + { + ThresholdDescriptor = null; + ThresholdDescriptorAction = null; + ThresholdValue = threshold; + return Self; + } + + public IndexingSlowlogSettingsDescriptor Threshold(IndexingSlowlogTresholdsDescriptor descriptor) + { + ThresholdValue = null; + ThresholdDescriptorAction = null; + ThresholdDescriptor = descriptor; + return Self; + } + + public IndexingSlowlogSettingsDescriptor Threshold(Action configure) + { + ThresholdValue = null; + ThresholdDescriptor = null; + ThresholdDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(LevelValue)) + { + writer.WritePropertyName("level"); + writer.WriteStringValue(LevelValue); + } + + if (ReformatValue.HasValue) + { + writer.WritePropertyName("reformat"); + writer.WriteBooleanValue(ReformatValue.Value); + } + + if (SourceValue.HasValue) + { + writer.WritePropertyName("source"); + writer.WriteNumberValue(SourceValue.Value); + } + + if (ThresholdDescriptor is not null) + { + writer.WritePropertyName("threshold"); + JsonSerializer.Serialize(writer, ThresholdDescriptor, options); + } + else if (ThresholdDescriptorAction is not null) + { + writer.WritePropertyName("threshold"); + JsonSerializer.Serialize(writer, new IndexingSlowlogTresholdsDescriptor(ThresholdDescriptorAction), options); + } + else if (ThresholdValue is not null) + { + writer.WritePropertyName("threshold"); + JsonSerializer.Serialize(writer, ThresholdValue, options); + } + + 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 new file mode 100644 index 00000000000..fb1370668bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.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 Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class IndexingSlowlogTresholds +{ + /// + /// The indexing slow log, similar in functionality to the search slow log. The log file name ends with `_index_indexing_slowlog.json`.
Log and the thresholds are configured in the same way as the search slowlog.
+ ///
+ [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? Index { get; set; } +} + +public sealed partial class IndexingSlowlogTresholdsDescriptor : SerializableDescriptor +{ + internal IndexingSlowlogTresholdsDescriptor(Action configure) => configure.Invoke(this); + + public IndexingSlowlogTresholdsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? IndexValue { get; set; } + private SlowlogTresholdLevelsDescriptor IndexDescriptor { get; set; } + private Action IndexDescriptorAction { get; set; } + + /// + /// The indexing slow log, similar in functionality to the search slow log. The log file name ends with `_index_indexing_slowlog.json`.
Log and the thresholds are configured in the same way as the search slowlog.
+ ///
+ public IndexingSlowlogTresholdsDescriptor Index(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? index) + { + IndexDescriptor = null; + IndexDescriptorAction = null; + IndexValue = index; + return Self; + } + + public IndexingSlowlogTresholdsDescriptor Index(SlowlogTresholdLevelsDescriptor descriptor) + { + IndexValue = null; + IndexDescriptorAction = null; + IndexDescriptor = descriptor; + return Self; + } + + public IndexingSlowlogTresholdsDescriptor Index(Action configure) + { + IndexValue = null; + IndexDescriptor = null; + IndexDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IndexDescriptor is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexDescriptor, options); + } + else if (IndexDescriptorAction is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, new SlowlogTresholdLevelsDescriptor(IndexDescriptorAction), options); + } + else if (IndexValue is not null) + { + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + } + + 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 180122bcdcc..31b3027d5fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs @@ -31,12 +31,6 @@ public sealed partial class SlowlogTresholds { [JsonInclude, JsonPropertyName("fetch")] public Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? Fetch { get; set; } - - /// - /// The indexing slow log, similar in functionality to the search slow log. The log file name ends with `_index_indexing_slowlog.json`.
Log and the thresholds are configured in the same way as the search slowlog.
- ///
- [JsonInclude, JsonPropertyName("index")] - public Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? Index { get; set; } [JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? Query { get; set; } } @@ -52,9 +46,6 @@ public SlowlogTresholdsDescriptor() : base() private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? FetchValue { get; set; } private SlowlogTresholdLevelsDescriptor FetchDescriptor { get; set; } private Action FetchDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? IndexValue { get; set; } - private SlowlogTresholdLevelsDescriptor IndexDescriptor { get; set; } - private Action IndexDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? QueryValue { get; set; } private SlowlogTresholdLevelsDescriptor QueryDescriptor { get; set; } private Action QueryDescriptorAction { get; set; } @@ -83,33 +74,6 @@ public SlowlogTresholdsDescriptor Fetch(Action return Self; } - /// - /// The indexing slow log, similar in functionality to the search slow log. The log file name ends with `_index_indexing_slowlog.json`.
Log and the thresholds are configured in the same way as the search slowlog.
- ///
- public SlowlogTresholdsDescriptor Index(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? index) - { - IndexDescriptor = null; - IndexDescriptorAction = null; - IndexValue = index; - return Self; - } - - public SlowlogTresholdsDescriptor Index(SlowlogTresholdLevelsDescriptor descriptor) - { - IndexValue = null; - IndexDescriptorAction = null; - IndexDescriptor = descriptor; - return Self; - } - - public SlowlogTresholdsDescriptor Index(Action configure) - { - IndexValue = null; - IndexDescriptor = null; - IndexDescriptorAction = configure; - return Self; - } - public SlowlogTresholdsDescriptor Query(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? query) { QueryDescriptor = null; @@ -153,22 +117,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FetchValue, options); } - if (IndexDescriptor is not null) - { - writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, IndexDescriptor, options); - } - else if (IndexDescriptorAction is not null) - { - writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, new SlowlogTresholdLevelsDescriptor(IndexDescriptorAction), options); - } - else if (IndexValue is not null) - { - writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, IndexValue, options); - } - if (QueryDescriptor is not null) { writer.WritePropertyName("query");