Skip to content

Commit 1208bce

Browse files
committed
Improve SortOptions generation
1 parent 37ee750 commit 1208bce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+659
-195
lines changed

src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.Aggregation Read(ref
111111
reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
112112
LocalJsonValue<System.Collections.Generic.IDictionary<string, Elastic.Clients.Elasticsearch.Aggregations.Aggregation>?> propAggregations = default;
113113
LocalJsonValue<System.Collections.Generic.IDictionary<string, object>?> propMeta = default;
114-
var variantType = string.Empty;
114+
string? variantType = null;
115115
object? variant = null;
116116
while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
117117
{
@@ -765,7 +765,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
765765
writer.WriteStartObject();
766766
switch (value.VariantType)
767767
{
768-
case "":
768+
case null:
769769
break;
770770
case "adjacency_matrix":
771771
writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation)value.Variant, null, null);
@@ -1011,8 +1011,8 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
10111011
[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AggregationConverter))]
10121012
public sealed partial class Aggregation
10131013
{
1014-
public string VariantType { get; internal set; } = string.Empty;
1015-
public object? Variant { get; internal set; }
1014+
internal string? VariantType { get; set; }
1015+
internal object? Variant { get; set; }
10161016
#if NET7_0_OR_GREATER
10171017
public Aggregation()
10181018
{

src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.g.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal sealed partial class InferenceConfigConverter : System.Text.Json.Serial
3131
public override Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
3232
{
3333
reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
34-
var variantType = string.Empty;
34+
string? variantType = null;
3535
object? variant = null;
3636
while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
3737
{
@@ -73,7 +73,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
7373
writer.WriteStartObject();
7474
switch (value.VariantType)
7575
{
76-
case "":
76+
case null:
7777
break;
7878
case "classification":
7979
writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions)value.Variant, null, null);
@@ -92,8 +92,8 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
9292
[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.InferenceConfigConverter))]
9393
public sealed partial class InferenceConfig
9494
{
95-
public string VariantType { get; internal set; } = string.Empty;
96-
public object? Variant { get; internal set; }
95+
internal string? VariantType { get; set; }
96+
internal object? Variant { get; set; }
9797
#if NET7_0_OR_GREATER
9898
public InferenceConfig()
9999
{

src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.g.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public override Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester Read(re
3838
LocalJsonValue<string?> propPrefix = default;
3939
LocalJsonValue<string?> propRegex = default;
4040
LocalJsonValue<string?> propText = default;
41-
var variantType = string.Empty;
41+
string? variantType = null;
4242
object? variant = null;
4343
while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
4444
{
@@ -106,7 +106,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
106106
writer.WriteStartObject();
107107
switch (value.VariantType)
108108
{
109-
case "":
109+
case null:
110110
break;
111111
case "completion":
112112
writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggester)value.Variant, null, null);
@@ -131,8 +131,8 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
131131
[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.FieldSuggesterConverter))]
132132
public sealed partial class FieldSuggester
133133
{
134-
public string VariantType { get; internal set; } = string.Empty;
135-
public object? Variant { get; internal set; }
134+
internal string? VariantType { get; set; }
135+
internal object? Variant { get; set; }
136136
#if NET7_0_OR_GREATER
137137
public FieldSuggester()
138138
{

src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.g.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public override Elastic.Clients.Elasticsearch.Core.Search.Rescore Read(ref Syste
3333
{
3434
reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
3535
LocalJsonValue<int?> propWindowSize = default;
36-
var variantType = string.Empty;
36+
string? variantType = null;
3737
object? variant = null;
3838
while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
3939
{
@@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
8181
writer.WriteStartObject();
8282
switch (value.VariantType)
8383
{
84-
case "":
84+
case null:
8585
break;
8686
case "learning_to_rank":
8787
writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.LearningToRank)value.Variant, null, null);
@@ -101,8 +101,8 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
101101
[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.RescoreConverter))]
102102
public sealed partial class Rescore
103103
{
104-
public string VariantType { get; internal set; } = string.Empty;
105-
public object? Variant { get; internal set; }
104+
internal string? VariantType { get; set; }
105+
internal object? Variant { get; set; }
106106
#if NET7_0_OR_GREATER
107107
public Rescore()
108108
{

src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.g.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal sealed partial class SmoothingModelConverter : System.Text.Json.Seriali
3232
public override Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
3333
{
3434
reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
35-
var variantType = string.Empty;
35+
string? variantType = null;
3636
object? variant = null;
3737
while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
3838
{
@@ -82,7 +82,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
8282
writer.WriteStartObject();
8383
switch (value.VariantType)
8484
{
85-
case "":
85+
case null:
8686
break;
8787
case "laplace":
8888
writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel)value.Variant, null, null);
@@ -104,8 +104,8 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
104104
[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.SmoothingModelConverter))]
105105
public sealed partial class SmoothingModel
106106
{
107-
public string VariantType { get; internal set; } = string.Empty;
108-
public object? Variant { get; internal set; }
107+
internal string? VariantType { get; set; }
108+
internal object? Variant { get; set; }
109109
#if NET7_0_OR_GREATER
110110
public SmoothingModel()
111111
{

0 commit comments

Comments
 (0)