diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1eec10e9..90eeef65 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.7.0" + ".": "4.8.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 580e92e5..5a4c2212 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 872d897a..02cf9d94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 7e1490cd..4a95d259 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/orb/_models.py b/src/orb/_models.py index 528d5680..ffcbf67b 100644 --- a/src/orb/_models.py +++ b/src/orb/_models.py @@ -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:] diff --git a/src/orb/_version.py b/src/orb/_version.py index dca90102..94848477 100644 --- a/src/orb/_version.py +++ b/src/orb/_version.py @@ -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 diff --git a/src/orb/resources/invoices.py b/src/orb/resources/invoices.py index d4d1951b..24d87c55 100644 --- a/src/orb/resources/invoices.py +++ b/src/orb/resources/invoices.py @@ -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. @@ -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. @@ -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. @@ -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, @@ -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. @@ -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. @@ -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. @@ -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, diff --git a/src/orb/types/invoice_create_params.py b/src/orb/types/invoice_create_params.py index 3460c8e3..7154f066 100644 --- a/src/orb/types/invoice_create_params.py +++ b/src/orb/types/invoice_create_params.py @@ -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. @@ -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. diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index d3b5bfee..dcb05b7a 100644 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -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"]) @@ -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", @@ -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"]) @@ -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 @@ -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" @@ -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"]) @@ -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", @@ -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"]) @@ -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 @@ -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"