Skip to content

Commit e8cb956

Browse files
feat(api): manual updates (#572)
1 parent a81a464 commit e8cb956

File tree

8 files changed

+64
-45
lines changed

8 files changed

+64
-45
lines changed

api.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ from orb.types import (
1919
ReplaceSubscriptionPriceParams,
2020
TrialDiscount,
2121
UpdatePriceRequestParams,
22+
UsageDiscount,
2223
)
2324
```
2425

src/orb/types/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .shared import (
1111
Discount as Discount,
1212
TrialDiscount as TrialDiscount,
13+
UsageDiscount as UsageDiscount,
1314
AmountDiscount as AmountDiscount,
1415
PaginationMetadata as PaginationMetadata,
1516
PercentageDiscount as PercentageDiscount,

src/orb/types/shared/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from .discount import Discount as Discount
44
from .trial_discount import TrialDiscount as TrialDiscount
5+
from .usage_discount import UsageDiscount as UsageDiscount
56
from .amount_discount import AmountDiscount as AmountDiscount
67
from .pagination_metadata import PaginationMetadata as PaginationMetadata
78
from .percentage_discount import PercentageDiscount as PercentageDiscount

src/orb/types/shared/discount.py

+4-23
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,15 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

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
55

66
from ..._utils import PropertyInfo
7-
from ..._models import BaseModel
87
from .trial_discount import TrialDiscount
8+
from .usage_discount import UsageDiscount
99
from .amount_discount import AmountDiscount
1010
from .percentage_discount import PercentageDiscount
1111

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"]
3213

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

src/orb/types/shared_params/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from .discount import Discount as Discount
44
from .trial_discount import TrialDiscount as TrialDiscount
5+
from .usage_discount import UsageDiscount as UsageDiscount
56
from .amount_discount import AmountDiscount as AmountDiscount
67
from .percentage_discount import PercentageDiscount as PercentageDiscount
78
from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate

src/orb/types/shared_params/discount.py

+4-22
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,14 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Union, Optional
6-
from typing_extensions import Literal, Required, TypeAlias, TypedDict
5+
from typing import Union
6+
from typing_extensions import TypeAlias
77

88
from .trial_discount import TrialDiscount
9+
from .usage_discount import UsageDiscount
910
from .amount_discount import AmountDiscount
1011
from .percentage_discount import PercentageDiscount
1112

12-
__all__ = ["Discount", "UsageDiscount"]
13-
14-
15-
class UsageDiscount(TypedDict, total=False):
16-
applies_to_price_ids: Required[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: Required[Literal["usage"]]
23-
24-
usage_discount: Required[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]
31-
13+
__all__ = ["Discount"]
3214

3315
Discount: TypeAlias = Union[PercentageDiscount, TrialDiscount, UsageDiscount, AmountDiscount]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import List, Optional
6+
from typing_extensions import Literal, Required, TypedDict
7+
8+
__all__ = ["UsageDiscount"]
9+
10+
11+
class UsageDiscount(TypedDict, total=False):
12+
applies_to_price_ids: Required[List[str]]
13+
"""List of price_ids that this discount applies to.
14+
15+
For plan/plan phase discounts, this can be a subset of prices.
16+
"""
17+
18+
discount_type: Required[Literal["usage"]]
19+
20+
usage_discount: Required[float]
21+
"""Only available if discount_type is `usage`.
22+
23+
Number of usage units that this discount is for
24+
"""
25+
26+
reason: Optional[str]

0 commit comments

Comments
 (0)