From c5bf0560b118202eb2ba68474189f10ff95204d3 Mon Sep 17 00:00:00 2001 From: Vincent Pochet Date: Thu, 24 Oct 2024 14:22:07 +0200 Subject: [PATCH] feat(felixible aggregation): Expose expression in API --- lago_python_client/models/billable_metric.py | 2 ++ tests/fixtures/billable_metric.json | 7 ++----- tests/fixtures/billable_metric_index.json | 2 ++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lago_python_client/models/billable_metric.py b/lago_python_client/models/billable_metric.py index b76bc9eb..e81828e5 100644 --- a/lago_python_client/models/billable_metric.py +++ b/lago_python_client/models/billable_metric.py @@ -21,6 +21,7 @@ class BillableMetric(BaseModel): recurring: Optional[bool] aggregation_type: Optional[str] weighted_interval: Optional[str] + expression: Optional[str] field_name: Optional[str] filters: Optional[BillableMetricFilters] @@ -33,6 +34,7 @@ class BillableMetricResponse(BaseResponseModel): recurring: Optional[bool] aggregation_type: Optional[str] weighted_interval: Optional[str] + expression: Optional[str] field_name: Optional[str] created_at: str filters: BillableMetricFilters diff --git a/tests/fixtures/billable_metric.json b/tests/fixtures/billable_metric.json index f951bd44..a7ab7c4d 100644 --- a/tests/fixtures/billable_metric.json +++ b/tests/fixtures/billable_metric.json @@ -7,16 +7,13 @@ "aggregation_type": "sum_agg", "weighted_interval": null, "recurring": false, + "expression": "1 + 2", "field_name": "amount_sum", "created_at": "2022-04-29T08:59:51Z", "filters": [ { "key": "country", - "values": [ - "france", - "italy", - "spain" - ] + "values": ["france", "italy", "spain"] } ], "active_subscriptions_count": 0, diff --git a/tests/fixtures/billable_metric_index.json b/tests/fixtures/billable_metric_index.json index 4fc85f9d..d17df3b3 100644 --- a/tests/fixtures/billable_metric_index.json +++ b/tests/fixtures/billable_metric_index.json @@ -8,6 +8,7 @@ "aggregation_type": "sum_agg", "weighted_interval": null, "recurring": false, + "expression": "1 + 2", "field_name": "amount_sum", "created_at": "2022-04-29T08:59:51Z", "filters": [], @@ -23,6 +24,7 @@ "aggregation_type": "sum_agg", "weighted_interval": null, "recurring": false, + "expression": "1 + 2", "field_name": "amount_sum", "created_at": "2022-04-30T08:59:51Z", "filters": [],