diff --git a/compiler/src/steps/validate-model.ts b/compiler/src/steps/validate-model.ts index 86e7530f81..6a46d09527 100644 --- a/compiler/src/steps/validate-model.ts +++ b/compiler/src/steps/validate-model.ts @@ -610,6 +610,7 @@ export default async function validateModel (apiModel: model.Model, restSpec: Ma } else if (variants.kind === 'untagged') { if (fqn(parentName) !== '_types.query_dsl:DecayFunction' && fqn(parentName) !== '_types.query_dsl:DistanceFeatureQuery' && + fqn(parentName) !== '_types.aggregations:AggregationRange' && fqn(parentName) !== '_types.query_dsl:RangeQuery') { throw new Error(`Please contact the devtools team before adding new untagged variant ${fqn(parentName)}`) } diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index a1b04ed1ff..26f1691e29 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -63778,6 +63778,56 @@ ] }, "_types.aggregations:AggregationRange": { + "oneOf": [ + { + "$ref": "#/components/schemas/_types.aggregations:UntypedAggregationRange" + }, + { + "$ref": "#/components/schemas/_types.aggregations:NumberAggregationRange" + }, + { + "$ref": "#/components/schemas/_types.aggregations:StringAggregationRange" + } + ] + }, + "_types.aggregations:UntypedAggregationRange": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.aggregations:AggregationRangeBase" + }, + { + "type": "object" + } + ] + }, + "_types.aggregations:AggregationRangeBase": { + "type": "object", + "properties": { + "from": { + "description": "Start of the range (inclusive).", + "type": "object" + }, + "key": { + "description": "Custom key to return the range with.", + "type": "string" + }, + "to": { + "description": "End of the range (exclusive).", + "type": "object" + } + } + }, + "_types.aggregations:NumberAggregationRange": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.aggregations:AggregationRangeBasedouble" + }, + { + "type": "object" + } + ] + }, + "_types.aggregations:AggregationRangeBasedouble": { "type": "object", "properties": { "from": { @@ -63794,6 +63844,33 @@ } } }, + "_types.aggregations:StringAggregationRange": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.aggregations:AggregationRangeBasestring" + }, + { + "type": "object" + } + ] + }, + "_types.aggregations:AggregationRangeBasestring": { + "type": "object", + "properties": { + "from": { + "description": "Start of the range (inclusive).", + "type": "string" + }, + "key": { + "description": "Custom key to return the range with.", + "type": "string" + }, + "to": { + "description": "End of the range (exclusive).", + "type": "string" + } + } + }, "_types.aggregations:GeoHashGridAggregation": { "allOf": [ { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index d67a07918c..3397fa0aa0 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -40414,6 +40414,56 @@ ] }, "_types.aggregations:AggregationRange": { + "oneOf": [ + { + "$ref": "#/components/schemas/_types.aggregations:UntypedAggregationRange" + }, + { + "$ref": "#/components/schemas/_types.aggregations:NumberAggregationRange" + }, + { + "$ref": "#/components/schemas/_types.aggregations:StringAggregationRange" + } + ] + }, + "_types.aggregations:UntypedAggregationRange": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.aggregations:AggregationRangeBase" + }, + { + "type": "object" + } + ] + }, + "_types.aggregations:AggregationRangeBase": { + "type": "object", + "properties": { + "from": { + "description": "Start of the range (inclusive).", + "type": "object" + }, + "key": { + "description": "Custom key to return the range with.", + "type": "string" + }, + "to": { + "description": "End of the range (exclusive).", + "type": "object" + } + } + }, + "_types.aggregations:NumberAggregationRange": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.aggregations:AggregationRangeBasedouble" + }, + { + "type": "object" + } + ] + }, + "_types.aggregations:AggregationRangeBasedouble": { "type": "object", "properties": { "from": { @@ -40430,6 +40480,33 @@ } } }, + "_types.aggregations:StringAggregationRange": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.aggregations:AggregationRangeBasestring" + }, + { + "type": "object" + } + ] + }, + "_types.aggregations:AggregationRangeBasestring": { + "type": "object", + "properties": { + "from": { + "description": "Start of the range (inclusive).", + "type": "string" + }, + "key": { + "description": "Custom key to return the range with.", + "type": "string" + }, + "to": { + "description": "End of the range (exclusive).", + "type": "string" + } + } + }, "_types.aggregations:GeoHashGridAggregation": { "allOf": [ { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 17a06964ac..bc6980e105 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -60529,7 +60529,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1045-L1109" + "specLocation": "_types/aggregations/bucket.ts#L1060-L1124" }, { "codegenNames": [ @@ -60541,7 +60541,7 @@ "name": "CategorizeTextAnalyzer", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L1111-L1114", + "specLocation": "_types/aggregations/bucket.ts#L1126-L1129", "type": { "items": [ { @@ -60609,7 +60609,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1116-L1120" + "specLocation": "_types/aggregations/bucket.ts#L1131-L1135" }, { "inherits": { @@ -61483,7 +61483,7 @@ "name": "AggregateOrder", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L983-L985", + "specLocation": "_types/aggregations/bucket.ts#L998-L1000", "type": { "items": [ { @@ -61958,7 +61958,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1167-L1191" + "specLocation": "_types/aggregations/bucket.ts#L1182-L1206" }, { "kind": "interface", @@ -62003,7 +62003,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1153-L1165" + "specLocation": "_types/aggregations/bucket.ts#L1168-L1180" }, { "codegenNames": [ @@ -62015,7 +62015,7 @@ "name": "TermsExclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L1008-L1009", + "specLocation": "_types/aggregations/bucket.ts#L1023-L1024", "type": { "items": [ { @@ -62050,7 +62050,7 @@ "name": "TermsInclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L1005-L1006", + "specLocation": "_types/aggregations/bucket.ts#L1020-L1021", "type": { "items": [ { @@ -62113,7 +62113,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1011-L1020" + "specLocation": "_types/aggregations/bucket.ts#L1026-L1035" }, { "inherits": { @@ -62391,11 +62391,83 @@ "specLocation": "_types/aggregations/bucket.ts#L382-L405" }, { - "kind": "interface", + "codegenNames": [ + "untyped", + "number", + "string" + ], + "kind": "type_alias", "name": { "name": "AggregationRange", "namespace": "_types.aggregations" }, + "specLocation": "_types/aggregations/bucket.ts#L674-L681", + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "UntypedAggregationRange", + "namespace": "_types.aggregations" + } + }, + { + "kind": "instance_of", + "type": { + "name": "NumberAggregationRange", + "namespace": "_types.aggregations" + } + }, + { + "kind": "instance_of", + "type": { + "name": "StringAggregationRange", + "namespace": "_types.aggregations" + } + } + ], + "kind": "union_of" + }, + "variants": { + "kind": "untagged", + "untypedVariant": { + "name": "UntypedAggregationRange", + "namespace": "_types.aggregations" + } + } + }, + { + "inherits": { + "generics": [ + { + "kind": "user_defined_value" + } + ], + "type": { + "name": "AggregationRangeBase", + "namespace": "_types.aggregations" + } + }, + "kind": "interface", + "name": { + "name": "UntypedAggregationRange", + "namespace": "_types.aggregations" + }, + "properties": [], + "specLocation": "_types/aggregations/bucket.ts#L702-L702" + }, + { + "generics": [ + { + "name": "T", + "namespace": "_types.aggregations.AggregationRangeBase" + } + ], + "kind": "interface", + "name": { + "name": "AggregationRangeBase", + "namespace": "_types.aggregations" + }, "properties": [ { "description": "Start of the range (inclusive).", @@ -62404,8 +62476,8 @@ "type": { "kind": "instance_of", "type": { - "name": "double", - "namespace": "_types" + "name": "T", + "namespace": "_types.aggregations.AggregationRangeBase" } } }, @@ -62426,15 +62498,63 @@ "name": "to", "required": false, "type": { + "kind": "instance_of", + "type": { + "name": "T", + "namespace": "_types.aggregations.AggregationRangeBase" + } + } + } + ], + "specLocation": "_types/aggregations/bucket.ts#L683-L696" + }, + { + "inherits": { + "generics": [ + { "kind": "instance_of", "type": { "name": "double", "namespace": "_types" } } + ], + "type": { + "name": "AggregationRangeBase", + "namespace": "_types.aggregations" } - ], - "specLocation": "_types/aggregations/bucket.ts#L674-L687" + }, + "kind": "interface", + "name": { + "name": "NumberAggregationRange", + "namespace": "_types.aggregations" + }, + "properties": [], + "specLocation": "_types/aggregations/bucket.ts#L698-L698" + }, + { + "inherits": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + ], + "type": { + "name": "AggregationRangeBase", + "namespace": "_types.aggregations" + } + }, + "kind": "interface", + "name": { + "name": "StringAggregationRange", + "namespace": "_types.aggregations" + }, + "properties": [], + "specLocation": "_types/aggregations/bucket.ts#L700-L700" }, { "inherits": { @@ -63215,7 +63335,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1122-L1151" + "specLocation": "_types/aggregations/bucket.ts#L1137-L1166" }, { "inherits": { @@ -64286,7 +64406,7 @@ "name": "TermsAggregationCollectMode", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L987-L996" + "specLocation": "_types/aggregations/bucket.ts#L1002-L1011" }, { "kind": "interface", @@ -64852,7 +64972,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L689-L719" + "specLocation": "_types/aggregations/bucket.ts#L704-L734" }, { "inherits": { @@ -64939,7 +65059,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L721-L727" + "specLocation": "_types/aggregations/bucket.ts#L736-L742" }, { "inherits": { @@ -64968,7 +65088,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L729-L735" + "specLocation": "_types/aggregations/bucket.ts#L744-L750" }, { "inherits": { @@ -65276,7 +65396,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L772-L836" + "specLocation": "_types/aggregations/bucket.ts#L787-L851" }, { "kind": "interface", @@ -65310,7 +65430,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L737-L746" + "specLocation": "_types/aggregations/bucket.ts#L752-L761" }, { "kind": "enum", @@ -65332,7 +65452,7 @@ "name": "TermsAggregationExecutionHint", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L998-L1003" + "specLocation": "_types/aggregations/bucket.ts#L1013-L1018" }, { "kind": "interface", @@ -65354,7 +65474,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L748-L753" + "specLocation": "_types/aggregations/bucket.ts#L763-L768" }, { "kind": "interface", @@ -65388,7 +65508,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L755-L764" + "specLocation": "_types/aggregations/bucket.ts#L770-L779" }, { "kind": "interface", @@ -65397,7 +65517,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L766-L766" + "specLocation": "_types/aggregations/bucket.ts#L781-L781" }, { "kind": "interface", @@ -65418,7 +65538,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L768-L770" + "specLocation": "_types/aggregations/bucket.ts#L783-L785" }, { "inherits": { @@ -65639,7 +65759,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L838-L910" + "specLocation": "_types/aggregations/bucket.ts#L853-L925" }, { "inherits": { @@ -65946,7 +66066,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L912-L977" + "specLocation": "_types/aggregations/bucket.ts#L927-L992" }, { "inherits": { @@ -66570,7 +66690,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1022-L1043" + "specLocation": "_types/aggregations/bucket.ts#L1037-L1058" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index e5eaf5d5ea..39bd7c7268 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -49738,7 +49738,7 @@ "name": "AggregateOrder", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L983-L985", + "specLocation": "_types/aggregations/bucket.ts#L998-L1000", "type": { "items": [ { @@ -50927,11 +50927,63 @@ } }, { - "kind": "interface", + "codegenNames": [ + "untyped", + "number", + "string" + ], + "kind": "type_alias", "name": { "name": "AggregationRange", "namespace": "_types.aggregations" }, + "specLocation": "_types/aggregations/bucket.ts#L674-L681", + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "UntypedAggregationRange", + "namespace": "_types.aggregations" + } + }, + { + "kind": "instance_of", + "type": { + "name": "NumberAggregationRange", + "namespace": "_types.aggregations" + } + }, + { + "kind": "instance_of", + "type": { + "name": "StringAggregationRange", + "namespace": "_types.aggregations" + } + } + ], + "kind": "union_of" + }, + "variants": { + "kind": "untagged", + "untypedVariant": { + "name": "UntypedAggregationRange", + "namespace": "_types.aggregations" + } + } + }, + { + "generics": [ + { + "name": "T", + "namespace": "_types.aggregations.AggregationRangeBase" + } + ], + "kind": "interface", + "name": { + "name": "AggregationRangeBase", + "namespace": "_types.aggregations" + }, "properties": [ { "description": "Start of the range (inclusive).", @@ -50940,8 +50992,8 @@ "type": { "kind": "instance_of", "type": { - "name": "double", - "namespace": "_types" + "name": "T", + "namespace": "_types.aggregations.AggregationRangeBase" } } }, @@ -50964,13 +51016,13 @@ "type": { "kind": "instance_of", "type": { - "name": "double", - "namespace": "_types" + "name": "T", + "namespace": "_types.aggregations.AggregationRangeBase" } } } ], - "specLocation": "_types/aggregations/bucket.ts#L674-L687" + "specLocation": "_types/aggregations/bucket.ts#L683-L696" }, { "kind": "interface", @@ -52241,7 +52293,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1045-L1109" + "specLocation": "_types/aggregations/bucket.ts#L1060-L1124" }, { "codegenNames": [ @@ -52253,7 +52305,7 @@ "name": "CategorizeTextAnalyzer", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L1111-L1114", + "specLocation": "_types/aggregations/bucket.ts#L1126-L1129", "type": { "items": [ { @@ -52306,7 +52358,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L737-L746" + "specLocation": "_types/aggregations/bucket.ts#L752-L761" }, { "attachedBehaviors": [ @@ -52921,7 +52973,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1116-L1120" + "specLocation": "_types/aggregations/bucket.ts#L1131-L1135" }, { "inherits": { @@ -54318,7 +54370,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1167-L1191" + "specLocation": "_types/aggregations/bucket.ts#L1182-L1206" }, { "attachedBehaviors": [ @@ -54418,7 +54470,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1153-L1165" + "specLocation": "_types/aggregations/bucket.ts#L1168-L1180" }, { "kind": "enum", @@ -55289,7 +55341,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L748-L753" + "specLocation": "_types/aggregations/bucket.ts#L763-L768" }, { "kind": "interface", @@ -56178,7 +56230,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1122-L1151" + "specLocation": "_types/aggregations/bucket.ts#L1137-L1166" }, { "attachedBehaviors": [ @@ -57784,7 +57836,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L755-L764" + "specLocation": "_types/aggregations/bucket.ts#L770-L779" }, { "attachedBehaviors": [ @@ -57896,6 +57948,30 @@ }, "specLocation": "_types/aggregations/pipeline.ts#L326-L352" }, + { + "inherits": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + ], + "type": { + "name": "AggregationRangeBase", + "namespace": "_types.aggregations" + } + }, + "kind": "interface", + "name": { + "name": "NumberAggregationRange", + "namespace": "_types.aggregations" + }, + "properties": [], + "specLocation": "_types/aggregations/bucket.ts#L698-L698" + }, { "attachedBehaviors": [ "AdditionalProperties" @@ -57950,7 +58026,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L766-L766" + "specLocation": "_types/aggregations/bucket.ts#L781-L781" }, { "inherits": { @@ -58539,7 +58615,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L689-L719" + "specLocation": "_types/aggregations/bucket.ts#L704-L734" }, { "inherits": { @@ -58684,7 +58760,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L721-L727" + "specLocation": "_types/aggregations/bucket.ts#L736-L742" }, { "attachedBehaviors": [ @@ -58732,7 +58808,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L729-L735" + "specLocation": "_types/aggregations/bucket.ts#L744-L750" }, { "kind": "enum", @@ -58775,7 +58851,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L768-L770" + "specLocation": "_types/aggregations/bucket.ts#L783-L785" }, { "inherits": { @@ -59281,7 +59357,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L772-L836" + "specLocation": "_types/aggregations/bucket.ts#L787-L851" }, { "attachedBehaviors": [ @@ -59543,7 +59619,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L838-L910" + "specLocation": "_types/aggregations/bucket.ts#L853-L925" }, { "inherits": { @@ -60129,6 +60205,30 @@ "properties": [], "specLocation": "_types/aggregations/pipeline.ts#L369-L369" }, + { + "inherits": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + ], + "type": { + "name": "AggregationRangeBase", + "namespace": "_types.aggregations" + } + }, + "kind": "interface", + "name": { + "name": "StringAggregationRange", + "namespace": "_types.aggregations" + }, + "properties": [], + "specLocation": "_types/aggregations/bucket.ts#L700-L700" + }, { "description": "Result of the `rare_terms` aggregation when the field is a string.", "inherits": { @@ -60953,7 +61053,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L912-L977" + "specLocation": "_types/aggregations/bucket.ts#L927-L992" }, { "kind": "enum", @@ -60971,7 +61071,7 @@ "name": "TermsAggregationCollectMode", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L987-L996" + "specLocation": "_types/aggregations/bucket.ts#L1002-L1011" }, { "kind": "enum", @@ -60993,7 +61093,7 @@ "name": "TermsAggregationExecutionHint", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L998-L1003" + "specLocation": "_types/aggregations/bucket.ts#L1013-L1018" }, { "attachedBehaviors": [ @@ -61035,7 +61135,7 @@ "name": "TermsExclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L1008-L1009", + "specLocation": "_types/aggregations/bucket.ts#L1023-L1024", "type": { "items": [ { @@ -61070,7 +61170,7 @@ "name": "TermsInclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L1005-L1006", + "specLocation": "_types/aggregations/bucket.ts#L1020-L1021", "type": { "items": [ { @@ -61133,7 +61233,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1011-L1020" + "specLocation": "_types/aggregations/bucket.ts#L1026-L1035" }, { "kind": "interface", @@ -61695,6 +61795,26 @@ "specLocation": "_types/aggregations/Aggregate.ts#L425-L431", "variantName": "umterms" }, + { + "inherits": { + "generics": [ + { + "kind": "user_defined_value" + } + ], + "type": { + "name": "AggregationRangeBase", + "namespace": "_types.aggregations" + } + }, + "kind": "interface", + "name": { + "name": "UntypedAggregationRange", + "namespace": "_types.aggregations" + }, + "properties": [], + "specLocation": "_types/aggregations/bucket.ts#L702-L702" + }, { "description": "Value count aggregation result. `value` is always present.", "inherits": { @@ -61860,7 +61980,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1022-L1043" + "specLocation": "_types/aggregations/bucket.ts#L1037-L1058" }, { "attachedBehaviors": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 1a0bb06f1d..831763a458 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2988,10 +2988,12 @@ export interface AggregationsAggregationContainer { variable_width_histogram?: AggregationsVariableWidthHistogramAggregation } -export interface AggregationsAggregationRange { - from?: double +export type AggregationsAggregationRange = AggregationsUntypedAggregationRange | AggregationsNumberAggregationRange | AggregationsStringAggregationRange + +export interface AggregationsAggregationRangeBase { + from?: T key?: string - to?: double + to?: T } export interface AggregationsArrayPercentilesItem { @@ -3811,6 +3813,9 @@ export interface AggregationsNormalizeAggregation extends AggregationsPipelineAg export type AggregationsNormalizeMethod = 'rescale_0_1' | 'rescale_0_100' | 'percent_of_sum' | 'mean' | 'z-score' | 'softmax' +export interface AggregationsNumberAggregationRange extends AggregationsAggregationRangeBase { +} + export interface AggregationsParentAggregateKeys extends AggregationsSingleBucketAggregateBase { } export type AggregationsParentAggregate = AggregationsParentAggregateKeys @@ -4063,6 +4068,9 @@ export interface AggregationsStatsBucketAggregate extends AggregationsStatsAggre export interface AggregationsStatsBucketAggregation extends AggregationsPipelineAggregationBase { } +export interface AggregationsStringAggregationRange extends AggregationsAggregationRangeBase { +} + export interface AggregationsStringRareTermsAggregate extends AggregationsMultiBucketAggregateBase { } @@ -4230,6 +4238,9 @@ export interface AggregationsUnmappedSignificantTermsAggregate extends Aggregati export interface AggregationsUnmappedTermsAggregate extends AggregationsTermsAggregateBase { } +export interface AggregationsUntypedAggregationRange extends AggregationsAggregationRangeBase { +} + export interface AggregationsValueCountAggregate extends AggregationsSingleMetricAggregateBase { } diff --git a/specification/_types/aggregations/bucket.ts b/specification/_types/aggregations/bucket.ts index c3343f096a..7acd0821ad 100644 --- a/specification/_types/aggregations/bucket.ts +++ b/specification/_types/aggregations/bucket.ts @@ -671,11 +671,20 @@ export class RangeAggregation extends BucketAggregationBase { format?: string } -export class AggregationRange { +/** + * @codegen_names untyped, number, string + * @variants untagged untyped=_types.aggregations.UntypedAggregationRange + */ +export type AggregationRange = + | UntypedAggregationRange + | NumberAggregationRange + | StringAggregationRange + +export class AggregationRangeBase { /** * Start of the range (inclusive). */ - from?: double + from?: T /** * Custom key to return the range with. */ @@ -683,9 +692,15 @@ export class AggregationRange { /** * End of the range (exclusive). */ - to?: double + to?: T } +export class NumberAggregationRange extends AggregationRangeBase {} + +export class StringAggregationRange extends AggregationRangeBase {} + +export class UntypedAggregationRange extends AggregationRangeBase {} + export class RareTermsAggregation extends BucketAggregationBase { /** * Terms that should be excluded from the aggregation.