Skip to content

Commit

Permalink
feat(billable_metric): Expose rounding attributes (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet authored Nov 5, 2024
1 parent 03b758b commit 6017e8f
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions billable_metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ const (
WeightedSumAggregation AggregationType = "weighted_sum_agg"
)

type RoundingFunction string

const (
RoundRoundingFunction RoundingFunction = "round"
CeilRoundingFunction RoundingFunction = "ceil"
FloorRoundingFunction RoundingFunction = "floor"
)

type WeightedInterval string

const (
Expand All @@ -35,15 +43,17 @@ type BillableMetricParams struct {
}

type BillableMetricInput struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Description string `json:"description,omitempty"`
AggregationType AggregationType `json:"aggregation_type,omitempty"`
Recurring bool `json:"recurring,omitempty"`
Expression string `json:"expression,omitempty"`
FieldName string `json:"field_name"`
WeightedInterval WeightedInterval `json:"weighted_interval,omitempty"`
Filters []BillableMetricFilter `json:"filters,omitempty"`
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Description string `json:"description,omitempty"`
AggregationType AggregationType `json:"aggregation_type,omitempty"`
Recurring bool `json:"recurring,omitempty"`
RoundingFunction *RoundingFunction `json:"rounding_function,omitempty"`
RoundingPrecision *int `json:"rounding_precision,omitempty"`
Expression string `json:"expression,omitempty"`
FieldName string `json:"field_name"`
WeightedInterval WeightedInterval `json:"weighted_interval,omitempty"`
Filters []BillableMetricFilter `json:"filters,omitempty"`
}

type BillableMetricListInput struct {
Expand All @@ -68,6 +78,8 @@ type BillableMetric struct {
Code string `json:"code,omitempty"`
Description string `json:"description,omitempty"`
Recurring bool `json:"recurring,omitempty"`
RoundingFunction *RoundingFunction `json:"rounding_function,omitempty"`
RoundingPrecision *int `json:"rounding_precision,omitempty"`
AggregationType AggregationType `json:"aggregation_type,omitempty"`
Expression string `json:"expression,omitempty"`
FieldName string `json:"field_name"`
Expand Down

0 comments on commit 6017e8f

Please sign in to comment.