Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRe
{
reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
LocalJsonValue<Elastic.Clients.Elasticsearch.Duration?> propDataRetention = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling?> propDownsampling = default;
LocalJsonValue<System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound>?> propDownsampling = default;
LocalJsonValue<bool?> propEnabled = default;
while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
{
Expand All @@ -42,7 +42,7 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRe
continue;
}

if (propDownsampling.TryReadProperty(ref reader, options, PropDownsampling, null))
if (propDownsampling.TryReadProperty(ref reader, options, PropDownsampling, static System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue<Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound>(o, null)))
{
continue;
}
Expand Down Expand Up @@ -74,7 +74,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
{
writer.WriteStartObject();
writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null);
writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, null);
writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound>? v) => w.WriteCollectionValue<Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound>(o, v, null));
writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue<bool>(o, v));
writer.WriteEndObject();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ internal PutDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.Jso
/// The downsampling configuration to execute for the managed backing index after rollover.
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling? Downsampling { get; set; }
public System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound>? Downsampling { get; set; }

/// <summary>
/// <para>
Expand Down Expand Up @@ -256,7 +256,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequestDesc
/// The downsampling configuration to execute for the managed backing index after rollover.
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequestDescriptor Downsampling(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling? value)
public Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequestDescriptor Downsampling(System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound>? value)
{
Instance.Downsampling = value;
return this;
Expand All @@ -267,9 +267,26 @@ public Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequestDesc
/// The downsampling configuration to execute for the managed backing index after rollover.
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequestDescriptor Downsampling(System.Action<Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingDescriptor> action)
public Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequestDescriptor Downsampling(params Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound[] values)
{
Instance.Downsampling = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingDescriptor.Build(action);
Instance.Downsampling = [.. values];
return this;
}

/// <summary>
/// <para>
/// The downsampling configuration to execute for the managed backing index after rollover.
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequestDescriptor Downsampling(params System.Action<Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRoundDescriptor>[] actions)
{
var items = new System.Collections.Generic.List<Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound>();
foreach (var action in actions)
{
items.Add(Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRoundDescriptor.Build(action));
}

Instance.Downsampling = items;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation Re
LocalJsonValue<bool?> propIncludeSort = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint> propPoint = default;
LocalJsonValue<int?> propSize = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort> propSort = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort?> propSort = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.SortOrder?> propSortOrder = default;
while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ namespace Elastic.Clients.Elasticsearch.Aggregations;
public sealed partial class GeoLineAggregation
{
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public GeoLineAggregation(Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint point, Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort sort)
public GeoLineAggregation(Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint point)
{
Point = point;
Sort = sort;
}
#if NET7_0_OR_GREATER
public GeoLineAggregation()
Expand Down Expand Up @@ -81,11 +80,7 @@ internal GeoLineAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonCons
/// When the <c>geo_line</c> aggregation is nested inside a <c>time_series</c> aggregation, this field defaults to <c>@timestamp</c>, and any other value will result in error.
/// </para>
/// </summary>
public
#if NET7_0_OR_GREATER
required
#endif
Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort Sort { get; set; }
public Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort? Sort { get; set; }

/// <summary>
/// <para>
Expand Down Expand Up @@ -165,7 +160,7 @@ public Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregationDescriptor<T
/// When the <c>geo_line</c> aggregation is nested inside a <c>time_series</c> aggregation, this field defaults to <c>@timestamp</c>, and any other value will result in error.
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregationDescriptor<TDocument> Sort(Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort value)
public Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregationDescriptor<TDocument> Sort(Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort? value)
{
Instance.Sort = value;
return this;
Expand Down Expand Up @@ -284,7 +279,7 @@ public Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregationDescriptor S
/// When the <c>geo_line</c> aggregation is nested inside a <c>time_series</c> aggregation, this field defaults to <c>@timestamp</c>, and any other value will result in error.
/// </para>
/// </summary>
public Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort value)
public Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort? value)
{
Instance.Sort = value;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregatio
continue;
}

if (propPercents.TryReadProperty(ref reader, options, PropPercents, static System.Collections.Generic.ICollection<double>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue<double>(o, null)))
if (propPercents.TryReadProperty(ref reader, options, PropPercents, static System.Collections.Generic.ICollection<double>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue<double>(o, null)))
{
continue;
}
Expand Down Expand Up @@ -117,7 +117,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
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<bool>(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<double>? v) => w.WriteCollectionValue<double>(o, v, null));
writer.WriteProperty(options, PropPercents, value.Percents, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection<double>? v) => w.WriteSingleOrManyCollectionValue<double>(o, v, null));
writer.WriteProperty(options, PropScript, value.Script, null, null);
writer.WriteProperty(options, PropTDigest, value.TDigest, null, null);
writer.WriteEndObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ public sealed partial class NodeAllocationExplanationConverter : System.Text.Jso
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<System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision>> propDeciders = default;
LocalJsonValue<System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision>?> propDeciders = default;
LocalJsonValue<System.Collections.Generic.IReadOnlyDictionary<string, string>> propNodeAttributes = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.Cluster.Decision> propNodeDecision = default;
LocalJsonValue<string> propNodeId = default;
LocalJsonValue<string> propNodeName = default;
LocalJsonValue<System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.NodeRole>> propRoles = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.Cluster.AllocationStore?> propStore = default;
LocalJsonValue<string> propTransportAddress = default;
LocalJsonValue<int> propWeightRanking = default;
LocalJsonValue<int?> 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<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision>(o, null)!))
if (propDeciders.TryReadProperty(ref reader, options, PropDeciders, static System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision>(o, null)))
{
continue;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ public override Elastic.Clients.Elasticsearch.Cluster.NodeAllocationExplanation
continue;
}

