Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(billable_metric): Expose rounding attributes #215

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading