@@ -118,7 +118,7 @@ public override DateHistogramAggregation Read(ref Utf8JsonReader reader, Type ty
118118
119119 if ( reader . ValueTextEquals ( "order" ) )
120120 {
121- var value = JsonSerializer . Deserialize < Elastic . Clients . Elasticsearch . Aggregations . HistogramOrder ? > ( ref reader , options ) ;
121+ var value = JsonSerializer . Deserialize < Elastic . Clients . Elasticsearch . Aggregations . AggregateOrder ? > ( ref reader , options ) ;
122122 if ( value is not null )
123123 {
124124 agg . Order = value ;
@@ -319,7 +319,7 @@ public DateHistogramAggregation(string name) : base(name)
319319
320320 [ JsonInclude ]
321321 [ JsonPropertyName ( "order" ) ]
322- public Elastic . Clients . Elasticsearch . Aggregations . HistogramOrder ? Order { get ; set ; }
322+ public Elastic . Clients . Elasticsearch . Aggregations . AggregateOrder ? Order { get ; set ; }
323323
324324 [ JsonInclude ]
325325 [ JsonPropertyName ( "params" ) ]
@@ -369,11 +369,7 @@ public DateHistogramAggregationDescriptor() : base()
369369
370370 private Elastic . Clients . Elasticsearch . Duration ? OffsetValue { get ; set ; }
371371
372- private Elastic . Clients . Elasticsearch . Aggregations . HistogramOrder ? OrderValue { get ; set ; }
373-
374- private HistogramOrderDescriptor OrderDescriptor { get ; set ; }
375-
376- private Action < HistogramOrderDescriptor > OrderDescriptorAction { get ; set ; }
372+ private Elastic . Clients . Elasticsearch . Aggregations . AggregateOrder ? OrderValue { get ; set ; }
377373
378374 private Dictionary < string , object > ? ParamsValue { get ; set ; }
379375
@@ -481,30 +477,12 @@ public DateHistogramAggregationDescriptor<TDocument> Offset(Elastic.Clients.Elas
481477 return Self ;
482478 }
483479
484- public DateHistogramAggregationDescriptor < TDocument > Order ( Elastic . Clients . Elasticsearch . Aggregations . HistogramOrder ? order )
480+ public DateHistogramAggregationDescriptor < TDocument > Order ( Elastic . Clients . Elasticsearch . Aggregations . AggregateOrder ? order )
485481 {
486- OrderDescriptor = null ;
487- OrderDescriptorAction = null ;
488482 OrderValue = order ;
489483 return Self ;
490484 }
491485
492- public DateHistogramAggregationDescriptor < TDocument > Order ( HistogramOrderDescriptor descriptor )
493- {
494- OrderValue = null ;
495- OrderDescriptorAction = null ;
496- OrderDescriptor = descriptor ;
497- return Self ;
498- }
499-
500- public DateHistogramAggregationDescriptor < TDocument > Order ( Action < HistogramOrderDescriptor > configure )
501- {
502- OrderValue = null ;
503- OrderDescriptor = null ;
504- OrderDescriptorAction = configure ;
505- return Self ;
506- }
507-
508486 public DateHistogramAggregationDescriptor < TDocument > Params ( Func < FluentDictionary < string , object > , FluentDictionary < string , object > > selector )
509487 {
510488 ParamsValue = selector ? . Invoke ( new FluentDictionary < string , object > ( ) ) ;
@@ -580,17 +558,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
580558 JsonSerializer . Serialize ( writer , OffsetValue , options ) ;
581559 }
582560
583- if ( OrderDescriptor is not null )
584- {
585- writer . WritePropertyName ( "order" ) ;
586- JsonSerializer . Serialize ( writer , OrderDescriptor , options ) ;
587- }
588- else if ( OrderDescriptorAction is not null )
589- {
590- writer . WritePropertyName ( "order" ) ;
591- JsonSerializer . Serialize ( writer , new HistogramOrderDescriptor ( OrderDescriptorAction ) , options ) ;
592- }
593- else if ( OrderValue is not null )
561+ if ( OrderValue is not null )
594562 {
595563 writer . WritePropertyName ( "order" ) ;
596564 JsonSerializer . Serialize ( writer , OrderValue , options ) ;
@@ -670,11 +638,7 @@ public DateHistogramAggregationDescriptor() : base()
670638
671639 private Elastic . Clients . Elasticsearch . Duration ? OffsetValue { get ; set ; }
672640
673- private Elastic . Clients . Elasticsearch . Aggregations . HistogramOrder ? OrderValue { get ; set ; }
674-
675- private HistogramOrderDescriptor OrderDescriptor { get ; set ; }
676-
677- private Action < HistogramOrderDescriptor > OrderDescriptorAction { get ; set ; }
641+ private Elastic . Clients . Elasticsearch . Aggregations . AggregateOrder ? OrderValue { get ; set ; }
678642
679643 private Dictionary < string , object > ? ParamsValue { get ; set ; }
680644
@@ -788,30 +752,12 @@ public DateHistogramAggregationDescriptor Offset(Elastic.Clients.Elasticsearch.D
788752 return Self ;
789753 }
790754
791- public DateHistogramAggregationDescriptor Order ( Elastic . Clients . Elasticsearch . Aggregations . HistogramOrder ? order )
755+ public DateHistogramAggregationDescriptor Order ( Elastic . Clients . Elasticsearch . Aggregations . AggregateOrder ? order )
792756 {
793- OrderDescriptor = null ;
794- OrderDescriptorAction = null ;
795757 OrderValue = order ;
796758 return Self ;
797759 }
798760
799- public DateHistogramAggregationDescriptor Order ( HistogramOrderDescriptor descriptor )
800- {
801- OrderValue = null ;
802- OrderDescriptorAction = null ;
803- OrderDescriptor = descriptor ;
804- return Self ;
805- }
806-
807- public DateHistogramAggregationDescriptor Order ( Action < HistogramOrderDescriptor > configure )
808- {
809- OrderValue = null ;
810- OrderDescriptor = null ;
811- OrderDescriptorAction = configure ;
812- return Self ;
813- }
814-
815761 public DateHistogramAggregationDescriptor Params ( Func < FluentDictionary < string , object > , FluentDictionary < string , object > > selector )
816762 {
817763 ParamsValue = selector ? . Invoke ( new FluentDictionary < string , object > ( ) ) ;
@@ -887,17 +833,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
887833 JsonSerializer . Serialize ( writer , OffsetValue , options ) ;
888834 }
889835
890- if ( OrderDescriptor is not null )
891- {
892- writer . WritePropertyName ( "order" ) ;
893- JsonSerializer . Serialize ( writer , OrderDescriptor , options ) ;
894- }
895- else if ( OrderDescriptorAction is not null )
896- {
897- writer . WritePropertyName ( "order" ) ;
898- JsonSerializer . Serialize ( writer , new HistogramOrderDescriptor ( OrderDescriptorAction ) , options ) ;
899- }
900- else if ( OrderValue is not null )
836+ if ( OrderValue is not null )
901837 {
902838 writer . WritePropertyName ( "order" ) ;
903839 JsonSerializer . Serialize ( writer , OrderValue , options ) ;
0 commit comments