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 @@
{
".": "4.32.0"
".": "4.33.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 118
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-79664fa0b4ea00c978ae2516087d0ee591b0ef92ca8db29557a0424bde520e10.yml
openapi_spec_hash: 1ff6eee9184312a3a0fd21eb589132f9
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d1abf71a1a70a43bdcc4da7104dabcbd67aa7e2d3e6cf21e33f50904b6997bb2.yml
openapi_spec_hash: 28b0b31a997588cf3692458889321e1b
config_hash: dd4343ce95871032ef6e0735a4ca038c
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 4.33.0 (2025-10-31)

Full Changelog: [v4.32.0...v4.33.0](https://github.com/orbcorp/orb-python/compare/v4.32.0...v4.33.0)

### Features

* **api:** api update ([b666010](https://github.com/orbcorp/orb-python/commit/b6660101bad4fec7375463ce218f0b4b6364490b))

## 4.32.0 (2025-10-31)

Full Changelog: [v4.31.0...v4.32.0](https://github.com/orbcorp/orb-python/compare/v4.31.0...v4.32.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 = "4.32.0"
version = "4.33.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__ = "4.32.0" # x-release-please-version
__version__ = "4.33.0" # x-release-please-version
42 changes: 41 additions & 1 deletion src/orb/resources/customers/credits/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Any, Dict, Union, Optional, cast
from typing import Any, Dict, Union, Iterable, Optional, cast
from datetime import date, datetime
from typing_extensions import Literal, overload

Expand Down Expand Up @@ -223,6 +223,8 @@ def create_entry(
description: Optional[str] | Omit = omit,
effective_date: Union[str, datetime, None] | Omit = omit,
expiry_date: Union[str, datetime, None] | Omit = omit,
filters: Optional[Iterable[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsFilter]]
| Omit = omit,
invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
| Omit = omit,
metadata: Optional[Dict[str, Optional[str]]] | Omit = omit,
Expand Down Expand Up @@ -363,6 +365,9 @@ def create_entry(

expiry_date: An ISO 8601 format date that denotes when this credit balance should expire.

filters: Optional filter to specify which items this credit block applies to. If not
specified, the block will apply to all items for the pricing unit.

invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly
added credits. If `invoice_settings` is passed, you must specify
per_unit_cost_basis, as the calculation of the invoice total is done on that
Expand Down Expand Up @@ -1051,6 +1056,8 @@ def create_entry(
description: Optional[str] | Omit = omit,
effective_date: Union[str, datetime, None] | Omit = omit,
expiry_date: Union[str, datetime, None] | Omit = omit,
filters: Optional[Iterable[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsFilter]]
| Omit = omit,
invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
| Omit = omit,
metadata: Optional[Dict[str, Optional[str]]] | Omit = omit,
Expand Down Expand Up @@ -1080,6 +1087,7 @@ def create_entry(
"description": description,
"effective_date": effective_date,
"expiry_date": expiry_date,
"filters": filters,
"invoice_settings": invoice_settings,
"metadata": metadata,
"per_unit_cost_basis": per_unit_cost_basis,
Expand Down Expand Up @@ -1113,6 +1121,10 @@ def create_entry_by_external_id(
description: Optional[str] | Omit = omit,
effective_date: Union[str, datetime, None] | Omit = omit,
expiry_date: Union[str, datetime, None] | Omit = omit,
filters: Optional[
Iterable[ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsFilter]
]
| Omit = omit,
invoice_settings: Optional[
ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings
]
Expand Down Expand Up @@ -1255,6 +1267,9 @@ def create_entry_by_external_id(

expiry_date: An ISO 8601 format date that denotes when this credit balance should expire.

filters: Optional filter to specify which items this credit block applies to. If not
specified, the block will apply to all items for the pricing unit.

invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly
added credits. If `invoice_settings` is passed, you must specify
per_unit_cost_basis, as the calculation of the invoice total is done on that
Expand Down Expand Up @@ -1943,6 +1958,10 @@ def create_entry_by_external_id(
description: Optional[str] | Omit = omit,
effective_date: Union[str, datetime, None] | Omit = omit,
expiry_date: Union[str, datetime, None] | Omit = omit,
filters: Optional[
Iterable[ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsFilter]
]
| Omit = omit,
invoice_settings: Optional[
ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings
]
Expand Down Expand Up @@ -1976,6 +1995,7 @@ def create_entry_by_external_id(
"description": description,
"effective_date": effective_date,
"expiry_date": expiry_date,
"filters": filters,
"invoice_settings": invoice_settings,
"metadata": metadata,
"per_unit_cost_basis": per_unit_cost_basis,
Expand Down Expand Up @@ -2354,6 +2374,8 @@ async def create_entry(
description: Optional[str] | Omit = omit,
effective_date: Union[str, datetime, None] | Omit = omit,
expiry_date: Union[str, datetime, None] | Omit = omit,
filters: Optional[Iterable[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsFilter]]
| Omit = omit,
invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
| Omit = omit,
metadata: Optional[Dict[str, Optional[str]]] | Omit = omit,
Expand Down Expand Up @@ -2494,6 +2516,9 @@ async def create_entry(

expiry_date: An ISO 8601 format date that denotes when this credit balance should expire.

filters: Optional filter to specify which items this credit block applies to. If not
specified, the block will apply to all items for the pricing unit.

invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly
added credits. If `invoice_settings` is passed, you must specify
per_unit_cost_basis, as the calculation of the invoice total is done on that
Expand Down Expand Up @@ -3182,6 +3207,8 @@ async def create_entry(
description: Optional[str] | Omit = omit,
effective_date: Union[str, datetime, None] | Omit = omit,
expiry_date: Union[str, datetime, None] | Omit = omit,
filters: Optional[Iterable[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsFilter]]
| Omit = omit,
invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
| Omit = omit,
metadata: Optional[Dict[str, Optional[str]]] | Omit = omit,
Expand Down Expand Up @@ -3211,6 +3238,7 @@ async def create_entry(
"description": description,
"effective_date": effective_date,
"expiry_date": expiry_date,
"filters": filters,
"invoice_settings": invoice_settings,
"metadata": metadata,
"per_unit_cost_basis": per_unit_cost_basis,
Expand Down Expand Up @@ -3244,6 +3272,10 @@ async def create_entry_by_external_id(
description: Optional[str] | Omit = omit,
effective_date: Union[str, datetime, None] | Omit = omit,
expiry_date: Union[str, datetime, None] | Omit = omit,
filters: Optional[
Iterable[ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsFilter]
]
| Omit = omit,
invoice_settings: Optional[
ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings
]
Expand Down Expand Up @@ -3386,6 +3418,9 @@ async def create_entry_by_external_id(

expiry_date: An ISO 8601 format date that denotes when this credit balance should expire.

filters: Optional filter to specify which items this credit block applies to. If not
specified, the block will apply to all items for the pricing unit.

invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly
added credits. If `invoice_settings` is passed, you must specify
per_unit_cost_basis, as the calculation of the invoice total is done on that
Expand Down Expand Up @@ -4074,6 +4109,10 @@ async def create_entry_by_external_id(
description: Optional[str] | Omit = omit,
effective_date: Union[str, datetime, None] | Omit = omit,
expiry_date: Union[str, datetime, None] | Omit = omit,
filters: Optional[
Iterable[ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsFilter]
]
| Omit = omit,
invoice_settings: Optional[
ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings
]
Expand Down Expand Up @@ -4107,6 +4146,7 @@ async def create_entry_by_external_id(
"description": description,
"effective_date": effective_date,
"expiry_date": expiry_date,
"filters": filters,
"invoice_settings": invoice_settings,
"metadata": metadata,
"per_unit_cost_basis": per_unit_cost_basis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

from __future__ import annotations

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

from ...._types import SequenceNotStr
from ...._utils import PropertyInfo

__all__ = [
"LedgerCreateEntryByExternalIDParams",
"AddIncrementCreditLedgerEntryRequestParams",
"AddIncrementCreditLedgerEntryRequestParamsFilter",
"AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings",
"AddDecrementCreditLedgerEntryRequestParams",
"AddExpirationChangeCreditLedgerEntryRequestParams",
Expand Down Expand Up @@ -51,6 +53,12 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False):
expiry_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""An ISO 8601 format date that denotes when this credit balance should expire."""

filters: Optional[Iterable[AddIncrementCreditLedgerEntryRequestParamsFilter]]
"""Optional filter to specify which items this credit block applies to.

If not specified, the block will apply to all items for the pricing unit.
"""

invoice_settings: Optional[AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
"""
Passing `invoice_settings` automatically generates an invoice for the newly
Expand All @@ -74,6 +82,17 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False):
"""


class AddIncrementCreditLedgerEntryRequestParamsFilter(TypedDict, total=False):
field: Required[Literal["item_id"]]
"""The property of the price the block applies to. Only item_id is supported."""

operator: Required[Literal["includes", "excludes"]]
"""Should prices that match the filter be included or excluded."""

values: Required[SequenceNotStr[str]]
"""The IDs or values that match this filter."""


class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total=False):
auto_collection: Required[bool]
"""
Expand Down
21 changes: 20 additions & 1 deletion src/orb/types/customers/credits/ledger_create_entry_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

from __future__ import annotations

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

from ...._types import SequenceNotStr
from ...._utils import PropertyInfo

__all__ = [
"LedgerCreateEntryParams",
"AddIncrementCreditLedgerEntryRequestParams",
"AddIncrementCreditLedgerEntryRequestParamsFilter",
"AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings",
"AddDecrementCreditLedgerEntryRequestParams",
"AddExpirationChangeCreditLedgerEntryRequestParams",
Expand Down Expand Up @@ -51,6 +53,12 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False):
expiry_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""An ISO 8601 format date that denotes when this credit balance should expire."""

filters: Optional[Iterable[AddIncrementCreditLedgerEntryRequestParamsFilter]]
"""Optional filter to specify which items this credit block applies to.

If not specified, the block will apply to all items for the pricing unit.
"""

invoice_settings: Optional[AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
"""
Passing `invoice_settings` automatically generates an invoice for the newly
Expand All @@ -74,6 +82,17 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False):
"""


class AddIncrementCreditLedgerEntryRequestParamsFilter(TypedDict, total=False):
field: Required[Literal["item_id"]]
"""The property of the price the block applies to. Only item_id is supported."""

operator: Required[Literal["includes", "excludes"]]
"""Should prices that match the filter be included or excluded."""

values: Required[SequenceNotStr[str]]
"""The IDs or values that match this filter."""


class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total=False):
auto_collection: Required[bool]
"""
Expand Down
18 changes: 16 additions & 2 deletions src/orb/types/shared/new_allocation_price.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing import List, Optional
from typing_extensions import Literal

from ..._models import BaseModel
from .custom_expiration import CustomExpiration

__all__ = ["NewAllocationPrice"]
__all__ = ["NewAllocationPrice", "Filter"]


class Filter(BaseModel):
field: Literal["item_id"]
"""The property of the price the block applies to. Only item_id is supported."""

operator: Literal["includes", "excludes"]
"""Should prices that match the filter be included or excluded."""

values: List[str]
"""The IDs or values that match this filter."""


class NewAllocationPrice(BaseModel):
Expand All @@ -30,3 +41,6 @@ class NewAllocationPrice(BaseModel):
Whether the allocated amount should expire at the end of the cadence or roll
over to the next period. Set to null if using custom_expiration.
"""

filters: Optional[List[Filter]] = None
"""The filters that determine which items the allocation applies to."""
19 changes: 17 additions & 2 deletions src/orb/types/shared_params/new_allocation_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@

from __future__ import annotations

from typing import Optional
from typing import Iterable, Optional
from typing_extensions import Literal, Required, TypedDict

from ..._types import SequenceNotStr
from .custom_expiration import CustomExpiration

__all__ = ["NewAllocationPrice"]
__all__ = ["NewAllocationPrice", "Filter"]


class Filter(TypedDict, total=False):
field: Required[Literal["item_id"]]
"""The property of the price the block applies to. Only item_id is supported."""

operator: Required[Literal["includes", "excludes"]]
"""Should prices that match the filter be included or excluded."""

values: Required[SequenceNotStr[str]]
"""The IDs or values that match this filter."""


class NewAllocationPrice(TypedDict, total=False):
Expand All @@ -31,3 +43,6 @@ class NewAllocationPrice(TypedDict, total=False):
Whether the allocated amount should expire at the end of the cadence or roll
over to the next period. Set to null if using custom_expiration.
"""

filters: Optional[Iterable[Filter]]
"""The filters that determine which items the allocation applies to."""
Loading