Skip to content

[Backport 8.0] Regenerate code with latest spec fixes for local metadata #6924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2022
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 @@ -43,10 +43,6 @@ public sealed partial class AggregateMetricDoubleProperty : IProperty
[JsonPropertyName("ignore_above")]
public int? IgnoreAbove { get; set; }

[JsonInclude]
[JsonPropertyName("local_metadata")]
public Dictionary<string, object>? LocalMetadata { get; set; }

[JsonInclude]
[JsonPropertyName("meta")]
public Dictionary<string, string>? Meta { get; set; }
Expand Down Expand Up @@ -83,8 +79,6 @@ public AggregateMetricDoublePropertyDescriptor() : base()

private int? IgnoreAboveValue { get; set; }

private Dictionary<string, object>? LocalMetadataValue { get; set; }

private Dictionary<string, string>? MetaValue { get; set; }

private ICollection<string> MetricsValue { get; set; }
Expand Down Expand Up @@ -131,12 +125,6 @@ public AggregateMetricDoublePropertyDescriptor<TDocument> IgnoreAbove(int? ignor
return Self;
}

public AggregateMetricDoublePropertyDescriptor<TDocument> LocalMetadata(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> selector)
{
LocalMetadataValue = selector?.Invoke(new FluentDictionary<string, object>());
return Self;
}

public AggregateMetricDoublePropertyDescriptor<TDocument> Meta(Func<FluentDictionary<string, string>, FluentDictionary<string, string>> selector)
{
MetaValue = selector?.Invoke(new FluentDictionary<string, string>());
Expand Down Expand Up @@ -198,12 +186,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
writer.WriteNumberValue(IgnoreAboveValue.Value);
}

if (LocalMetadataValue is not null)
{
writer.WritePropertyName("local_metadata");
JsonSerializer.Serialize(writer, LocalMetadataValue, options);
}

if (MetaValue is not null)
{
writer.WritePropertyName("meta");
Expand All @@ -230,7 +212,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
}

AggregateMetricDoubleProperty IBuildableDescriptor<AggregateMetricDoubleProperty>.Build() => new()
{ DefaultMetric = DefaultMetricValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Metrics = MetricsValue, Properties = PropertiesValue, TimeSeriesMetric = TimeSeriesMetricValue };
{ DefaultMetric = DefaultMetricValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Meta = MetaValue, Metrics = MetricsValue, Properties = PropertiesValue, TimeSeriesMetric = TimeSeriesMetricValue };
}

public sealed partial class AggregateMetricDoublePropertyDescriptor : SerializableDescriptor<AggregateMetricDoublePropertyDescriptor>, IBuildableDescriptor<AggregateMetricDoubleProperty>
Expand All @@ -248,8 +230,6 @@ public AggregateMetricDoublePropertyDescriptor() : base()

private int? IgnoreAboveValue { get; set; }

private Dictionary<string, object>? LocalMetadataValue { get; set; }

private Dictionary<string, string>? MetaValue { get; set; }

private ICollection<string> MetricsValue { get; set; }
Expand Down Expand Up @@ -296,12 +276,6 @@ public AggregateMetricDoublePropertyDescriptor IgnoreAbove(int? ignoreAbove)
return Self;
}

public AggregateMetricDoublePropertyDescriptor LocalMetadata(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> selector)
{
LocalMetadataValue = selector?.Invoke(new FluentDictionary<string, object>());
return Self;
}

public AggregateMetricDoublePropertyDescriptor Meta(Func<FluentDictionary<string, string>, FluentDictionary<string, string>> selector)
{
MetaValue = selector?.Invoke(new FluentDictionary<string, string>());
Expand Down Expand Up @@ -363,12 +337,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
writer.WriteNumberValue(IgnoreAboveValue.Value);
}

if (LocalMetadataValue is not null)
{
writer.WritePropertyName("local_metadata");
JsonSerializer.Serialize(writer, LocalMetadataValue, options);
}

if (MetaValue is not null)
{
writer.WritePropertyName("meta");
Expand All @@ -395,5 +363,5 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
}

AggregateMetricDoubleProperty IBuildableDescriptor<AggregateMetricDoubleProperty>.Build() => new()
{ DefaultMetric = DefaultMetricValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Metrics = MetricsValue, Properties = PropertiesValue, TimeSeriesMetric = TimeSeriesMetricValue };
{ DefaultMetric = DefaultMetricValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Meta = MetaValue, Metrics = MetricsValue, Properties = PropertiesValue, TimeSeriesMetric = TimeSeriesMetricValue };
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ public sealed partial class BinaryProperty : IProperty
[JsonPropertyName("ignore_above")]
public int? IgnoreAbove { get; set; }

[JsonInclude]
[JsonPropertyName("local_metadata")]
public Dictionary<string, object>? LocalMetadata { get; set; }

[JsonInclude]
[JsonPropertyName("meta")]
public Dictionary<string, string>? Meta { get; set; }
Expand Down Expand Up @@ -89,8 +85,6 @@ public BinaryPropertyDescriptor() : base()

private int? IgnoreAboveValue { get; set; }

