diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d6b94479..c766a1b1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.18.1" + ".": "3.18.2" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index f2253470..1e64c91b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 103 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-95a3d7780935a38e0cf076d4ad2d68bd1a5641bced8398d972db2e92751d364a.yml openapi_spec_hash: 9ebe818c4ad4f2d9c4e473b5192d7544 -config_hash: 3dc5bc1df028fc7301fb2ada9846f038 +config_hash: 54edf41f0377bc235f622fdaa7405f22 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e8e1fd1..a915617c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 3.18.2 (2025-04-07) + +Full Changelog: [v3.18.1...v3.18.2](https://github.com/orbcorp/orb-python/compare/v3.18.1...v3.18.2) + +### Bug Fixes + +* **api:** naming for sync_payment_methods methods ([#612](https://github.com/orbcorp/orb-python/issues/612)) ([48d1f64](https://github.com/orbcorp/orb-python/commit/48d1f64569419343f34cc10e14da8b8f98ea368a)) + + +### Chores + +* **internal:** remove trailing character ([#610](https://github.com/orbcorp/orb-python/issues/610)) ([28aac34](https://github.com/orbcorp/orb-python/commit/28aac34bfbb0778e153a70fbac727a508e839a8c)) + ## 3.18.1 (2025-04-02) Full Changelog: [v3.18.0...v3.18.1](https://github.com/orbcorp/orb-python/compare/v3.18.0...v3.18.1) diff --git a/api.md b/api.md index c37afa84..da2a7bc1 100644 --- a/api.md +++ b/api.md @@ -76,8 +76,8 @@ Methods: - client.customers.delete(customer_id) -> None - client.customers.fetch(customer_id) -> Customer - client.customers.fetch_by_external_id(external_customer_id) -> Customer -- client.customers.sync_payment_methods_from_gateway(external_customer_id) -> None -- client.customers.sync_payment_methods_from_gateway_by_external_customer_id(customer_id) -> None +- client.customers.sync_payment_methods_from_gateway(customer_id) -> None +- client.customers.sync_payment_methods_from_gateway_by_external_customer_id(external_customer_id) -> None - client.customers.update_by_external_id(id, \*\*params) -> Customer ## Costs diff --git a/pyproject.toml b/pyproject.toml index a5f1c748..e4fc5098 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "3.18.1" +version = "3.18.2" 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 07d04435..fe3ad45f 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__ = "3.18.1" # x-release-please-version +__version__ = "3.18.2" # x-release-please-version diff --git a/src/orb/resources/customers/customers.py b/src/orb/resources/customers/customers.py index bd33194f..2bfde0fe 100644 --- a/src/orb/resources/customers/customers.py +++ b/src/orb/resources/customers/customers.py @@ -742,7 +742,7 @@ def fetch_by_external_id( def sync_payment_methods_from_gateway( self, - external_customer_id: str, + 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. @@ -771,13 +771,11 @@ def sync_payment_methods_from_gateway( 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}" - ) + 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/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway", + f"/customers/{customer_id}/sync_payment_methods_from_gateway", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -790,7 +788,7 @@ def sync_payment_methods_from_gateway( def sync_payment_methods_from_gateway_by_external_customer_id( self, - customer_id: str, + 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. @@ -819,11 +817,13 @@ def sync_payment_methods_from_gateway_by_external_customer_id( 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}") + 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/{customer_id}/sync_payment_methods_from_gateway", + 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, @@ -1748,7 +1748,7 @@ async def fetch_by_external_id( async def sync_payment_methods_from_gateway( self, - external_customer_id: str, + 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. @@ -1777,13 +1777,11 @@ async def sync_payment_methods_from_gateway( 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}" - ) + 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/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway", + f"/customers/{customer_id}/sync_payment_methods_from_gateway", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1796,7 +1794,7 @@ async def sync_payment_methods_from_gateway( async def sync_payment_methods_from_gateway_by_external_customer_id( self, - customer_id: str, + 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. @@ -1825,11 +1823,13 @@ async def sync_payment_methods_from_gateway_by_external_customer_id( 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}") + 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/{customer_id}/sync_payment_methods_from_gateway", + 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, diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index fe2332c9..a3cb552e 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -361,14 +361,14 @@ def test_path_params_fetch_by_external_id(self, client: Orb) -> None: @parametrize def test_method_sync_payment_methods_from_gateway(self, client: Orb) -> None: customer = client.customers.sync_payment_methods_from_gateway( - "external_customer_id", + "customer_id", ) assert customer is None @parametrize def test_raw_response_sync_payment_methods_from_gateway(self, client: Orb) -> None: response = client.customers.with_raw_response.sync_payment_methods_from_gateway( - "external_customer_id", + "customer_id", ) assert response.is_closed is True @@ -379,7 +379,7 @@ def test_raw_response_sync_payment_methods_from_gateway(self, client: Orb) -> No @parametrize def test_streaming_response_sync_payment_methods_from_gateway(self, client: Orb) -> None: with client.customers.with_streaming_response.sync_payment_methods_from_gateway( - "external_customer_id", + "customer_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -391,7 +391,7 @@ def test_streaming_response_sync_payment_methods_from_gateway(self, client: Orb) @parametrize def test_path_params_sync_payment_methods_from_gateway(self, client: Orb) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_customer_id` but received ''"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `customer_id` but received ''"): client.customers.with_raw_response.sync_payment_methods_from_gateway( "", ) @@ -399,14 +399,14 @@ def test_path_params_sync_payment_methods_from_gateway(self, client: Orb) -> Non @parametrize def test_method_sync_payment_methods_from_gateway_by_external_customer_id(self, client: Orb) -> None: customer = client.customers.sync_payment_methods_from_gateway_by_external_customer_id( - "customer_id", + "external_customer_id", ) assert customer is None @parametrize def test_raw_response_sync_payment_methods_from_gateway_by_external_customer_id(self, client: Orb) -> None: response = client.customers.with_raw_response.sync_payment_methods_from_gateway_by_external_customer_id( - "customer_id", + "external_customer_id", ) assert response.is_closed is True @@ -417,7 +417,7 @@ def test_raw_response_sync_payment_methods_from_gateway_by_external_customer_id( @parametrize def test_streaming_response_sync_payment_methods_from_gateway_by_external_customer_id(self, client: Orb) -> None: with client.customers.with_streaming_response.sync_payment_methods_from_gateway_by_external_customer_id( - "customer_id", + "external_customer_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -429,7 +429,7 @@ def test_streaming_response_sync_payment_methods_from_gateway_by_external_custom @parametrize def test_path_params_sync_payment_methods_from_gateway_by_external_customer_id(self, client: Orb) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `customer_id` but received ''"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_customer_id` but received ''"): client.customers.with_raw_response.sync_payment_methods_from_gateway_by_external_customer_id( "", ) @@ -873,14 +873,14 @@ async def test_path_params_fetch_by_external_id(self, async_client: AsyncOrb) -> @parametrize async def test_method_sync_payment_methods_from_gateway(self, async_client: AsyncOrb) -> None: customer = await async_client.customers.sync_payment_methods_from_gateway( - "external_customer_id", + "customer_id", ) assert customer is None @parametrize async def test_raw_response_sync_payment_methods_from_gateway(self, async_client: AsyncOrb) -> None: response = await async_client.customers.with_raw_response.sync_payment_methods_from_gateway( - "external_customer_id", + "customer_id", ) assert response.is_closed is True @@ -891,7 +891,7 @@ async def test_raw_response_sync_payment_methods_from_gateway(self, async_client @parametrize async def test_streaming_response_sync_payment_methods_from_gateway(self, async_client: AsyncOrb) -> None: async with async_client.customers.with_streaming_response.sync_payment_methods_from_gateway( - "external_customer_id", + "customer_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -903,7 +903,7 @@ async def test_streaming_response_sync_payment_methods_from_gateway(self, async_ @parametrize async def test_path_params_sync_payment_methods_from_gateway(self, async_client: AsyncOrb) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_customer_id` but received ''"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `customer_id` but received ''"): await async_client.customers.with_raw_response.sync_payment_methods_from_gateway( "", ) @@ -913,7 +913,7 @@ async def test_method_sync_payment_methods_from_gateway_by_external_customer_id( self, async_client: AsyncOrb ) -> None: customer = await async_client.customers.sync_payment_methods_from_gateway_by_external_customer_id( - "customer_id", + "external_customer_id", ) assert customer is None @@ -923,7 +923,7 @@ async def test_raw_response_sync_payment_methods_from_gateway_by_external_custom ) -> None: response = ( await async_client.customers.with_raw_response.sync_payment_methods_from_gateway_by_external_customer_id( - "customer_id", + "external_customer_id", ) ) @@ -938,7 +938,7 @@ async def test_streaming_response_sync_payment_methods_from_gateway_by_external_ ) -> None: async with ( async_client.customers.with_streaming_response.sync_payment_methods_from_gateway_by_external_customer_id( - "customer_id", + "external_customer_id", ) ) as response: assert not response.is_closed @@ -953,7 +953,7 @@ async def test_streaming_response_sync_payment_methods_from_gateway_by_external_ async def test_path_params_sync_payment_methods_from_gateway_by_external_customer_id( self, async_client: AsyncOrb ) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `customer_id` but received ''"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_customer_id` but received ''"): await async_client.customers.with_raw_response.sync_payment_methods_from_gateway_by_external_customer_id( "", ) diff --git a/tests/test_client.py b/tests/test_client.py index 621ef788..41b2ec55 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1719,7 +1719,7 @@ def test_get_platform(self) -> None: import threading from orb._utils import asyncify - from orb._base_client import get_platform + from orb._base_client import get_platform async def test_main() -> None: result = await asyncify(get_platform)()