@@ -46,13 +46,9 @@ public sealed partial class RolloverConditions
46
46
[ JsonPropertyName ( "max_primary_shard_size" ) ]
47
47
public Elastic . Clients . Elasticsearch . ByteSize ? MaxPrimaryShardSize { get ; set ; }
48
48
49
- [ JsonInclude ]
50
- [ JsonPropertyName ( "max_primary_shard_size_bytes" ) ]
51
- public Elastic . Clients . Elasticsearch . ByteSize ? MaxPrimaryShardSizeBytes { get ; set ; }
52
-
53
49
[ JsonInclude ]
54
50
[ JsonPropertyName ( "max_size" ) ]
55
- public string ? MaxSize { get ; set ; }
51
+ public Elastic . Clients . Elasticsearch . ByteSize ? MaxSize { get ; set ; }
56
52
57
53
[ JsonInclude ]
58
54
[ JsonPropertyName ( "max_size_bytes" ) ]
@@ -69,6 +65,14 @@ public sealed partial class RolloverConditions
69
65
[ JsonInclude ]
70
66
[ JsonPropertyName ( "min_primary_shard_docs" ) ]
71
67
public long ? MinPrimaryShardDocs { get ; set ; }
68
+
69
+ [ JsonInclude ]
70
+ [ JsonPropertyName ( "min_primary_shard_size" ) ]
71
+ public Elastic . Clients . Elasticsearch . ByteSize ? MinPrimaryShardSize { get ; set ; }
72
+
73
+ [ JsonInclude ]
74
+ [ JsonPropertyName ( "min_size" ) ]
75
+ public Elastic . Clients . Elasticsearch . ByteSize ? MinSize { get ; set ; }
72
76
}
73
77
74
78
public sealed partial class RolloverConditionsDescriptor : SerializableDescriptorBase < RolloverConditionsDescriptor >
@@ -88,9 +92,7 @@ public RolloverConditionsDescriptor() : base()
88
92
89
93
private Elastic . Clients . Elasticsearch . ByteSize ? MaxPrimaryShardSizeValue { get ; set ; }
90
94
91
- private Elastic . Clients . Elasticsearch . ByteSize ? MaxPrimaryShardSizeBytesValue { get ; set ; }
92
-
93
- private string ? MaxSizeValue { get ; set ; }
95
+ private Elastic . Clients . Elasticsearch . ByteSize ? MaxSizeValue { get ; set ; }
94
96
95
97
private Elastic . Clients . Elasticsearch . ByteSize ? MaxSizeBytesValue { get ; set ; }
96
98
@@ -100,6 +102,10 @@ public RolloverConditionsDescriptor() : base()
100
102
101
103
private long ? MinPrimaryShardDocsValue { get ; set ; }
102
104
105
+ private Elastic . Clients . Elasticsearch . ByteSize ? MinPrimaryShardSizeValue { get ; set ; }
106
+
107
+ private Elastic . Clients . Elasticsearch . ByteSize ? MinSizeValue { get ; set ; }
108
+
103
109
public RolloverConditionsDescriptor MaxAge ( Elastic . Clients . Elasticsearch . Duration ? maxAge )
104
110
{
105
111
MaxAgeValue = maxAge ;
@@ -130,13 +136,7 @@ public RolloverConditionsDescriptor MaxPrimaryShardSize(Elastic.Clients.Elastics
130
136
return Self ;
131
137
}
132
138
133
- public RolloverConditionsDescriptor MaxPrimaryShardSizeBytes ( Elastic . Clients . Elasticsearch . ByteSize ? maxPrimaryShardSizeBytes )
134
- {
135
- MaxPrimaryShardSizeBytesValue = maxPrimaryShardSizeBytes ;
136
- return Self ;
137
- }
138
-
139
- public RolloverConditionsDescriptor MaxSize ( string ? maxSize )
139
+ public RolloverConditionsDescriptor MaxSize ( Elastic . Clients . Elasticsearch . ByteSize ? maxSize )
140
140
{
141
141
MaxSizeValue = maxSize ;
142
142
return Self ;
@@ -166,6 +166,18 @@ public RolloverConditionsDescriptor MinPrimaryShardDocs(long? minPrimaryShardDoc
166
166
return Self ;
167
167
}
168
168
169
+ public RolloverConditionsDescriptor MinPrimaryShardSize ( Elastic . Clients . Elasticsearch . ByteSize ? minPrimaryShardSize )
170
+ {
171
+ MinPrimaryShardSizeValue = minPrimaryShardSize ;
172
+ return Self ;
173
+ }
174
+
175
+ public RolloverConditionsDescriptor MinSize ( Elastic . Clients . Elasticsearch . ByteSize ? minSize )
176
+ {
177
+ MinSizeValue = minSize ;
178
+ return Self ;
179
+ }
180
+
169
181
protected override void Serialize ( Utf8JsonWriter writer , JsonSerializerOptions options , IElasticsearchClientSettings settings )
170
182
{
171
183
writer . WriteStartObject ( ) ;
@@ -199,16 +211,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
199
211
JsonSerializer . Serialize ( writer , MaxPrimaryShardSizeValue , options ) ;
200
212
}
201
213
202
- if ( MaxPrimaryShardSizeBytesValue is not null )
203
- {
204
- writer . WritePropertyName ( "max_primary_shard_size_bytes" ) ;
205
- JsonSerializer . Serialize ( writer , MaxPrimaryShardSizeBytesValue , options ) ;
206
- }
207
-
208
- if ( ! string . IsNullOrEmpty ( MaxSizeValue ) )
214
+ if ( MaxSizeValue is not null )
209
215
{
210
216
writer . WritePropertyName ( "max_size" ) ;
211
- writer . WriteStringValue ( MaxSizeValue ) ;
217
+ JsonSerializer . Serialize ( writer , MaxSizeValue , options ) ;
212
218
}
213
219
214
220
if ( MaxSizeBytesValue is not null )
@@ -235,6 +241,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
235
241
writer . WriteNumberValue ( MinPrimaryShardDocsValue . Value ) ;
236
242
}
237
243
244
+ if ( MinPrimaryShardSizeValue is not null )
245
+ {
246
+ writer . WritePropertyName ( "min_primary_shard_size" ) ;
247
+ JsonSerializer . Serialize ( writer , MinPrimaryShardSizeValue , options ) ;
248
+ }
249
+
250
+ if ( MinSizeValue is not null )
251
+ {
252
+ writer . WritePropertyName ( "min_size" ) ;
253
+ JsonSerializer . Serialize ( writer , MinSizeValue , options ) ;
254
+ }
255
+
238
256
writer . WriteEndObject ( ) ;
239
257
}
240
258
}
0 commit comments