Skip to content

Commit fd2bf64

Browse files
feat(api): manual updates (#575)
1 parent 0664bcc commit fd2bf64

24 files changed

+10983
-11658
lines changed

api.md

-10
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,13 @@
22

33
```python
44
from orb.types import (
5-
AddCreditLedgerEntryRequest,
6-
AddCreditTopUpRequest,
7-
AddSubscriptionAdjustmentParams,
8-
AddSubscriptionPriceParams,
95
AmountDiscount,
106
BillingCycleRelativeDate,
11-
CreateCustomerAlertRequest,
127
Discount,
138
InvoiceLevelDiscount,
149
PaginationMetadata,
1510
PercentageDiscount,
16-
RemoveSubscriptionAdjustmentParams,
17-
RemoveSubscriptionPriceParams,
18-
ReplaceSubscriptionAdjustmentParams,
19-
ReplaceSubscriptionPriceParams,
2011
TrialDiscount,
21-
UpdatePriceRequestParams,
2212
UsageDiscount,
2313
)
2414
```

src/orb/resources/subscriptions.py

+32-30
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,8 @@
4444
from ..types.subscription_fetch_schedule_response import SubscriptionFetchScheduleResponse
4545
from ..types.subscription_price_intervals_response import SubscriptionPriceIntervalsResponse
4646
from ..types.subscription_schedule_plan_change_response import SubscriptionSchedulePlanChangeResponse
47-
from ..types.shared_params.add_subscription_price_params import AddSubscriptionPriceParams
4847
from ..types.subscription_unschedule_cancellation_response import SubscriptionUnscheduleCancellationResponse
49-
from ..types.shared_params.remove_subscription_price_params import RemoveSubscriptionPriceParams
50-
from ..types.shared_params.replace_subscription_price_params import ReplaceSubscriptionPriceParams
5148
from ..types.subscription_update_fixed_fee_quantity_response import SubscriptionUpdateFixedFeeQuantityResponse
52-
from ..types.shared_params.add_subscription_adjustment_params import AddSubscriptionAdjustmentParams
53-
from ..types.shared_params.remove_subscription_adjustment_params import RemoveSubscriptionAdjustmentParams
54-
from ..types.shared_params.replace_subscription_adjustment_params import ReplaceSubscriptionAdjustmentParams
5549
from ..types.subscription_unschedule_pending_plan_changes_response import (
5650
SubscriptionUnschedulePendingPlanChangesResponse,
5751
)
@@ -85,8 +79,8 @@ def with_streaming_response(self) -> SubscriptionsWithStreamingResponse:
8579
def create(
8680
self,
8781
*,
88-
add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
89-
add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
82+
add_adjustments: Optional[Iterable[subscription_create_params.AddAdjustment]] | NotGiven = NOT_GIVEN,
83+
add_prices: Optional[Iterable[subscription_create_params.AddPrice]] | NotGiven = NOT_GIVEN,
9084
align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN,
9185
auto_collection: Optional[bool] | NotGiven = NOT_GIVEN,
9286
aws_region: Optional[str] | NotGiven = NOT_GIVEN,
@@ -110,10 +104,10 @@ def create(
110104
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
111105
plan_version_number: Optional[int] | NotGiven = NOT_GIVEN,
112106
price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
113-
remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
114-
remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
115-
replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
116-
replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
107+
remove_adjustments: Optional[Iterable[subscription_create_params.RemoveAdjustment]] | NotGiven = NOT_GIVEN,
108+
remove_prices: Optional[Iterable[subscription_create_params.RemovePrice]] | NotGiven = NOT_GIVEN,
109+
replace_adjustments: Optional[Iterable[subscription_create_params.ReplaceAdjustment]] | NotGiven = NOT_GIVEN,
110+
replace_prices: Optional[Iterable[subscription_create_params.ReplacePrice]] | NotGiven = NOT_GIVEN,
117111
start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
118112
trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN,
119113
usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
@@ -1365,8 +1359,9 @@ def schedule_plan_change(
13651359
subscription_id: str,
13661360
*,
13671361
change_option: Literal["requested_date", "end_of_subscription_term", "immediate"],
1368-
add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
1369-
add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
1362+
add_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.AddAdjustment]]
1363+
| NotGiven = NOT_GIVEN,
1364+
add_prices: Optional[Iterable[subscription_schedule_plan_change_params.AddPrice]] | NotGiven = NOT_GIVEN,
13701365
align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN,
13711366
auto_collection: Optional[bool] | NotGiven = NOT_GIVEN,
13721367
billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]]
@@ -1388,10 +1383,13 @@ def schedule_plan_change(
13881383
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
13891384
plan_version_number: Optional[int] | NotGiven = NOT_GIVEN,
13901385
price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
1391-
remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
1392-
remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
1393-
replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
1394-
replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
1386+
remove_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.RemoveAdjustment]]
1387+
| NotGiven = NOT_GIVEN,
1388+
remove_prices: Optional[Iterable[subscription_schedule_plan_change_params.RemovePrice]] | NotGiven = NOT_GIVEN,
1389+
replace_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.ReplaceAdjustment]]
1390+
| NotGiven = NOT_GIVEN,
1391+
replace_prices: Optional[Iterable[subscription_schedule_plan_change_params.ReplacePrice]]
1392+
| NotGiven = NOT_GIVEN,
13951393
trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN,
13961394
usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
13971395
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -2095,8 +2093,8 @@ def with_streaming_response(self) -> AsyncSubscriptionsWithStreamingResponse:
20952093
async def create(
20962094
self,
20972095
*,
2098-
add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
2099-
add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
2096+
add_adjustments: Optional[Iterable[subscription_create_params.AddAdjustment]] | NotGiven = NOT_GIVEN,
2097+
add_prices: Optional[Iterable[subscription_create_params.AddPrice]] | NotGiven = NOT_GIVEN,
21002098
align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN,
21012099
auto_collection: Optional[bool] | NotGiven = NOT_GIVEN,
21022100
aws_region: Optional[str] | NotGiven = NOT_GIVEN,
@@ -2120,10 +2118,10 @@ async def create(
21202118
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
21212119
plan_version_number: Optional[int] | NotGiven = NOT_GIVEN,
21222120
price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
2123-
remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
2124-
remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
2125-
replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
2126-
replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
2121+
remove_adjustments: Optional[Iterable[subscription_create_params.RemoveAdjustment]] | NotGiven = NOT_GIVEN,
2122+
remove_prices: Optional[Iterable[subscription_create_params.RemovePrice]] | NotGiven = NOT_GIVEN,
2123+
replace_adjustments: Optional[Iterable[subscription_create_params.ReplaceAdjustment]] | NotGiven = NOT_GIVEN,
2124+
replace_prices: Optional[Iterable[subscription_create_params.ReplacePrice]] | NotGiven = NOT_GIVEN,
21272125
start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
21282126
trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN,
21292127
usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
@@ -3375,8 +3373,9 @@ async def schedule_plan_change(
33753373
subscription_id: str,
33763374
*,
33773375
change_option: Literal["requested_date", "end_of_subscription_term", "immediate"],
3378-
add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
3379-
add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
3376+
add_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.AddAdjustment]]
3377+
| NotGiven = NOT_GIVEN,
3378+
add_prices: Optional[Iterable[subscription_schedule_plan_change_params.AddPrice]] | NotGiven = NOT_GIVEN,
33803379
align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN,
33813380
auto_collection: Optional[bool] | NotGiven = NOT_GIVEN,
33823381
billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]]
@@ -3398,10 +3397,13 @@ async def schedule_plan_change(
33983397
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
33993398
plan_version_number: Optional[int] | NotGiven = NOT_GIVEN,
34003399
price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
3401-
remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
3402-
remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
3403-
replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN,
3404-
replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN,
3400+
remove_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.RemoveAdjustment]]
3401+
| NotGiven = NOT_GIVEN,
3402+
remove_prices: Optional[Iterable[subscription_schedule_plan_change_params.RemovePrice]] | NotGiven = NOT_GIVEN,
3403+
replace_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.ReplaceAdjustment]]
3404+
| NotGiven = NOT_GIVEN,
3405+
replace_prices: Optional[Iterable[subscription_schedule_plan_change_params.ReplacePrice]]
3406+
| NotGiven = NOT_GIVEN,
34053407
trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN,
34063408
usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
34073409
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.

