| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# File generated from our OpenAPI spec |
| 3 |
from stripe._request_options import RequestOptions |
| 4 |
from typing import List |
| 5 |
from typing_extensions import Literal, NotRequired, TypedDict |
| 6 |
|
| 7 |
|
| 8 |
class AlertCreateParams(RequestOptions): |
| 9 |
alert_type: Literal["usage_threshold"] |
| 10 |
""" |
| 11 |
The type of alert to create. |
| 12 |
""" |
| 13 |
expand: NotRequired[List[str]] |
| 14 |
""" |
| 15 |
Specifies which fields in the response should be expanded. |
| 16 |
""" |
| 17 |
title: str |
| 18 |
""" |
| 19 |
The title of the alert. |
| 20 |
""" |
| 21 |
usage_threshold: NotRequired["AlertCreateParamsUsageThreshold"] |
| 22 |
""" |
| 23 |
The configuration of the usage threshold. |
| 24 |
""" |
| 25 |
|
| 26 |
|
| 27 |
class AlertCreateParamsUsageThreshold(TypedDict): |
| 28 |
filters: NotRequired[List["AlertCreateParamsUsageThresholdFilter"]] |
| 29 |
""" |
| 30 |
The filters allows limiting the scope of this usage alert. You can only specify up to one filter at this time. |
| 31 |
""" |
| 32 |
gte: int |
| 33 |
""" |
| 34 |
Defines the threshold value that triggers the alert. |
| 35 |
""" |
| 36 |
meter: str |
| 37 |
""" |
| 38 |
The [Billing Meter](https://docs.stripe.com/api/billing/meter) ID whose usage is monitored. |
| 39 |
""" |
| 40 |
recurrence: Literal["one_time"] |
| 41 |
""" |
| 42 |
Defines how the alert will behave. |
| 43 |
""" |
| 44 |
|
| 45 |
|
| 46 |
class AlertCreateParamsUsageThresholdFilter(TypedDict): |
| 47 |
customer: NotRequired[str] |
| 48 |
""" |
| 49 |
Limit the scope to this usage alert only to this customer. |
| 50 |
""" |
| 51 |
type: Literal["customer"] |
| 52 |
""" |
| 53 |
What type of filter is being applied to this usage alert. |
| 54 |
""" |