private Dictionary<string, object>? LocalMetadataValue { get; set; }

private Dictionary<string, string>? MetaValue { get; set; }

private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; }
Expand Down Expand Up @@ -143,12 +137,6 @@ public BinaryPropertyDescriptor<TDocument> IgnoreAbove(int? ignoreAbove)
return Self;
}

public BinaryPropertyDescriptor<TDocument> LocalMetadata(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> selector)
{
LocalMetadataValue = selector?.Invoke(new FluentDictionary<string, object>());
return Self;
}

public BinaryPropertyDescriptor<TDocument> Meta(Func<FluentDictionary<string, string>, FluentDictionary<string, string>> selector)
{
MetaValue = selector?.Invoke(new FluentDictionary<string, string>());
Expand Down Expand Up @@ -220,12 +208,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
writer.WriteNumberValue(IgnoreAboveValue.Value);
}

if (LocalMetadataValue is not null)
{
writer.WritePropertyName("local_metadata");
JsonSerializer.Serialize(writer, LocalMetadataValue, options);
}

if (MetaValue is not null)
{
writer.WritePropertyName("meta");
Expand Down Expand Up @@ -256,7 +238,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
}

BinaryProperty IBuildableDescriptor<BinaryProperty>.Build() => new()
{ CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue };
{ CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Meta = MetaValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue };
}

public sealed partial class BinaryPropertyDescriptor : SerializableDescriptor<BinaryPropertyDescriptor>, IBuildableDescriptor<BinaryProperty>
Expand All @@ -276,8 +258,6 @@ public BinaryPropertyDescriptor() : base()

private int? IgnoreAboveValue { get; set; }

private Dictionary<string, object>? LocalMetadataValue { get; set; }

private Dictionary<string, string>? MetaValue { get; set; }

private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; }
Expand Down Expand Up @@ -330,12 +310,6 @@ public BinaryPropertyDescriptor IgnoreAbove(int? ignoreAbove)
return Self;
}

public BinaryPropertyDescriptor LocalMetadata(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> selector)
{
LocalMetadataValue = selector?.Invoke(new FluentDictionary<string, object>());
return Self;
}

public BinaryPropertyDescriptor Meta(Func<FluentDictionary<string, string>, FluentDictionary<string, string>> selector)
{
MetaValue = selector?.Invoke(new FluentDictionary<string, string>());
Expand Down Expand Up @@ -407,12 +381,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
writer.WriteNumberValue(IgnoreAboveValue.Value);
}

if (LocalMetadataValue is not null)
{
writer.WritePropertyName("local_metadata");
JsonSerializer.Serialize(writer, LocalMetadataValue, options);
}

if (MetaValue is not null)
{
writer.WritePropertyName("meta");
Expand Down Expand Up @@ -443,5 +411,5 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
}

BinaryProperty IBuildableDescriptor<BinaryProperty>.Build() => new()
{ CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue };
{ CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Meta = MetaValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue };
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ public sealed partial class BooleanProperty : IProperty
[JsonPropertyName("index")]
public bool? Index { get; set; }

[JsonInclude]
[JsonPropertyName("local_metadata")]
public Dictionary<string, object>? LocalMetadata { get; set; }

[JsonInclude]
[JsonPropertyName("meta")]
public Dictionary<string, string>? Meta { get; set; }
Expand Down Expand Up @@ -115,8 +111,6 @@ public BooleanPropertyDescriptor() : base()

private bool? IndexValue { get; set; }

private Dictionary<string, object>? LocalMetadataValue { get; set; }

private Dictionary<string, string>? MetaValue { get; set; }

private bool? NullValueValue { get; set; }
Expand Down Expand Up @@ -207,12 +201,6 @@ public BooleanPropertyDescriptor<TDocument> Index(bool? index = true)
return Self;
}

public BooleanPropertyDescriptor<TDocument> LocalMetadata(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> selector)
{
LocalMetadataValue = selector?.Invoke(new FluentDictionary<string, object>());
return Self;
}

public BooleanPropertyDescriptor<TDocument> Meta(Func<FluentDictionary<string, string>, FluentDictionary<string, string>> selector)
{
MetaValue = selector?.Invoke(new FluentDictionary<string, string>());
Expand Down Expand Up @@ -318,12 +306,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
writer.WriteBooleanValue(IndexValue.Value);
}

if (LocalMetadataValue is not null)
{
writer.WritePropertyName("local_metadata");
JsonSerializer.Serialize(writer, LocalMetadataValue, options);
}

if (MetaValue is not null)
{
writer.WritePropertyName("meta");
Expand Down Expand Up @@ -384,7 +366,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
}

BooleanProperty IBuildableDescriptor<BooleanProperty>.Build() => new()
{ Boost = BoostValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fielddata = BuildFielddata(), Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue };
{ Boost = BoostValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fielddata = BuildFielddata(), Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Index = IndexValue, Meta = MetaValue, NullValue = NullValueValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue };
}

public sealed partial class BooleanPropertyDescriptor : SerializableDescriptor<BooleanPropertyDescriptor>, IBuildableDescriptor<BooleanProperty>
Expand Down Expand Up @@ -414,8 +396,6 @@ public BooleanPropertyDescriptor() : base()

