pub struct CreateAlertV1Body {Show 14 fields
pub alert_specifiers: Vec<CreateAlertV1BodyAlertSpecifiersItem>,
pub alert_type: CreateAlertV1BodyAlertType,
pub billable_metric_id: Option<Uuid>,
pub credit_grant_type_filters: Vec<String>,
pub credit_type_id: Option<Uuid>,
pub custom_field_filters: Vec<CreateAlertV1BodyCustomFieldFiltersItem>,
pub customer_id: Option<Uuid>,
pub evaluate_on_create: Option<bool>,
pub group_values: Vec<CreateAlertV1BodyGroupValuesItem>,
pub invoice_types_filter: Vec<String>,
pub name: String,
pub seat_filter: Option<CreateAlertV1BodySeatFilter>,
pub threshold: f64,
pub uniqueness_key: Option<CreateAlertV1BodyUniquenessKey>,
}Expand description
CreateAlertV1Body
JSON schema
{
"type": "object",
"required": [
"alert_type",
"name",
"threshold"
],
"properties": {
"alert_specifiers": {
"description": "Can be used with only
`low_remaining_contract_credit_and_commit_balance_reached`
notifications. Defines the balances that are considered when evaluating
the alert.",
"type": "array",
"items": {
"type": "object",
"properties": {
"custom_field_filters": {
"description": "A list of custom field filters for
notification types that support advanced filtering",
"type": "array",
"items": {
"type": "object",
"required": [
"entity",
"key"
],
"properties": {
"entity": {
"type": "string",
"enum": [
"Contract",
"Commit",
"ContractCredit",
"ContractCreditOrCommit"
],
"x-mint-enum": {
"ContractCreditOrCommit": [
"ff:alert-specifiers-enabled"
]
}
},
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
},
"exclude": {
"description": "If provided, the specifier will not apply to
balances that matches the inclusion criteria and any of the excluding
values.",
"type": "array",
"items": {
"type": "object",
"properties": {
"custom_field_filters": {
"description": "A list of custom field filters for
notification types that support advanced filtering",
"type": "array",
"items": {
"type": "object",
"required": [
"entity",
"key",
"value"
],
"properties": {
"entity": {
"type": "string",
"enum": [
"Contract",
"Commit",
"ContractCredit",
"ContractCreditOrCommit"
],
"x-mint-enum": {
"ContractCreditOrCommit": [
"ff:alert-specifiers-enabled"
]
}
},
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
}
}
},
"x-mint": {
"groups": [
"ff:alert-specifiers-enabled"
]
},
"x-stainless-skip": true
},
"alert_type": {
"description": "Type of the threshold notification",
"type": "string",
"enum": [
"spend_threshold_reached",
"monthly_invoice_total_spend_threshold_reached",
"usage_threshold_reached",
"low_remaining_days_for_commit_segment_reached",
"low_remaining_commit_balance_reached",
"low_remaining_commit_percentage_reached",
"low_remaining_days_for_contract_credit_segment_reached",
"low_remaining_contract_credit_balance_reached",
"low_remaining_contract_credit_percentage_reached",
"low_remaining_contract_credit_and_commit_balance_reached",
"invoice_total_reached",
"low_remaining_seat_balance_reached"
]
},
"billable_metric_id": {
"description": "For threshold notifications of type
`usage_threshold_reached`, specifies which billable metric to track the
usage for.",
"type": "string",
"format": "uuid"
},
"credit_grant_type_filters": {
"description": "An array of strings, representing a way to filter
the credit grant this threshold notification applies to, by looking at
the credit_grant_type field on the credit grant. This field is only
defined for CreditPercentage and CreditBalance notifications",
"type": "array",
"items": {
"type": "string"
}
},
"credit_type_id": {
"description": "ID of the credit's currency, defaults to USD. If the specific notification type requires a pricing unit/currency, find the ID in the [Metronome app](https://app.metronome.com/offering/pricing-units).",
"type": "string",
"format": "uuid"
},
"custom_field_filters": {
"description": "A list of custom field filters for threshold
notification types that support advanced filtering. Only present for
contract invoices.",
"type": "array",
"items": {
"type": "object",
"required": [
"entity",
"key",
"value"
],
"properties": {
"entity": {
"type": "string",
"enum": [
"Contract",
"Commit",
"ContractCredit",
"ContractCreditOrCommit"
],
"x-mint-enum": {
"ContractCreditOrCommit": [
"ff:alert-specifiers-enabled"
]
}
},
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
},
"customer_id": {
"description": "If provided, will create this threshold
notification for this specific customer. To create a notification for
all customers, do not specify a `customer_id`.",
"type": "string",
"format": "uuid"
},
"evaluate_on_create": {
"description": "If true, the threshold notification will evaluate
immediately on customers that already meet the notification threshold.
If false, it will only evaluate on future customers that trigger the
threshold. Defaults to true.",
"type": "boolean"
},
"group_values": {
"description": "Only present for `spend_threshold_reached`
notifications. Scope notification to a specific group key on individual
line items.",
"type": "array",
"items": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
},
"invoice_types_filter": {
"description": "Only supported for invoice_total_reached threshold
notifications. A list of invoice types to evaluate.",
"type": "array",
"items": {
"examples": [
"SCHEDULED or USAGE"
],
"type": "string"
}
},
"name": {
"description": "Name of the threshold notification",
"type": "string"
},
"seat_filter": {
"description": "Required for `low_remaining_seat_balance_reached` notifications. The alert is scoped to this seat group key-value pair.",
"type": "object",
"required": [
"seat_group_key"
],
"properties": {
"seat_group_key": {
"description": "The seat group key (e.g., \"seat_id\",
\"user_id\")",
"type": "string"
},
"seat_group_value": {
"description": "Optional seat identifier the alert is scoped
to.",
"type": "string"
}
}
},
"threshold": {
"description": "Threshold value of the notification policy.
Depending upon the notification type, this number may represent a
financial amount, the days remaining, or a percentage reached.",
"type": "number"
},
"uniqueness_key": {
"description": "Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.",
"type": "string",
"maxLength": 128,
"minLength": 1
}
}
}Fields§
§alert_specifiers: Vec<CreateAlertV1BodyAlertSpecifiersItem>Can be used with only
low_remaining_contract_credit_and_commit_balance_reached
notifications. Defines the balances that are considered when
evaluating the alert.
alert_type: CreateAlertV1BodyAlertTypeType of the threshold notification
billable_metric_id: Option<Uuid>For threshold notifications of type usage_threshold_reached,
specifies which billable metric to track the usage for.
credit_grant_type_filters: Vec<String>An array of strings, representing a way to filter the credit grant this threshold notification applies to, by looking at the credit_grant_type field on the credit grant. This field is only defined for CreditPercentage and CreditBalance notifications
credit_type_id: Option<Uuid>ID of the credit’s currency, defaults to USD. If the specific notification type requires a pricing unit/currency, find the ID in the Metronome app.
custom_field_filters: Vec<CreateAlertV1BodyCustomFieldFiltersItem>A list of custom field filters for threshold notification types that support advanced filtering. Only present for contract invoices.
customer_id: Option<Uuid>If provided, will create this threshold notification for this
specific customer. To create a notification for all customers, do
not specify a customer_id.
evaluate_on_create: Option<bool>If true, the threshold notification will evaluate immediately on customers that already meet the notification threshold. If false, it will only evaluate on future customers that trigger the threshold. Defaults to true.
group_values: Vec<CreateAlertV1BodyGroupValuesItem>Only present for spend_threshold_reached notifications. Scope
notification to a specific group key on individual line items.
invoice_types_filter: Vec<String>Only supported for invoice_total_reached threshold notifications. A list of invoice types to evaluate.
name: StringName of the threshold notification
seat_filter: Option<CreateAlertV1BodySeatFilter>§threshold: f64Threshold value of the notification policy. Depending upon the notification type, this number may represent a financial amount, the days remaining, or a percentage reached.
uniqueness_key: Option<CreateAlertV1BodyUniquenessKey>Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.
Trait Implementations§
Source§impl Clone for CreateAlertV1Body
impl Clone for CreateAlertV1Body
Source§fn clone(&self) -> CreateAlertV1Body
fn clone(&self) -> CreateAlertV1Body
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more