@@ -118,7 +118,7 @@ public override DateHistogramAggregation Read(ref Utf8JsonReader reader, Type ty
118
118
119
119
if ( reader . ValueTextEquals ( "order" ) )
120
120
{
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 ) ;
122
122
if ( value is not null )
123
123
{
124
124
agg . Order = value ;
@@ -319,7 +319,7 @@ public DateHistogramAggregation(string name) : base(name)
319
319
320
320
[ JsonInclude ]
321
321
[ JsonPropertyName ( "order" ) ]
322
- public Elastic . Clients . Elasticsearch . Aggregations . HistogramOrder ? Order { get ; set ; }
322
+ public Elastic . Clients . Elasticsearch . Aggregations . AggregateOrder ? Order { get ; set ; }
323
323
324
324
[ JsonInclude ]
325
325
[ JsonPropertyName ( "params" ) ]
@@ -369,11 +369,7 @@ public DateHistogramAggregationDescriptor() : base()
369
369
370
370
private Elastic . Clients . Elasticsearch . Duration ? OffsetValue { get ; set ; }
371
371
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 ; }
377
373
378
374
private Dictionary < string , object > ? ParamsValue { get ; set ; }
379
375
@@ -481,30 +477,12 @@ public DateHistogramAggregationDescriptor<TDocument> Offset(Elastic.Clients.Elas
481
477
return Self ;
482
478
}
483
479
484
- public DateHistogramAggregationDescriptor < TDocument > Order ( Elastic . Clients . Elasticsearch . Aggregations . HistogramOrder ? order )
480
+ public DateHistogramAggregationDescriptor < TDocument > Order ( Elastic . Clients . Elasticsearch . Aggregations . AggregateOrder ? order )
485
481
{
486
- OrderDescriptor = null ;
487
- OrderDescriptorAction = null ;
488
482
OrderValue = order ;
489
483
return Self ;
490
484
}
491
485
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
-
508
486
public DateHistogramAggregationDescriptor < TDocument > Params ( Func < FluentDictionary < string , object > , FluentDictionary < string , object > > selector )
509
487
{
510
488
ParamsValue = selector ? . Invoke ( new FluentDictionary < string , object > ( ) ) ;
@@ -580,17 +558,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
580
558
JsonSerializer . Serialize ( writer , OffsetValue , options ) ;
581
559
}
582
560
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 )
594
562
{
595
563
writer . WritePropertyName ( "order" ) ;
596
564
JsonSerializer . Serialize ( writer , OrderValue , options ) ;
@@ -670,11 +638,7 @@ public DateHistogramAggregationDescriptor() : base()
670
638
671
639
private Elastic . Clients . Elasticsearch . Duration ? OffsetValue { get ; set ; }
672
640
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 ; }
678
642
679
643
private Dictionary < string , object > ? ParamsValue { get ; set ; }
680
644
@@ -788,30 +752,12 @@ public DateHistogramAggregationDescriptor Offset(Elastic.Clients.Elasticsearch.D
788
752
return Self ;
789
753
}
790
754
791
- public DateHistogramAggregationDescriptor Order ( Elastic . Clients . Elasticsearch . Aggregations . HistogramOrder ? order )
755
+ public DateHistogramAggregationDescriptor Order ( Elastic . Clients . Elasticsearch . Aggregations . AggregateOrder ? order )
792
756
{
793
- OrderDescriptor = null ;
794
- OrderDescriptorAction = null ;
795
757
OrderValue = order ;
796
758
return Self ;
797
759
}
798
760
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
-
815
761
public DateHistogramAggregationDescriptor Params ( Func < FluentDictionary < string , object > , FluentDictionary < string , object > > selector )
816
762
{
817
763
ParamsValue = selector ? . Invoke ( new FluentDictionary < string , object > ( ) ) ;
@@ -887,17 +833,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
887
833
JsonSerializer . Serialize ( writer , OffsetValue , options ) ;
888
834
}
889
835
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 )
901
837
{
902
838
writer . WritePropertyName ( "order" ) ;
903
839
JsonSerializer . Serialize ( writer , OrderValue , options ) ;
0 commit comments