Skip to content

Commit

Permalink
feat(felixible aggregation): Expose expression in API
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet committed Oct 24, 2024
1 parent b5c9c93 commit c5bf056
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lago_python_client/models/billable_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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
Expand Down
7 changes: 2 additions & 5 deletions tests/fixtures/billable_metric.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions tests/fixtures/billable_metric_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand All @@ -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": [],
Expand Down

0 comments on commit c5bf056

Please sign in to comment.