Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.3.0"
".": "3.4.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 103
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-25409f3b13e6d1d003e351fc18d248ecf3c5821cfde5f409a1d356e4fc917d8c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4dede72b827939939b5386cda07c3bc1fa2eea79901819792c1820e8531718d6.yml
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 3.4.0 (2025-02-14)

Full Changelog: [v3.3.0...v3.4.0](https://github.com/orbcorp/orb-python/compare/v3.3.0...v3.4.0)

### Features

* **api:** api update ([#535](https://github.com/orbcorp/orb-python/issues/535)) ([546bfa0](https://github.com/orbcorp/orb-python/commit/546bfa0021c27e59e6be15a5a011796c740abf3e))

## 3.3.0 (2025-02-13)

Full Changelog: [v3.2.0...v3.3.0](https://github.com/orbcorp/orb-python/compare/v3.2.0...v3.3.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "orb-billing"
version = "3.3.0"
version = "3.4.0"
description = "The official Python library for the orb API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/orb/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "orb"
__version__ = "3.3.0" # x-release-please-version
__version__ = "3.4.0" # x-release-please-version
58 changes: 56 additions & 2 deletions src/orb/resources/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ def cancel(
subscription_id: str,
*,
cancel_option: Literal["end_of_subscription_term", "immediate", "requested_date"],
allow_invoice_credit_or_void: Optional[bool] | NotGiven = NOT_GIVEN,
cancellation_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -727,6 +728,10 @@ def cancel(
Args:
cancel_option: Determines the timing of subscription cancellation

allow_invoice_credit_or_void: If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.

cancellation_date: The date that the cancellation should take effect. This parameter can only be
passed if the `cancel_option` is `requested_date`.

Expand All @@ -747,6 +752,7 @@ def cancel(
body=maybe_transform(
{
"cancel_option": cancel_option,
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
"cancellation_date": cancellation_date,
},
subscription_cancel_params.SubscriptionCancelParams,
Expand Down Expand Up @@ -1207,6 +1213,7 @@ def price_intervals(
*,
add: Iterable[subscription_price_intervals_params.Add] | NotGiven = NOT_GIVEN,
add_adjustments: Iterable[subscription_price_intervals_params.AddAdjustment] | NotGiven = NOT_GIVEN,
allow_invoice_credit_or_void: Optional[bool] | NotGiven = NOT_GIVEN,
edit: Iterable[subscription_price_intervals_params.Edit] | NotGiven = NOT_GIVEN,
edit_adjustments: Iterable[subscription_price_intervals_params.EditAdjustment] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -1296,6 +1303,10 @@ def price_intervals(

add_adjustments: A list of adjustments to add to the subscription.

allow_invoice_credit_or_void: If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.

edit: A list of price intervals to edit on the subscription.

edit_adjustments: A list of adjustments to edit on the subscription.
Expand All @@ -1318,6 +1329,7 @@ def price_intervals(
{
"add": add,
"add_adjustments": add_adjustments,
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
"edit": edit,
"edit_adjustments": edit_adjustments,
},
Expand Down Expand Up @@ -1693,6 +1705,7 @@ def trigger_phase(
self,
subscription_id: str,
*,
allow_invoice_credit_or_void: Optional[bool] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -1707,6 +1720,10 @@ def trigger_phase(
specified).

Args:
allow_invoice_credit_or_void: If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.

effective_date: The date on which the phase change should take effect. If not provided, defaults
to today in the customer's timezone.

Expand All @@ -1725,7 +1742,11 @@ def trigger_phase(
return self._post(
f"/subscriptions/{subscription_id}/trigger_phase",
body=maybe_transform(
{"effective_date": effective_date}, subscription_trigger_phase_params.SubscriptionTriggerPhaseParams
{
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
"effective_date": effective_date,
},
subscription_trigger_phase_params.SubscriptionTriggerPhaseParams,
),
options=make_request_options(
extra_headers=extra_headers,
Expand Down Expand Up @@ -1880,6 +1901,7 @@ def update_fixed_fee_quantity(
*,
price_id: str,
quantity: float,
allow_invoice_credit_or_void: Optional[bool] | NotGiven = NOT_GIVEN,
change_option: Literal["immediate", "upcoming_invoice", "effective_date"] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -1909,6 +1931,10 @@ def update_fixed_fee_quantity(
Args:
price_id: Price for which the quantity should be updated. Must be a fixed fee.

allow_invoice_credit_or_void: If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.

change_option: Determines when the change takes effect. Note that if `effective_date` is
specified, this defaults to `effective_date`. Otherwise, this defaults to
`immediate` unless it's explicitly set to `upcoming_invoice.
Expand All @@ -1935,6 +1961,7 @@ def update_fixed_fee_quantity(
{
"price_id": price_id,
"quantity": quantity,
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
"change_option": change_option,
"effective_date": effective_date,
},
Expand Down Expand Up @@ -2619,6 +2646,7 @@ async def cancel(
subscription_id: str,
*,
cancel_option: Literal["end_of_subscription_term", "immediate", "requested_date"],
allow_invoice_credit_or_void: Optional[bool] | NotGiven = NOT_GIVEN,
cancellation_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -2695,6 +2723,10 @@ async def cancel(
Args:
cancel_option: Determines the timing of subscription cancellation

allow_invoice_credit_or_void: If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.

cancellation_date: The date that the cancellation should take effect. This parameter can only be
passed if the `cancel_option` is `requested_date`.

Expand All @@ -2715,6 +2747,7 @@ async def cancel(
body=await async_maybe_transform(
{
"cancel_option": cancel_option,
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
"cancellation_date": cancellation_date,
},
subscription_cancel_params.SubscriptionCancelParams,
Expand Down Expand Up @@ -3175,6 +3208,7 @@ async def price_intervals(
*,
add: Iterable[subscription_price_intervals_params.Add] | NotGiven = NOT_GIVEN,
add_adjustments: Iterable[subscription_price_intervals_params.AddAdjustment] | NotGiven = NOT_GIVEN,
allow_invoice_credit_or_void: Optional[bool] | NotGiven = NOT_GIVEN,
edit: Iterable[subscription_price_intervals_params.Edit] | NotGiven = NOT_GIVEN,
edit_adjustments: Iterable[subscription_price_intervals_params.EditAdjustment] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -3264,6 +3298,10 @@ async def price_intervals(

add_adjustments: A list of adjustments to add to the subscription.

allow_invoice_credit_or_void: If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.

edit: A list of price intervals to edit on the subscription.

edit_adjustments: A list of adjustments to edit on the subscription.
Expand All @@ -3286,6 +3324,7 @@ async def price_intervals(
{
"add": add,
"add_adjustments": add_adjustments,
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
"edit": edit,
"edit_adjustments": edit_adjustments,
},
Expand Down Expand Up @@ -3661,6 +3700,7 @@ async def trigger_phase(
self,
subscription_id: str,
*,
allow_invoice_credit_or_void: Optional[bool] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -3675,6 +3715,10 @@ async def trigger_phase(
specified).

Args:
allow_invoice_credit_or_void: If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.

effective_date: The date on which the phase change should take effect. If not provided, defaults
to today in the customer's timezone.

Expand All @@ -3693,7 +3737,11 @@ async def trigger_phase(
return await self._post(
f"/subscriptions/{subscription_id}/trigger_phase",
body=await async_maybe_transform(
{"effective_date": effective_date}, subscription_trigger_phase_params.SubscriptionTriggerPhaseParams
{
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
"effective_date": effective_date,
},
subscription_trigger_phase_params.SubscriptionTriggerPhaseParams,
),
options=make_request_options(
extra_headers=extra_headers,
Expand Down Expand Up @@ -3848,6 +3896,7 @@ async def update_fixed_fee_quantity(
*,
price_id: str,
quantity: float,
allow_invoice_credit_or_void: Optional[bool] | NotGiven = NOT_GIVEN,
change_option: Literal["immediate", "upcoming_invoice", "effective_date"] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -3877,6 +3926,10 @@ async def update_fixed_fee_quantity(
Args:
price_id: Price for which the quantity should be updated. Must be a fixed fee.

allow_invoice_credit_or_void: If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.

change_option: Determines when the change takes effect. Note that if `effective_date` is
specified, this defaults to `effective_date`. Otherwise, this defaults to
`immediate` unless it's explicitly set to `upcoming_invoice.
Expand All @@ -3903,6 +3956,7 @@ async def update_fixed_fee_quantity(
{
"price_id": price_id,
"quantity": quantity,
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
"change_option": change_option,
"effective_date": effective_date,
},
Expand Down
9 changes: 8 additions & 1 deletion src/orb/types/subscription_cancel_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Union
from typing import Union, Optional
from datetime import datetime
from typing_extensions import Literal, Required, Annotated, TypedDict

Expand All @@ -15,6 +15,13 @@ class SubscriptionCancelParams(TypedDict, total=False):
cancel_option: Required[Literal["end_of_subscription_term", "immediate", "requested_date"]]
"""Determines the timing of subscription cancellation"""

allow_invoice_credit_or_void: Optional[bool]
"""
If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.
"""

cancellation_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""The date that the cancellation should take effect.

Expand Down
7 changes: 7 additions & 0 deletions src/orb/types/subscription_price_intervals_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ class SubscriptionPriceIntervalsParams(TypedDict, total=False):
add_adjustments: Iterable[AddAdjustment]
"""A list of adjustments to add to the subscription."""

allow_invoice_credit_or_void: Optional[bool]
"""
If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.
"""

edit: Iterable[Edit]
"""A list of price intervals to edit on the subscription."""

Expand Down
9 changes: 8 additions & 1 deletion src/orb/types/subscription_trigger_phase_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Union
from typing import Union, Optional
from datetime import date
from typing_extensions import Annotated, TypedDict

Expand All @@ -12,6 +12,13 @@


class SubscriptionTriggerPhaseParams(TypedDict, total=False):
allow_invoice_credit_or_void: Optional[bool]
"""
If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.
"""

effective_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")]
"""The date on which the phase change should take effect.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Union
from typing import Union, Optional
from datetime import date
from typing_extensions import Literal, Required, Annotated, TypedDict

Expand All @@ -17,6 +17,13 @@ class SubscriptionUpdateFixedFeeQuantityParams(TypedDict, total=False):

quantity: Required[float]

allow_invoice_credit_or_void: Optional[bool]
"""
If false, this request will fail if it would void an issued invoice or create a
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.
"""

change_option: Literal["immediate", "upcoming_invoice", "effective_date"]
"""Determines when the change takes effect.

Expand Down
Loading