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.7.0"
".": "4.8.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: 116
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-373ca3e805c414f75a90b0088c57cbb60ff207abdca0a8e397c551de88606c4a.yml
openapi_spec_hash: 1c30d01bd9c38f8a2aa4bd088fbe69bc
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-a44cccd16bb58080f7cc0669999403f6ed3f77287fad901caa6fd2523f2fbafd.yml
openapi_spec_hash: af6444648d0b2a70b7f7ad234bd37541
config_hash: 1f535c1fa222aacf28b636eed21bec72
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 4.8.0 (2025-07-21)

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

### Features

* **api:** api update ([9711886](https://github.com/orbcorp/orb-python/commit/9711886506c63d40e2114ffd2c70acb41d15e379))


### Bug Fixes

* **parsing:** ignore empty metadata ([9850225](https://github.com/orbcorp/orb-python/commit/9850225b67c5db54cad8b95b5fe577e2ec2fbc11))

## 4.7.0 (2025-07-17)

Full Changelog: [v4.6.0...v4.7.0](https://github.com/orbcorp/orb-python/compare/v4.6.0...v4.7.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.7.0"
version = "4.8.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/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]
type_ = type_.__value__ # type: ignore[unreachable]

# unwrap `Annotated[T, ...]` -> `T`
if metadata is not None:
if metadata is not None and len(metadata) > 0:
meta: tuple[Any, ...] = tuple(metadata)
elif is_annotated_type(type_):
meta = get_args(type_)[1:]
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.7.0" # x-release-please-version
__version__ = "4.8.0" # x-release-please-version
28 changes: 14 additions & 14 deletions src/orb/resources/invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ def create(
currency: str,
invoice_date: Union[str, datetime],
line_items: Iterable[invoice_create_params.LineItem],
net_terms: int,
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
discount: Optional[Discount] | NotGiven = NOT_GIVEN,
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
memo: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
will_auto_issue: bool | 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 @@ -82,11 +82,6 @@ def create(
invoice_date: Optional invoice date to set. Must be in the past, if not set, `invoice_date` is
set to the current time in the customer's timezone.

net_terms: Determines the difference between the invoice issue date for subscription
invoices as the date that they are due. A value of '0' here represents that the
invoice is due on issue, whereas a value of 30 represents that the customer has
30 days to pay the invoice.

customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and
`external_customer_id` are required.

Expand All @@ -101,6 +96,11 @@ def create(
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

net_terms: Determines the difference between the invoice issue date for subscription
invoices as the date that they are due. A value of '0' here represents that the
invoice is due on issue, whereas a value of 30 represents that the customer has
30 days to pay the invoice.

will_auto_issue: When true, this invoice will be submitted for issuance upon creation. When
false, the resulting invoice will require manual review to issue. Defaulted to
false.
Expand All @@ -122,12 +122,12 @@ def create(
"currency": currency,
"invoice_date": invoice_date,
"line_items": line_items,
"net_terms": net_terms,
"customer_id": customer_id,
"discount": discount,
"external_customer_id": external_customer_id,
"memo": memo,
"metadata": metadata,
"net_terms": net_terms,
"will_auto_issue": will_auto_issue,
},
invoice_create_params.InvoiceCreateParams,
Expand Down Expand Up @@ -597,12 +597,12 @@ async def create(
currency: str,
invoice_date: Union[str, datetime],
line_items: Iterable[invoice_create_params.LineItem],
net_terms: int,
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
discount: Optional[Discount] | NotGiven = NOT_GIVEN,
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
memo: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
will_auto_issue: bool | 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 @@ -622,11 +622,6 @@ async def create(
invoice_date: Optional invoice date to set. Must be in the past, if not set, `invoice_date` is
set to the current time in the customer's timezone.

net_terms: Determines the difference between the invoice issue date for subscription
invoices as the date that they are due. A value of '0' here represents that the
invoice is due on issue, whereas a value of 30 represents that the customer has
30 days to pay the invoice.

customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and
`external_customer_id` are required.

Expand All @@ -641,6 +636,11 @@ async def create(
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

net_terms: Determines the difference between the invoice issue date for subscription
invoices as the date that they are due. A value of '0' here represents that the
invoice is due on issue, whereas a value of 30 represents that the customer has
30 days to pay the invoice.

will_auto_issue: When true, this invoice will be submitted for issuance upon creation. When
false, the resulting invoice will require manual review to issue. Defaulted to
false.
Expand All @@ -662,12 +662,12 @@ async def create(
"currency": currency,
"invoice_date": invoice_date,
"line_items": line_items,
"net_terms": net_terms,
"customer_id": customer_id,
"discount": discount,
"external_customer_id": external_customer_id,
"memo": memo,
"metadata": metadata,
"net_terms": net_terms,
"will_auto_issue": will_auto_issue,
},
invoice_create_params.InvoiceCreateParams,
Expand Down
16 changes: 8 additions & 8 deletions src/orb/types/invoice_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ class InvoiceCreateParams(TypedDict, total=False):

line_items: Required[Iterable[LineItem]]

net_terms: Required[int]
"""
Determines the difference between the invoice issue date for subscription
invoices as the date that they are due. A value of '0' here represents that the
invoice is due on issue, whereas a value of 30 represents that the customer has
30 days to pay the invoice.
"""

customer_id: Optional[str]
"""The id of the `Customer` to create this invoice for.

Expand All @@ -62,6 +54,14 @@ class InvoiceCreateParams(TypedDict, total=False):
metadata mapping can be cleared by setting `metadata` to `null`.
"""

net_terms: Optional[int]
"""
Determines the difference between the invoice issue date for subscription
invoices as the date that they are due. A value of '0' here represents that the
invoice is due on issue, whereas a value of 30 represents that the customer has
30 days to pay the invoice.
"""

will_auto_issue: bool
"""When true, this invoice will be submitted for issuance upon creation.

Expand Down
10 changes: 2 additions & 8 deletions tests/api_resources/test_invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def test_method_create(self, client: Orb) -> None:
"unit_config": {"unit_amount": "unit_amount"},
}
],
net_terms=0,
)
assert_matches_type(Invoice, invoice, path=["response"])

Expand All @@ -58,7 +57,6 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
"unit_config": {"unit_amount": "unit_amount"},
}
],
net_terms=0,
customer_id="4khy3nwzktxv7",
discount={
"discount_type": "percentage",
Expand All @@ -76,6 +74,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
external_customer_id="external-customer-id",
memo="An optional memo for my invoice.",
metadata={"foo": "string"},
net_terms=0,
will_auto_issue=False,
)
assert_matches_type(Invoice, invoice, path=["response"])
Expand All @@ -96,7 +95,6 @@ def test_raw_response_create(self, client: Orb) -> None:
"unit_config": {"unit_amount": "unit_amount"},
}
],
net_terms=0,
)

assert response.is_closed is True
Expand All @@ -120,7 +118,6 @@ def test_streaming_response_create(self, client: Orb) -> None:
"unit_config": {"unit_amount": "unit_amount"},
}
],
net_terms=0,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down Expand Up @@ -491,7 +488,6 @@ async def test_method_create(self, async_client: AsyncOrb) -> None:
"unit_config": {"unit_amount": "unit_amount"},
}
],
net_terms=0,
)
assert_matches_type(Invoice, invoice, path=["response"])

Expand All @@ -511,7 +507,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
"unit_config": {"unit_amount": "unit_amount"},
}
],
net_terms=0,
customer_id="4khy3nwzktxv7",
discount={
"discount_type": "percentage",
Expand All @@ -529,6 +524,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
external_customer_id="external-customer-id",
memo="An optional memo for my invoice.",
metadata={"foo": "string"},
net_terms=0,
will_auto_issue=False,
)
assert_matches_type(Invoice, invoice, path=["response"])
Expand All @@ -549,7 +545,6 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None:
"unit_config": {"unit_amount": "unit_amount"},
}
],
net_terms=0,
)

assert response.is_closed is True
Expand All @@ -573,7 +568,6 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None:
"unit_config": {"unit_amount": "unit_amount"},
}
],
net_terms=0,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down