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.8.0"
".": "3.9.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-7b65f996788617c2d2f2e8e941d366edd1a2844f15eefec555e220b03bbc6d4c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d4f03b16daf0bae33be634c959dafb0e21b0bcb156beb162f8235394dca88e7c.yml
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 3.9.0 (2025-02-27)

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

### Features

* **api:** api update ([#559](https://github.com/orbcorp/orb-python/issues/559)) ([0ea58b5](https://github.com/orbcorp/orb-python/commit/0ea58b5e7bcd0ded6a04f5875198f73c961acc1e))


### Chores

* **internal:** properly set __pydantic_private__ ([#557](https://github.com/orbcorp/orb-python/issues/557)) ([5df04a9](https://github.com/orbcorp/orb-python/commit/5df04a9fdffc8eba2dbbe81503f4a8280f8e7dbd))

## 3.8.0 (2025-02-25)

Full Changelog: [v3.7.0...v3.8.0](https://github.com/orbcorp/orb-python/compare/v3.7.0...v3.8.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.8.0"
version = "3.9.0"
description = "The official Python library for the orb API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
8 changes: 7 additions & 1 deletion src/orb/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
ModelBuilderProtocol,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import model_copy, model_dump
from ._compat import PYDANTIC_V2, model_copy, model_dump
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
from ._response import (
APIResponse,
Expand Down Expand Up @@ -208,6 +208,9 @@ def _set_private_attributes(
model: Type[_T],
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
self._client = client
self._options = options
Expand Down Expand Up @@ -293,6 +296,9 @@ def _set_private_attributes(
client: AsyncAPIClient,
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
self._client = client
self._options = options
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.8.0" # x-release-please-version
__version__ = "3.9.0" # x-release-please-version
12 changes: 8 additions & 4 deletions src/orb/resources/customers/credits/top_ups.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ def delete(
idempotency_key: str | None = None,
) -> None:
"""
Delete top-up
This deactivates the top-up and voids any invoices associated with pending
credit blocks purchased through the top-up.

Args:
extra_headers: Send extra headers
Expand Down Expand Up @@ -339,7 +340,8 @@ def delete_by_external_id(
idempotency_key: str | None = None,
) -> None:
"""
Delete top-up by external ID
This deactivates the top-up and voids any invoices associated with pending
credit blocks purchased through the top-up.

Args:
extra_headers: Send extra headers
Expand Down Expand Up @@ -599,7 +601,8 @@ async def delete(
idempotency_key: str | None = None,
) -> None:
"""
Delete top-up
This deactivates the top-up and voids any invoices associated with pending
credit blocks purchased through the top-up.

Args:
extra_headers: Send extra headers
Expand Down Expand Up @@ -732,7 +735,8 @@ async def delete_by_external_id(
idempotency_key: str | None = None,
) -> None:
"""
Delete top-up by external ID
This deactivates the top-up and voids any invoices associated with pending
credit blocks purchased through the top-up.

Args:
extra_headers: Send extra headers
Expand Down
9 changes: 9 additions & 0 deletions src/orb/types/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ class PriceInterval(BaseModel):
This is the date that Orb stops billing for this price.
"""

filter: Optional[str] = None
"""An additional filter to apply to usage queries."""

fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None
"""The fixed fee quantity transitions for this price interval.

Expand All @@ -407,6 +410,12 @@ class PriceInterval(BaseModel):
This is the date that Orb starts billing for this price.
"""

usage_customer_ids: Optional[List[str]] = None
"""
A list of customer IDs whose usage events will be aggregated and billed under
this price interval.
"""


class RedeemedCoupon(BaseModel):
coupon_id: str
Expand Down
9 changes: 9 additions & 0 deletions src/orb/types/subscription_cancel_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ class PriceInterval(BaseModel):
This is the date that Orb stops billing for this price.
"""

filter: Optional[str] = None
"""An additional filter to apply to usage queries."""

fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None
"""The fixed fee quantity transitions for this price interval.

Expand All @@ -407,6 +410,12 @@ class PriceInterval(BaseModel):
This is the date that Orb starts billing for this price.
"""

usage_customer_ids: Optional[List[str]] = None
"""
A list of customer IDs whose usage events will be aggregated and billed under
this price interval.
"""


class RedeemedCoupon(BaseModel):
coupon_id: str
Expand Down
9 changes: 9 additions & 0 deletions src/orb/types/subscription_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ class PriceInterval(BaseModel):
This is the date that Orb stops billing for this price.
"""

filter: Optional[str] = None
"""An additional filter to apply to usage queries."""

fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None
"""The fixed fee quantity transitions for this price interval.

Expand All @@ -407,6 +410,12 @@ class PriceInterval(BaseModel):
This is the date that Orb starts billing for this price.
"""

usage_customer_ids: Optional[List[str]] = None
"""
A list of customer IDs whose usage events will be aggregated and billed under
this price interval.
"""


class RedeemedCoupon(BaseModel):
coupon_id: str
Expand Down
36 changes: 36 additions & 0 deletions src/orb/types/subscription_price_intervals_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2666,6 +2666,14 @@ class Add(TypedDict, total=False):
external_price_id: Optional[str]
"""The external price id of the price to add to the subscription."""

filter: Optional[str]
"""An additional filter to apply to usage queries.

This filter must be expressed as a boolean
[computed property](/extensibility/advanced-metrics#computed-properties). If
null, usage queries will not include any additional filter.
"""

fixed_fee_quantity_transitions: Optional[Iterable[AddFixedFeeQuantityTransition]]
"""A list of fixed fee quantity transitions to initialize on the price interval."""

Expand All @@ -2687,6 +2695,16 @@ class Add(TypedDict, total=False):
price_id: Optional[str]
"""The id of the price to add to the subscription."""

usage_customer_ids: Optional[List[str]]
"""
A list of customer IDs whose usage events will be aggregated and billed under
this subscription. By default, a subscription only considers usage events
associated with its attached customer's customer_id. When usage_customer_ids is
provided, the subscription includes usage events from the specified customers
only. Provided usage_customer_ids must be either the customer for this
subscription itself, or any of that customer's children.
"""


class AddAdjustmentAdjustmentNewPercentageDiscount(TypedDict, total=False):
adjustment_type: Required[Literal["percentage_discount"]]
Expand Down Expand Up @@ -2821,6 +2839,14 @@ class Edit(TypedDict, total=False):
If not specified, the start date will not be updated.
"""

filter: Optional[str]
"""An additional filter to apply to usage queries.

This filter must be expressed as a boolean
[computed property](/extensibility/advanced-metrics#computed-properties). If
null, usage queries will not include any additional filter.
"""

fixed_fee_quantity_transitions: Optional[Iterable[EditFixedFeeQuantityTransition]]
"""A list of fixed fee quantity transitions to use for this price interval.

Expand All @@ -2834,6 +2860,16 @@ class Edit(TypedDict, total=False):
If not specified, the start date will not be updated.
"""

usage_customer_ids: Optional[List[str]]
"""
A list of customer IDs whose usage events will be aggregated and billed under
this subscription. By default, a subscription only considers usage events
associated with its attached customer's customer_id. When usage_customer_ids is
provided, the subscription includes usage events from the specified customers
only. Provided usage_customer_ids must be either the customer for this
subscription itself, or any of that customer's children.
"""


class EditAdjustment(TypedDict, total=False):
adjustment_interval_id: Required[str]
Expand Down
9 changes: 9 additions & 0 deletions src/orb/types/subscription_price_intervals_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ class PriceInterval(BaseModel):
This is the date that Orb stops billing for this price.
"""

filter: Optional[str] = None
"""An additional filter to apply to usage queries."""

fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None
"""The fixed fee quantity transitions for this price interval.

Expand All @@ -407,6 +410,12 @@ class PriceInterval(BaseModel):
This is the date that Orb starts billing for this price.
"""

usage_customer_ids: Optional[List[str]] = None
"""
A list of customer IDs whose usage events will be aggregated and billed under
this price interval.
"""


class RedeemedCoupon(BaseModel):
coupon_id: str
Expand Down
9 changes: 9 additions & 0 deletions src/orb/types/subscription_schedule_plan_change_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ class PriceInterval(BaseModel):
This is the date that Orb stops billing for this price.
"""

filter: Optional[str] = None
"""An additional filter to apply to usage queries."""

fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None
"""The fixed fee quantity transitions for this price interval.

Expand All @@ -407,6 +410,12 @@ class PriceInterval(BaseModel):
This is the date that Orb starts billing for this price.
"""

usage_customer_ids: Optional[List[str]] = None
"""
A list of customer IDs whose usage events will be aggregated and billed under
this price interval.
"""


class RedeemedCoupon(BaseModel):
coupon_id: str
Expand Down
9 changes: 9 additions & 0 deletions src/orb/types/subscription_trigger_phase_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ class PriceInterval(BaseModel):
This is the date that Orb stops billing for this price.
"""

filter: Optional[str] = None
"""An additional filter to apply to usage queries."""

fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None
"""The fixed fee quantity transitions for this price interval.

Expand All @@ -407,6 +410,12 @@ class PriceInterval(BaseModel):
This is the date that Orb starts billing for this price.
"""

usage_customer_ids: Optional[List[str]] = None
"""
A list of customer IDs whose usage events will be aggregated and billed under
this price interval.
"""


class RedeemedCoupon(BaseModel):
coupon_id: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ class PriceInterval(BaseModel):
This is the date that Orb stops billing for this price.
"""

filter: Optional[str] = None
"""An additional filter to apply to usage queries."""

fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None
"""The fixed fee quantity transitions for this price interval.

Expand All @@ -407,6 +410,12 @@ class PriceInterval(BaseModel):
This is the date that Orb starts billing for this price.
"""

usage_customer_ids: Optional[List[str]] = None
"""
A list of customer IDs whose usage events will be aggregated and billed under
this price interval.
"""


class RedeemedCoupon(BaseModel):
coupon_id: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ class PriceInterval(BaseModel):
This is the date that Orb stops billing for this price.
"""

filter: Optional[str] = None
"""An additional filter to apply to usage queries."""

fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None
"""The fixed fee quantity transitions for this price interval.

Expand All @@ -407,6 +410,12 @@ class PriceInterval(BaseModel):
This is the date that Orb starts billing for this price.
"""

usage_customer_ids: Optional[List[str]] = None
"""
A list of customer IDs whose usage events will be aggregated and billed under
this price interval.
"""


class RedeemedCoupon(BaseModel):
coupon_id: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ class PriceInterval(BaseModel):
This is the date that Orb stops billing for this price.
"""

filter: Optional[str] = None
"""An additional filter to apply to usage queries."""

fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None
"""The fixed fee quantity transitions for this price interval.

Expand All @@ -407,6 +410,12 @@ class PriceInterval(BaseModel):
This is the date that Orb starts billing for this price.
"""

usage_customer_ids: Optional[List[str]] = None
"""
A list of customer IDs whose usage events will be aggregated and billed under
this price interval.
"""


class RedeemedCoupon(BaseModel):
coupon_id: str
Expand Down
Loading