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.6.0"
".": "3.7.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-097aa5c0e1408d7bd31c15caded400b84f45c0296aebdf67a1dc1a4013f371dd.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-26c7b0375aaf9218b32f9af29242d38e67a8318f3ae3e8cc5d1cd86c60e89e51.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.7.0 (2025-02-21)

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

### Features

* **api:** api update ([#551](https://github.com/orbcorp/orb-python/issues/551)) ([9af0efd](https://github.com/orbcorp/orb-python/commit/9af0efd82d4c18870479dd0ce966899d04f14485))

## 3.6.0 (2025-02-21)

Full Changelog: [v3.5.0...v3.6.0](https://github.com/orbcorp/orb-python/compare/v3.5.0...v3.6.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.6.0"
version = "3.7.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.6.0" # x-release-please-version
__version__ = "3.7.0" # x-release-please-version
23 changes: 22 additions & 1 deletion src/orb/resources/customers/credits/top_ups.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from __future__ import annotations

from typing import Optional
from typing import Union, Optional
from datetime import datetime
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -61,6 +62,7 @@ def create(
invoice_settings: top_up_create_params.InvoiceSettings,
per_unit_cost_basis: str,
threshold: str,
active_from: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expires_after: Optional[int] | NotGiven = NOT_GIVEN,
expires_after_unit: Optional[Literal["day", "month"]] | 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 @@ -93,6 +95,9 @@ def create(
threshold: The threshold at which to trigger the top-up. If the balance is at or below this
threshold, the top-up will be triggered.

active_from: The date from which the top-up is active. If unspecified, the top-up is active
immediately.

expires_after: The number of days or months after which the top-up expires. If unspecified, it
does not expire.

Expand All @@ -119,6 +124,7 @@ def create(
"invoice_settings": invoice_settings,
"per_unit_cost_basis": per_unit_cost_basis,
"threshold": threshold,
"active_from": active_from,
"expires_after": expires_after,
"expires_after_unit": expires_after_unit,
},
Expand Down Expand Up @@ -239,6 +245,7 @@ def create_by_external_id(
invoice_settings: top_up_create_by_external_id_params.InvoiceSettings,
per_unit_cost_basis: str,
threshold: str,
active_from: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expires_after: Optional[int] | NotGiven = NOT_GIVEN,
expires_after_unit: Optional[Literal["day", "month"]] | 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 @@ -271,6 +278,9 @@ def create_by_external_id(
threshold: The threshold at which to trigger the top-up. If the balance is at or below this
threshold, the top-up will be triggered.

active_from: The date from which the top-up is active. If unspecified, the top-up is active
immediately.

expires_after: The number of days or months after which the top-up expires. If unspecified, it
does not expire.

Expand Down Expand Up @@ -299,6 +309,7 @@ def create_by_external_id(
"invoice_settings": invoice_settings,
"per_unit_cost_basis": per_unit_cost_basis,
"threshold": threshold,
"active_from": active_from,
"expires_after": expires_after,
"expires_after_unit": expires_after_unit,
},
Expand Down Expand Up @@ -444,6 +455,7 @@ async def create(
invoice_settings: top_up_create_params.InvoiceSettings,
per_unit_cost_basis: str,
threshold: str,
active_from: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expires_after: Optional[int] | NotGiven = NOT_GIVEN,
expires_after_unit: Optional[Literal["day", "month"]] | 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 @@ -476,6 +488,9 @@ async def create(
threshold: The threshold at which to trigger the top-up. If the balance is at or below this
threshold, the top-up will be triggered.

active_from: The date from which the top-up is active. If unspecified, the top-up is active
immediately.

expires_after: The number of days or months after which the top-up expires. If unspecified, it
does not expire.

Expand All @@ -502,6 +517,7 @@ async def create(
"invoice_settings": invoice_settings,
"per_unit_cost_basis": per_unit_cost_basis,
"threshold": threshold,
"active_from": active_from,
"expires_after": expires_after,
"expires_after_unit": expires_after_unit,
},
Expand Down Expand Up @@ -622,6 +638,7 @@ async def create_by_external_id(
invoice_settings: top_up_create_by_external_id_params.InvoiceSettings,
per_unit_cost_basis: str,
threshold: str,
active_from: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expires_after: Optional[int] | NotGiven = NOT_GIVEN,
expires_after_unit: Optional[Literal["day", "month"]] | 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 @@ -654,6 +671,9 @@ async def create_by_external_id(
threshold: The threshold at which to trigger the top-up. If the balance is at or below this
threshold, the top-up will be triggered.

active_from: The date from which the top-up is active. If unspecified, the top-up is active
immediately.

expires_after: The number of days or months after which the top-up expires. If unspecified, it
does not expire.

Expand Down Expand Up @@ -682,6 +702,7 @@ async def create_by_external_id(
"invoice_settings": invoice_settings,
"per_unit_cost_basis": per_unit_cost_basis,
"threshold": threshold,
"active_from": active_from,
"expires_after": expires_after,
"expires_after_unit": expires_after_unit,
},
Expand Down
8 changes: 8 additions & 0 deletions src/orb/resources/invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,10 @@ def void(
invoice used $10 of customer balance, that amount will be added back to the
customer balance upon voiding.

If the invoice was used to purchase a credit block, but the invoice is not yet
paid, the credit block will be voided. If the invoice was created due to a
top-up, the top-up will be disabled.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -1078,6 +1082,10 @@ async def void(
invoice used $10 of customer balance, that amount will be added back to the
customer balance upon voiding.

If the invoice was used to purchase a credit block, but the invoice is not yet
paid, the credit block will be voided. If the invoice was created due to a
top-up, the top-up will be disabled.

Args:
extra_headers: Send extra headers

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

from __future__ import annotations

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

from ...._utils import PropertyInfo

__all__ = ["TopUpCreateByExternalIDParams", "InvoiceSettings"]

Expand Down Expand Up @@ -31,6 +34,12 @@ class TopUpCreateByExternalIDParams(TypedDict, total=False):
If the balance is at or below this threshold, the top-up will be triggered.
"""

active_from: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""The date from which the top-up is active.

If unspecified, the top-up is active immediately.
"""

expires_after: Optional[int]
"""The number of days or months after which the top-up expires.

Expand Down
13 changes: 11 additions & 2 deletions src/orb/types/customers/credits/top_up_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

from __future__ import annotations

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

from ...._utils import PropertyInfo

__all__ = ["TopUpCreateParams", "InvoiceSettings"]

Expand Down Expand Up @@ -31,6 +34,12 @@ class TopUpCreateParams(TypedDict, total=False):
If the balance is at or below this threshold, the top-up will be triggered.
"""

active_from: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""The date from which the top-up is active.

If unspecified, the top-up is active immediately.
"""

expires_after: Optional[int]
"""The number of days or months after which the top-up expires.

Expand Down
5 changes: 5 additions & 0 deletions tests/api_resources/customers/credits/test_top_ups.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pytest

from orb import Orb, AsyncOrb
from orb._utils import parse_datetime
from tests.utils import assert_matches_type
from orb.pagination import SyncPage, AsyncPage
from orb.types.customers.credits import (
Expand Down Expand Up @@ -52,6 +53,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
},
per_unit_cost_basis="per_unit_cost_basis",
threshold="threshold",
active_from=parse_datetime("2019-12-27T18:11:19.117Z"),
expires_after=0,
expires_after_unit="day",
)
Expand Down Expand Up @@ -236,6 +238,7 @@ def test_method_create_by_external_id_with_all_params(self, client: Orb) -> None
},
per_unit_cost_basis="per_unit_cost_basis",
threshold="threshold",
active_from=parse_datetime("2019-12-27T18:11:19.117Z"),
expires_after=0,
expires_after_unit="day",
)
Expand Down Expand Up @@ -424,6 +427,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
},
per_unit_cost_basis="per_unit_cost_basis",
threshold="threshold",
active_from=parse_datetime("2019-12-27T18:11:19.117Z"),
expires_after=0,
expires_after_unit="day",
)
Expand Down Expand Up @@ -608,6 +612,7 @@ async def test_method_create_by_external_id_with_all_params(self, async_client:
},
per_unit_cost_basis="per_unit_cost_basis",
threshold="threshold",
active_from=parse_datetime("2019-12-27T18:11:19.117Z"),
expires_after=0,
expires_after_unit="day",
)
Expand Down