if (propWeightRanking.TryReadProperty(ref reader, options, PropWeightRanking, null))
if (propWeightRanking.TryReadProperty(ref reader, options, PropWeightRanking, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue<int>(o)))
{
continue;
}
Expand Down Expand Up @@ -121,15 +121,15 @@ public override Elastic.Clients.Elasticsearch.Cluster.NodeAllocationExplanation
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<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision> v) => w.WriteCollectionValue<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision>(o, v, null));
writer.WriteProperty(options, PropDeciders, value.Deciders, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision>? v) => w.WriteCollectionValue<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision>(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<string, string> v) => w.WriteDictionaryValue<string, string>(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<Elastic.Clients.Elasticsearch.NodeRole> v) => w.WriteCollectionValue<Elastic.Clients.Elasticsearch.NodeRole>(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.WriteProperty(options, PropWeightRanking, value.WeightRanking, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue<int>(o, v));
writer.WriteEndObject();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ namespace Elastic.Clients.Elasticsearch.Cluster;
public sealed partial class NodeAllocationExplanation
{
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public NodeAllocationExplanation(System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision> deciders, System.Collections.Generic.IReadOnlyDictionary<string, string> nodeAttributes, Elastic.Clients.Elasticsearch.Cluster.Decision nodeDecision, string nodeId, string nodeName, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.NodeRole> roles, string transportAddress, int weightRanking)
public NodeAllocationExplanation(System.Collections.Generic.IReadOnlyDictionary<string, string> nodeAttributes, Elastic.Clients.Elasticsearch.Cluster.Decision nodeDecision, string nodeId, string nodeName, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.NodeRole> roles, string transportAddress)
{
Deciders = deciders;
NodeAttributes = nodeAttributes;
NodeDecision = nodeDecision;
NodeId = nodeId;
NodeName = nodeName;
Roles = roles;
TransportAddress = transportAddress;
WeightRanking = weightRanking;
}
#if NET7_0_OR_GREATER
public NodeAllocationExplanation()
Expand All @@ -55,11 +53,7 @@ internal NodeAllocationExplanation(Elastic.Clients.Elasticsearch.Serialization.J
_ = sentinel;
}

public
#if NET7_0_OR_GREATER
required
#endif
System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision> Deciders { get; set; }
public System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Cluster.AllocationDecision>? Deciders { get; set; }
public
#if NET7_0_OR_GREATER
required
Expand Down Expand Up @@ -91,9 +85,5 @@ internal NodeAllocationExplanation(Elastic.Clients.Elasticsearch.Serialization.J
required
#endif
string TransportAddress { get; set; }
public
#if NET7_0_OR_GREATER
required
#endif
int WeightRanking { get; set; }
public int? WeightRanking { get; set; }
}
Loading