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
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
lint:
name: lint
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v4
Expand All @@ -30,6 +29,7 @@ jobs:

- name: Run lints
run: ./scripts/lint

test:
name: test
runs-on: ubuntu-latest
Expand All @@ -50,4 +50,3 @@ jobs:

- name: Run tests
run: ./scripts/test

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.24.0"
".": "2.25.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 101
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-7fca89ba5a0b4997358c25e6cdfb616a1d8b93a6820e25078f3fa5f61110bfe6.yml
configured_endpoints: 103
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-326205df28a52e9ad57c34d7ed1ec85fadd67f9a041df2882ebaa65f6de09930.yml
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 2.25.0 (2025-01-23)

Full Changelog: [v2.24.0...v2.25.0](https://github.com/orbcorp/orb-python/compare/v2.24.0...v2.25.0)

### Features

* **api:** api update ([#511](https://github.com/orbcorp/orb-python/issues/511)) ([052d15d](https://github.com/orbcorp/orb-python/commit/052d15d9822356db28a4a42ea085133a29b183aa))


### Chores

* **internal:** minor formatting changes ([#509](https://github.com/orbcorp/orb-python/issues/509)) ([15852c1](https://github.com/orbcorp/orb-python/commit/15852c155fa49397b3184cd648603070fbf59a87))

## 2.24.0 (2025-01-21)

Full Changelog: [v2.23.1...v2.24.0](https://github.com/orbcorp/orb-python/compare/v2.23.1...v2.24.0)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ Methods:
- <code title="delete /customers/{customer_id}">client.customers.<a href="./src/orb/resources/customers/customers.py">delete</a>(customer_id) -> None</code>
- <code title="get /customers/{customer_id}">client.customers.<a href="./src/orb/resources/customers/customers.py">fetch</a>(customer_id) -> <a href="./src/orb/types/customer.py">Customer</a></code>
- <code title="get /customers/external_customer_id/{external_customer_id}">client.customers.<a href="./src/orb/resources/customers/customers.py">fetch_by_external_id</a>(external_customer_id) -> <a href="./src/orb/types/customer.py">Customer</a></code>
- <code title="post /customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway">client.customers.<a href="./src/orb/resources/customers/customers.py">sync_payment_methods_from_gateway</a>(external_customer_id) -> None</code>
- <code title="post /customers/{customer_id}/sync_payment_methods_from_gateway">client.customers.<a href="./src/orb/resources/customers/customers.py">sync_payment_methods_from_gateway_by_external_customer_id</a>(customer_id) -> None</code>
- <code title="put /customers/external_customer_id/{external_customer_id}">client.customers.<a href="./src/orb/resources/customers/customers.py">update_by_external_id</a>(id, \*\*<a href="src/orb/types/customer_update_by_external_id_params.py">params</a>) -> <a href="./src/orb/types/customer.py">Customer</a></code>

## Costs
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 = "2.24.0"
version = "2.25.0"
description = "The official Python library for the orb API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

cd "$(dirname "$0")/.."

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
Expand Down
1 change: 0 additions & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ rye run lint

echo "==> Making sure it imports"
rye run python -c 'import orb'

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__ = "2.24.0" # x-release-please-version
__version__ = "2.25.0" # x-release-please-version
212 changes: 212 additions & 0 deletions src/orb/resources/customers/customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,100 @@ def fetch_by_external_id(
cast_to=Customer,
)

def sync_payment_methods_from_gateway(
self,
external_customer_id: str,
*,
# 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.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> None:
"""
Sync Orb's payment methods for the customer with their gateway.

This method can be called before taking an action that may cause the customer to
be charged, ensuring that the most up-to-date payment method is charged.

**Note**: This functionality is currently only available for Stripe.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
if not external_customer_id:
raise ValueError(
f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}"
)
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._post(
f"/customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=NoneType,
)

def sync_payment_methods_from_gateway_by_external_customer_id(
self,
customer_id: str,
*,
# 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.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> None:
"""
Sync Orb's payment methods for the customer with their gateway.

This method can be called before taking an action that may cause the customer to
be charged, ensuring that the most up-to-date payment method is charged.

**Note**: This functionality is currently only available for Stripe.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
if not customer_id:
raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._post(
f"/customers/{customer_id}/sync_payment_methods_from_gateway",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=NoneType,
)

def update_by_external_id(
self,
id: str,
Expand Down Expand Up @@ -1632,6 +1726,100 @@ async def fetch_by_external_id(
cast_to=Customer,
)

async def sync_payment_methods_from_gateway(
self,
external_customer_id: str,
*,
# 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.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> None:
"""
Sync Orb's payment methods for the customer with their gateway.

This method can be called before taking an action that may cause the customer to
be charged, ensuring that the most up-to-date payment method is charged.

**Note**: This functionality is currently only available for Stripe.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
if not external_customer_id:
raise ValueError(
f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}"
)
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._post(
f"/customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=NoneType,
)

async def sync_payment_methods_from_gateway_by_external_customer_id(
self,
customer_id: str,
*,
# 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.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> None:
"""
Sync Orb's payment methods for the customer with their gateway.

This method can be called before taking an action that may cause the customer to
be charged, ensuring that the most up-to-date payment method is charged.

**Note**: This functionality is currently only available for Stripe.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
if not customer_id:
raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._post(
f"/customers/{customer_id}/sync_payment_methods_from_gateway",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=NoneType,
)

async def update_by_external_id(
self,
id: str,
Expand Down Expand Up @@ -1876,6 +2064,12 @@ def __init__(self, customers: Customers) -> None:
self.fetch_by_external_id = _legacy_response.to_raw_response_wrapper(
customers.fetch_by_external_id,
)
self.sync_payment_methods_from_gateway = _legacy_response.to_raw_response_wrapper(
customers.sync_payment_methods_from_gateway,
)
self.sync_payment_methods_from_gateway_by_external_customer_id = _legacy_response.to_raw_response_wrapper(
customers.sync_payment_methods_from_gateway_by_external_customer_id,
)
self.update_by_external_id = _legacy_response.to_raw_response_wrapper(
customers.update_by_external_id,
)
Expand Down Expand Up @@ -1915,6 +2109,12 @@ def __init__(self, customers: AsyncCustomers) -> None:
self.fetch_by_external_id = _legacy_response.async_to_raw_response_wrapper(
customers.fetch_by_external_id,
)
self.sync_payment_methods_from_gateway = _legacy_response.async_to_raw_response_wrapper(
customers.sync_payment_methods_from_gateway,
)
self.sync_payment_methods_from_gateway_by_external_customer_id = _legacy_response.async_to_raw_response_wrapper(
customers.sync_payment_methods_from_gateway_by_external_customer_id,
)
self.update_by_external_id = _legacy_response.async_to_raw_response_wrapper(
customers.update_by_external_id,
)
Expand Down Expand Up @@ -1954,6 +2154,12 @@ def __init__(self, customers: Customers) -> None:
self.fetch_by_external_id = to_streamed_response_wrapper(
customers.fetch_by_external_id,
)
self.sync_payment_methods_from_gateway = to_streamed_response_wrapper(
customers.sync_payment_methods_from_gateway,
)
self.sync_payment_methods_from_gateway_by_external_customer_id = to_streamed_response_wrapper(
customers.sync_payment_methods_from_gateway_by_external_customer_id,
)
self.update_by_external_id = to_streamed_response_wrapper(
customers.update_by_external_id,
)
Expand Down Expand Up @@ -1993,6 +2199,12 @@ def __init__(self, customers: AsyncCustomers) -> None:
self.fetch_by_external_id = async_to_streamed_response_wrapper(
customers.fetch_by_external_id,
)
self.sync_payment_methods_from_gateway = async_to_streamed_response_wrapper(
customers.sync_payment_methods_from_gateway,
)
self.sync_payment_methods_from_gateway_by_external_customer_id = async_to_streamed_response_wrapper(
customers.sync_payment_methods_from_gateway_by_external_customer_id,
)
self.update_by_external_id = async_to_streamed_response_wrapper(
customers.update_by_external_id,
)
Expand Down
7 changes: 5 additions & 2 deletions src/orb/types/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,11 @@ class Invoice(BaseModel):

discounts: List[InvoiceLevelDiscount]

due_date: datetime
"""When the invoice payment is due."""
due_date: Optional[datetime] = None
"""When the invoice payment is due.

The due date is null if the invoice is not yet finalized.
"""

eligible_to_issue_at: Optional[datetime] = None
"""
Expand Down
7 changes: 5 additions & 2 deletions src/orb/types/invoice_fetch_upcoming_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,11 @@ class InvoiceFetchUpcomingResponse(BaseModel):

discounts: List[InvoiceLevelDiscount]

due_date: datetime
"""When the invoice payment is due."""
due_date: Optional[datetime] = None
"""When the invoice payment is due.

The due date is null if the invoice is not yet finalized.
"""

eligible_to_issue_at: Optional[datetime] = None
"""
Expand Down
Loading
Loading