|
1 | 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
2 | 2 |
|
3 | | -from typing import List, Union, Optional |
4 | | -from typing_extensions import Literal, Annotated, TypeAlias |
| 3 | +from typing import Union |
| 4 | +from typing_extensions import Annotated, TypeAlias |
5 | 5 |
|
6 | 6 | from ..._utils import PropertyInfo |
7 | | -from ..._models import BaseModel |
8 | 7 | from .trial_discount import TrialDiscount |
| 8 | +from .usage_discount import UsageDiscount |
9 | 9 | from .amount_discount import AmountDiscount |
10 | 10 | from .percentage_discount import PercentageDiscount |
11 | 11 |
|
12 | | -__all__ = ["Discount", "UsageDiscount"] |
13 | | - |
14 | | - |
15 | | -class UsageDiscount(BaseModel): |
16 | | - applies_to_price_ids: List[str] |
17 | | - """List of price_ids that this discount applies to. |
18 | | -
|
19 | | - For plan/plan phase discounts, this can be a subset of prices. |
20 | | - """ |
21 | | - |
22 | | - discount_type: Literal["usage"] |
23 | | - |
24 | | - usage_discount: float |
25 | | - """Only available if discount_type is `usage`. |
26 | | -
|
27 | | - Number of usage units that this discount is for |
28 | | - """ |
29 | | - |
30 | | - reason: Optional[str] = None |
31 | | - |
| 12 | +__all__ = ["Discount"] |
32 | 13 |
|
33 | 14 | Discount: TypeAlias = Annotated[ |
34 | 15 | Union[PercentageDiscount, TrialDiscount, UsageDiscount, AmountDiscount], PropertyInfo(discriminator="discount_type") |
|
0 commit comments