private bool? IndexValue { get; set; }

private Dictionary<string, object>? LocalMetadataValue { get; set; }

private Dictionary<string, string>? MetaValue { get; set; }

private bool? NullValueValue { get; set; }
Expand Down Expand Up @@ -506,12 +486,6 @@ public BooleanPropertyDescriptor Index(bool? index = true)
return Self;
}

public BooleanPropertyDescriptor LocalMetadata(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> selector)
{
LocalMetadataValue = selector?.Invoke(new FluentDictionary<string, object>());
return Self;
}

public BooleanPropertyDescriptor Meta(Func<FluentDictionary<string, string>, FluentDictionary<string, string>> selector)
{
MetaValue = selector?.Invoke(new FluentDictionary<string, string>());
Expand Down Expand Up @@ -617,12 +591,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
writer.WriteBooleanValue(IndexValue.Value);
}

if (LocalMetadataValue is not null)
{
writer.WritePropertyName("local_metadata");
JsonSerializer.Serialize(writer, LocalMetadataValue, options);
}

if (MetaValue is not null)
{
writer.WritePropertyName("meta");
Expand Down Expand Up @@ -683,5 +651,5 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
}

BooleanProperty IBuildableDescriptor<BooleanProperty>.Build() => new()
{ Boost = BoostValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fielddata = BuildFielddata(), Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue };
{ Boost = BoostValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fielddata = BuildFielddata(), Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Index = IndexValue, Meta = MetaValue, NullValue = NullValueValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue };
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ public sealed partial class ByteNumberProperty : IProperty
[JsonPropertyName("index")]
public bool? Index { get; set; }

[JsonInclude]
[JsonPropertyName("local_metadata")]
public Dictionary<string, object>? LocalMetadata { get; set; }

[JsonInclude]
[JsonPropertyName("meta")]
public Dictionary<string, string>? Meta { get; set; }
Expand Down Expand Up @@ -133,8 +129,6 @@ public ByteNumberPropertyDescriptor() : base()

private bool? IndexValue { get; set; }

private Dictionary<string, object>? LocalMetadataValue { get; set; }

private Dictionary<string, string>? MetaValue { get; set; }

private double? NullValueValue { get; set; }
Expand Down Expand Up @@ -221,12 +215,6 @@ public ByteNumberPropertyDescriptor<TDocument> Index(bool? index = true)
return Self;
}

public ByteNumberPropertyDescriptor<TDocument> LocalMetadata(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> selector)
{
LocalMetadataValue = selector?.Invoke(new FluentDictionary<string, object>());
return Self;
}

public ByteNumberPropertyDescriptor<TDocument> Meta(Func<FluentDictionary<string, string>, FluentDictionary<string, string>> selector)
{
MetaValue = selector?.Invoke(new FluentDictionary<string, string>());
Expand Down Expand Up @@ -352,12 +340,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
writer.WriteBooleanValue(IndexValue.Value);
}

if (LocalMetadataValue is not null)
{
writer.WritePropertyName("local_metadata");
JsonSerializer.Serialize(writer, LocalMetadataValue, options);
}

if (MetaValue is not null)
{
writer.WritePropertyName("meta");
Expand Down Expand Up @@ -418,7 +400,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
}

ByteNumberProperty IBuildableDescriptor<ByteNumberProperty>.Build() => new()
{ Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue };
{ Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue };
}

public sealed partial class ByteNumberPropertyDescriptor : SerializableDescriptor<ByteNumberPropertyDescriptor>, IBuildableDescriptor<ByteNumberProperty>
Expand Down Expand Up @@ -446,8 +428,6 @@ public ByteNumberPropertyDescriptor() : base()

private bool? IndexValue { get; set; }

private Dictionary<string, object>? LocalMetadataValue { get; set; }

private Dictionary<string, string>? MetaValue { get; set; }

private double? NullValueValue { get; set; }
Expand Down Expand Up @@ -534,12 +514,6 @@ public ByteNumberPropertyDescriptor Index(bool? index = true)
return Self;
}

public ByteNumberPropertyDescriptor LocalMetadata(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> selector)
{
LocalMetadataValue = selector?.Invoke(new FluentDictionary<string, object>());
return Self;
}

public ByteNumberPropertyDescriptor Meta(Func<FluentDictionary<string, string>, FluentDictionary<string, string>> selector)
{
MetaValue = selector?.Invoke(new FluentDictionary<string, string>());
Expand Down Expand Up @@ -665,12 +639,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
writer.WriteBooleanValue(IndexValue.Value);
}

if (LocalMetadataValue is not null)
{
writer.WritePropertyName("local_metadata");
JsonSerializer.Serialize(writer, LocalMetadataValue, options);
}

if (MetaValue is not null)
{
writer.WritePropertyName("meta");
Expand Down Expand Up @@ -731,5 +699,5 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
}

ByteNumberProperty IBuildableDescriptor<ByteNumberProperty>.Build() => new()
{ Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue };
{ Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue };
}
Loading