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 @@ -32,15 +32,15 @@ public override Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAgg
{
reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
LocalJsonValue<System.Collections.Generic.IReadOnlyDictionary<string, object>?> propMeta = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.Aggregations.Percentiles> propValues = default;
LocalJsonValue<System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem>> 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<string, object>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue<string, object>(o, null, null)))
{
continue;
}

if (propValues.TryReadProperty(ref reader, options, PropValues, null))
if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem>(o, null)!))
{
continue;
}
Expand All @@ -66,7 +66,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
{
writer.WriteStartObject();
writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary<string, object>? v) => w.WriteDictionaryValue<string, object>(o, v, null, null));
writer.WriteProperty(options, PropValues, value.Values, null, null);
writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem> v) => w.WriteCollectionValue<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem>(o, v, null));
writer.WriteEndObject();
}
}
Expand All @@ -75,7 +75,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
public sealed partial class HdrPercentileRanksAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate
{
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public HdrPercentileRanksAggregate(Elastic.Clients.Elasticsearch.Aggregations.Percentiles values)
public HdrPercentileRanksAggregate(System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem> values)
{
Values = values;
}
Expand Down Expand Up @@ -104,5 +104,5 @@ internal HdrPercentileRanksAggregate(Elastic.Clients.Elasticsearch.Serialization
#if NET7_0_OR_GREATER
required
#endif
Elastic.Clients.Elasticsearch.Aggregations.Percentiles Values { get; set; }
System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem> Values { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ public override Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggrega
{
reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
LocalJsonValue<System.Collections.Generic.IReadOnlyDictionary<string, object>?> propMeta = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.Aggregations.Percentiles> propValues = default;
LocalJsonValue<System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem>> 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<string, object>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue<string, object>(o, null, null)))
{
continue;
}

if (propValues.TryReadProperty(ref reader, options, PropValues, null))
if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem>(o, null)!))
{
continue;
}
Expand All @@ -66,7 +66,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
{
writer.WriteStartObject();
writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary<string, object>? v) => w.WriteDictionaryValue<string, object>(o, v, null, null));
writer.WriteProperty(options, PropValues, value.Values, null, null);
writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem> v) => w.WriteCollectionValue<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem>(o, v, null));
writer.WriteEndObject();
}
}
Expand All @@ -75,7 +75,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
public sealed partial class HdrPercentilesAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate
{
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public HdrPercentilesAggregate(Elastic.Clients.Elasticsearch.Aggregations.Percentiles values)
public HdrPercentilesAggregate(System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem> values)
{
Values = values;
}
Expand Down Expand Up @@ -104,5 +104,5 @@ internal HdrPercentilesAggregate(Elastic.Clients.Elasticsearch.Serialization.Jso
#if NET7_0_OR_GREATER
required
#endif
Elastic.Clients.Elasticsearch.Aggregations.Percentiles Values { get; set; }
System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem> Values { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ internal sealed partial class MovingPercentilesAggregationConverter : System.Tex
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");

Expand Down Expand Up @@ -56,6 +57,12 @@ public override Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggr
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<int>(o)))
{
continue;
Expand Down Expand Up @@ -92,6 +99,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
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<Elastic.Clients.Elasticsearch.Aggregations.GapPolicy>(o, v));
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, PropShift, value.Shift, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue<int>(o, v));
writer.WriteProperty(options, PropWindow, value.Window, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue<int>(o, v));
writer.WriteEndObject();
Expand Down Expand Up @@ -139,6 +147,8 @@ internal MovingPercentilesAggregation(Elastic.Clients.Elasticsearch.Serializatio
/// </summary>
public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; }

public bool? Keyed => false;

/// <summary>
/// <para>
/// By default, the window consists of the last n values excluding the current bucket.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ internal sealed partial class PercentileRanksAggregationConverter : System.Text.
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");
Expand Down Expand Up @@ -60,6 +61,12 @@ public override Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggreg
continue;
}

if (reader.ValueTextEquals(PropKeyed))
{
reader.Skip();
continue;
}

if (propMissing.TryReadProperty(ref reader, options, PropMissing, null))
{
continue;
Expand Down Expand Up @@ -108,6 +115,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
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<bool>(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);
Expand Down Expand Up @@ -150,6 +158,14 @@ internal PercentileRanksAggregation(Elastic.Clients.Elasticsearch.Serialization.
/// </summary>
public Elastic.Clients.Elasticsearch.Aggregations.HdrMethod? Hdr { get; set; }

/// <summary>
/// <para>
/// By default, the aggregation associates a unique string key with each bucket and returns the ranges as a hash rather than an array.
/// Set to <c>false</c> to disable this behavior.
/// </para>
/// </summary>
public bool? Keyed => false;

/// <summary>
/// <para>
/// The value to apply to documents that do not have a value.
Expand Down

This file was deleted.

Loading
Loading