From b32c5c421b709cc364f9efef136e2c4873bcb1c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 21:45:16 +0000 Subject: [PATCH 1/2] feat(api): OpenAPI spec update via Stainless API (#362) --- .stats.yml | 2 +- tests/api_resources/test_customers.py | 16 +-- tests/api_resources/test_invoices.py | 160 ++------------------------ tests/test_client.py | 8 +- 4 files changed, 21 insertions(+), 165 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8f3e94e4..2cbd598e 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 93 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-f7a9ce053743cf34e86ef2a3fec65b24f39847fd7e09c89a61e8fe222ac33e01.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-af2e129bdcee200185e3fb82837268c03686680beafec3e04b3b17ba32782b48.yml diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 11ab9253..392cefaa 100755 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -25,7 +25,7 @@ class TestCustomers: def test_method_create(self, client: Orb) -> None: customer = client.customers.create( email="email", - name="name", + name="x", ) assert_matches_type(Customer, customer, path=["response"]) @@ -33,7 +33,7 @@ def test_method_create(self, client: Orb) -> None: def test_method_create_with_all_params(self, client: Orb) -> None: customer = client.customers.create( email="email", - name="name", + name="x", accounting_sync_configuration={ "accounting_providers": [ { @@ -89,7 +89,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: def test_raw_response_create(self, client: Orb) -> None: response = client.customers.with_raw_response.create( email="email", - name="name", + name="x", ) assert response.is_closed is True @@ -101,7 +101,7 @@ def test_raw_response_create(self, client: Orb) -> None: def test_streaming_response_create(self, client: Orb) -> None: with client.customers.with_streaming_response.create( email="email", - name="name", + name="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -459,7 +459,7 @@ class TestAsyncCustomers: async def test_method_create(self, async_client: AsyncOrb) -> None: customer = await async_client.customers.create( email="email", - name="name", + name="x", ) assert_matches_type(Customer, customer, path=["response"]) @@ -467,7 +467,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: customer = await async_client.customers.create( email="email", - name="name", + name="x", accounting_sync_configuration={ "accounting_providers": [ { @@ -523,7 +523,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No async def test_raw_response_create(self, async_client: AsyncOrb) -> None: response = await async_client.customers.with_raw_response.create( email="email", - name="name", + name="x", ) assert response.is_closed is True @@ -535,7 +535,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: async with async_client.customers.with_streaming_response.create( email="email", - name="name", + name="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index c4394fce..16fd1453 100755 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -36,25 +36,7 @@ def test_method_create(self, client: Orb) -> None: "quantity": 1, "start_date": parse_date("2023-09-22"), "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, + } ], net_terms=0, ) @@ -74,25 +56,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "quantity": 1, "start_date": parse_date("2023-09-22"), "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, + } ], net_terms=0, customer_id="4khy3nwzktxv7", @@ -123,25 +87,7 @@ def test_raw_response_create(self, client: Orb) -> None: "quantity": 1, "start_date": parse_date("2023-09-22"), "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, + } ], net_terms=0, ) @@ -165,25 +111,7 @@ def test_streaming_response_create(self, client: Orb) -> None: "quantity": 1, "start_date": parse_date("2023-09-22"), "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, + } ], net_terms=0, ) as response: @@ -507,25 +435,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: "quantity": 1, "start_date": parse_date("2023-09-22"), "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, + } ], net_terms=0, ) @@ -545,25 +455,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No "quantity": 1, "start_date": parse_date("2023-09-22"), "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, + } ], net_terms=0, customer_id="4khy3nwzktxv7", @@ -594,25 +486,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: "quantity": 1, "start_date": parse_date("2023-09-22"), "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, + } ], net_terms=0, ) @@ -636,25 +510,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: "quantity": 1, "start_date": parse_date("2023-09-22"), "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, - { - "end_date": parse_date("2023-09-22"), - "item_id": "4khy3nwzktxv7", - "model_type": "unit", - "name": "Line Item Name", - "quantity": 1, - "start_date": parse_date("2023-09-22"), - "unit_config": {"unit_amount": "unit_amount"}, - }, + } ], net_terms=0, ) as response: diff --git a/tests/test_client.py b/tests/test_client.py index 8b038c1d..9d34c15d 100755 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -766,7 +766,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) - response = client.customers.with_raw_response.create(email="email", name="name") + response = client.customers.with_raw_response.create(email="email", name="x") assert response.retries_taken == failures_before_success @@ -789,7 +789,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) - with client.customers.with_streaming_response.create(email="email", name="name") as response: + with client.customers.with_streaming_response.create(email="email", name="x") as response: assert response.retries_taken == failures_before_success @@ -1531,7 +1531,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) - response = await client.customers.with_raw_response.create(email="email", name="name") + response = await client.customers.with_raw_response.create(email="email", name="x") assert response.retries_taken == failures_before_success @@ -1555,5 +1555,5 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) - async with client.customers.with_streaming_response.create(email="email", name="name") as response: + async with client.customers.with_streaming_response.create(email="email", name="x") as response: assert response.retries_taken == failures_before_success From d8b23bffb4498f42a1a292a7bda23bd7e11c9c21 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 21:45:35 +0000 Subject: [PATCH 2/2] release: 2.9.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/orb/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 64f9ff41..427b8ec4 100755 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.8.0" + ".": "2.9.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 239dacbb..df55ac38 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.9.0 (2024-08-23) + +Full Changelog: [v2.8.0...v2.9.0](https://github.com/orbcorp/orb-python/compare/v2.8.0...v2.9.0) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#362](https://github.com/orbcorp/orb-python/issues/362)) ([b32c5c4](https://github.com/orbcorp/orb-python/commit/b32c5c421b709cc364f9efef136e2c4873bcb1c6)) + ## 2.8.0 (2024-08-22) Full Changelog: [v2.7.0...v2.8.0](https://github.com/orbcorp/orb-python/compare/v2.7.0...v2.8.0) diff --git a/pyproject.toml b/pyproject.toml index ed09549e..f4073a02 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "2.8.0" +version = "2.9.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/orb/_version.py b/src/orb/_version.py index 199d0280..85159688 100755 --- 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__ = "2.8.0" # x-release-please-version +__version__ = "2.9.0" # x-release-please-version