src/orb/types/__init__.py

-10
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,7 @@
1515
PaginationMetadata as PaginationMetadata,
1616
PercentageDiscount as PercentageDiscount,
1717
InvoiceLevelDiscount as InvoiceLevelDiscount,
18-
AddCreditTopUpRequest as AddCreditTopUpRequest,
1918
BillingCycleRelativeDate as BillingCycleRelativeDate,
20-
UpdatePriceRequestParams as UpdatePriceRequestParams,
21-
AddSubscriptionPriceParams as AddSubscriptionPriceParams,
22-
CreateCustomerAlertRequest as CreateCustomerAlertRequest,
23-
AddCreditLedgerEntryRequest as AddCreditLedgerEntryRequest,
24-
RemoveSubscriptionPriceParams as RemoveSubscriptionPriceParams,
25-
ReplaceSubscriptionPriceParams as ReplaceSubscriptionPriceParams,
26-
AddSubscriptionAdjustmentParams as AddSubscriptionAdjustmentParams,
27-
RemoveSubscriptionAdjustmentParams as RemoveSubscriptionAdjustmentParams,
28-
ReplaceSubscriptionAdjustmentParams as ReplaceSubscriptionAdjustmentParams,
2919
)
3020
from .invoice import Invoice as Invoice
3121
from .customer import Customer as Customer

src/orb/types/shared/__init__.py

-14
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,4 @@
77
from .pagination_metadata import PaginationMetadata as PaginationMetadata
88
from .percentage_discount import PercentageDiscount as PercentageDiscount
99
from .invoice_level_discount import InvoiceLevelDiscount as InvoiceLevelDiscount
10-
from .add_credit_top_up_request import AddCreditTopUpRequest as AddCreditTopUpRequest
1110
from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate
12-
from .update_price_request_params import UpdatePriceRequestParams as UpdatePriceRequestParams
13-
from .add_subscription_price_params import AddSubscriptionPriceParams as AddSubscriptionPriceParams
14-
from .create_customer_alert_request import CreateCustomerAlertRequest as CreateCustomerAlertRequest
15-
from .add_credit_ledger_entry_request import AddCreditLedgerEntryRequest as AddCreditLedgerEntryRequest
16-
from .remove_subscription_price_params import RemoveSubscriptionPriceParams as RemoveSubscriptionPriceParams
17-
from .replace_subscription_price_params import ReplaceSubscriptionPriceParams as ReplaceSubscriptionPriceParams
18-
from .add_subscription_adjustment_params import AddSubscriptionAdjustmentParams as AddSubscriptionAdjustmentParams
19-
from .remove_subscription_adjustment_params import (
20-
RemoveSubscriptionAdjustmentParams as RemoveSubscriptionAdjustmentParams,
21-
)
22-
from .replace_subscription_adjustment_params import (
23-
ReplaceSubscriptionAdjustmentParams as ReplaceSubscriptionAdjustmentParams,
24-
)

0 commit comments

Comments
 (0)