Skip to main content

CreateAlertV1Body

Struct CreateAlertV1Body 

Source
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: CreateAlertV1BodyAlertType

Type 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: String

Name of the threshold notification

§seat_filter: Option<CreateAlertV1BodySeatFilter>§threshold: f64

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.

§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

Source§

fn clone(&self) -> CreateAlertV1Body

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CreateAlertV1Body

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CreateAlertV1Body

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CreateAlertV1Body

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more