Skip to content

Commit 366b8ed

Browse files
feat(api): api update
1 parent f48a998 commit 366b8ed

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-42aa43f3893eef31a351e066bf0cf8c56da8c857ccbb45eb7dd58739ad43bd86.yml
3-
openapi_spec_hash: e6b8c1e707036539d88a7b79af864a49
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c075f748a7de8ecdccf11a8f2374682b0efd84f1318147274a838bf2fdd73b58.yml
3+
openapi_spec_hash: ae918b8f348f1b7d3252a59dac36c453
44
config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2

src/orb/resources/subscription_changes.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def apply(
8989
subscription_change_id: str,
9090
*,
9191
description: Optional[str] | Omit = omit,
92+
mark_as_paid: Optional[bool] | Omit = omit,
9293
previously_collected_amount: Optional[str] | Omit = omit,
9394
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9495
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -107,7 +108,11 @@ def apply(
107108
Args:
108109
description: Description to apply to the balance transaction representing this credit.
109110
110-
previously_collected_amount: Amount already collected to apply to the customer's balance.
111+
mark_as_paid: Mark all pending invoices that are payable as paid. If amount is also provided,
112+
mark as paid and credit the difference to the customer's balance.
113+
114+
previously_collected_amount: Amount already collected to apply to the customer's balance. If mark_as_paid is
115+
also provided, credit the difference to the customer's balance.
111116
112117
extra_headers: Send extra headers
113118
@@ -128,6 +133,7 @@ def apply(
128133
body=maybe_transform(
129134
{
130135
"description": description,
136+
"mark_as_paid": mark_as_paid,
131137
"previously_collected_amount": previously_collected_amount,
132138
},
133139
subscription_change_apply_params.SubscriptionChangeApplyParams,
@@ -256,6 +262,7 @@ async def apply(
256262
subscription_change_id: str,
257263
*,
258264
description: Optional[str] | Omit = omit,
265+
mark_as_paid: Optional[bool] | Omit = omit,
259266
previously_collected_amount: Optional[str] | Omit = omit,
260267
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
261268
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -274,7 +281,11 @@ async def apply(
274281
Args:
275282
description: Description to apply to the balance transaction representing this credit.
276283
277-
previously_collected_amount: Amount already collected to apply to the customer's balance.
284+
mark_as_paid: Mark all pending invoices that are payable as paid. If amount is also provided,
285+
mark as paid and credit the difference to the customer's balance.
286+
287+
previously_collected_amount: Amount already collected to apply to the customer's balance. If mark_as_paid is
288+
also provided, credit the difference to the customer's balance.
278289
279290
extra_headers: Send extra headers
280291
@@ -295,6 +306,7 @@ async def apply(
295306
body=await async_maybe_transform(
296307
{
297308
"description": description,
309+
"mark_as_paid": mark_as_paid,
298310
"previously_collected_amount": previously_collected_amount,
299311
},
300312
subscription_change_apply_params.SubscriptionChangeApplyParams,

src/orb/types/subscription_change_apply_params.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,16 @@ class SubscriptionChangeApplyParams(TypedDict, total=False):
1212
description: Optional[str]
1313
"""Description to apply to the balance transaction representing this credit."""
1414

15+
mark_as_paid: Optional[bool]
16+
"""Mark all pending invoices that are payable as paid.
17+
18+
If amount is also provided, mark as paid and credit the difference to the
19+
customer's balance.
20+
"""
21+
1522
previously_collected_amount: Optional[str]
16-
"""Amount already collected to apply to the customer's balance."""
23+
"""Amount already collected to apply to the customer's balance.
24+
25+
If mark_as_paid is also provided, credit the difference to the customer's
26+
balance.
27+
"""

tests/api_resources/test_subscription_changes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def test_method_apply_with_all_params(self, client: Orb) -> None:
7373
subscription_change = client.subscription_changes.apply(
7474
subscription_change_id="subscription_change_id",
7575
description="description",
76+
mark_as_paid=True,
7677
previously_collected_amount="previously_collected_amount",
7778
)
7879
assert_matches_type(SubscriptionChangeApplyResponse, subscription_change, path=["response"])
@@ -208,6 +209,7 @@ async def test_method_apply_with_all_params(self, async_client: AsyncOrb) -> Non
208209
subscription_change = await async_client.subscription_changes.apply(
209210
subscription_change_id="subscription_change_id",
210211
description="description",
212+
mark_as_paid=True,
211213
previously_collected_amount="previously_collected_amount",
212214
)
213215
assert_matches_type(SubscriptionChangeApplyResponse, subscription_change, path=["response"])

0 commit comments

Comments
 (0)