Skip to content

Commit beaede2

Browse files
fix(api): add shared model BillingCycleRelativeDate (#237)
1 parent b8f625d commit beaede2

7 files changed

+31
-12
lines changed

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Shared Types
22

33
```python
4-
from orb.types import Discount, PaginationMetadata
4+
from orb.types import BillingCycleRelativeDate, Discount, PaginationMetadata
55
```
66

77
# TopLevel

src/orb/types/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
from .plan import Plan as Plan
77
from .price import Price as Price
88
from .coupon import Coupon as Coupon
9-
from .shared import Discount as Discount, PaginationMetadata as PaginationMetadata
9+
from .shared import (
10+
Discount as Discount,
11+
PaginationMetadata as PaginationMetadata,
12+
BillingCycleRelativeDate as BillingCycleRelativeDate,
13+
)
1014
from .invoice import Invoice as Invoice
1115
from .customer import Customer as Customer
1216
from .credit_note import CreditNote as CreditNote

src/orb/types/shared/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
from .discount import Discount as Discount
44
from .pagination_metadata import PaginationMetadata as PaginationMetadata
5+
from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing_extensions import Literal
4+
5+
__all__ = ["BillingCycleRelativeDate"]
6+
7+
BillingCycleRelativeDate = Literal["start_of_term", "end_of_term"]
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal
6+
7+
__all__ = ["BillingCycleRelativeDate"]
8+
9+
BillingCycleRelativeDate = Literal["start_of_term", "end_of_term"]

src/orb/types/subscription_price_intervals_params.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from datetime import datetime
77
from typing_extensions import Literal, Required, Annotated, TypedDict
88

9+
from .shared import BillingCycleRelativeDate
910
from .._utils import PropertyInfo
1011

1112
__all__ = [
@@ -941,7 +942,7 @@ class AddPriceNewFloatingUnitWithPercentPrice(TypedDict, total=False):
941942

942943
class Add(TypedDict, total=False):
943944
start_date: Required[
944-
Annotated[Union[Union[str, datetime], Literal["start_of_term", "end_of_term"]], PropertyInfo(format="iso8601")]
945+
Annotated[Union[Union[str, datetime], BillingCycleRelativeDate], PropertyInfo(format="iso8601")]
945946
]
946947
"""The start date of the price interval.
947948
@@ -951,9 +952,7 @@ class Add(TypedDict, total=False):
951952
discounts: Optional[Iterable[AddDiscount]]
952953
"""A list of discounts to initialize on the price interval."""
953954

954-
end_date: Annotated[
955-
Union[Union[str, datetime], Literal["start_of_term", "end_of_term"], None], PropertyInfo(format="iso8601")
956-
]
955+
end_date: Annotated[Union[Union[str, datetime], BillingCycleRelativeDate, None], PropertyInfo(format="iso8601")]
957956
"""The end date of the price interval.
958957
959958
This is the date that the price will stop billing on the subscription.
@@ -1003,9 +1002,7 @@ class Edit(TypedDict, total=False):
10031002
overlapping price intervals must have the same billing cycle day.
10041003
"""
10051004

1006-
end_date: Annotated[
1007-
Union[Union[str, datetime], Literal["start_of_term", "end_of_term"], None], PropertyInfo(format="iso8601")
1008-
]
1005+
end_date: Annotated[Union[Union[str, datetime], BillingCycleRelativeDate, None], PropertyInfo(format="iso8601")]
10091006
"""The updated end date of this price interval.
10101007
10111008
If not specified, the start date will not be updated.
@@ -1018,9 +1015,7 @@ class Edit(TypedDict, total=False):
10181015
on the price interval.
10191016
"""
10201017

1021-
start_date: Annotated[
1022-
Union[Union[str, datetime], Literal["start_of_term", "end_of_term"]], PropertyInfo(format="iso8601")
1023-
]
1018+
start_date: Annotated[Union[Union[str, datetime], BillingCycleRelativeDate], PropertyInfo(format="iso8601")]
10241019
"""The updated start date of this price interval.
10251020
10261021
If not specified, the start date will not be updated.

0 commit comments

Comments
 (0)