Skip to content

Commit 48d1f64

Browse files
fix(api): naming for sync_payment_methods methods (#612)
fix naming for sync_payment_methods methods (by customer_id and by external_customer_id were swapped)
1 parent 28aac34 commit 48d1f64

File tree

4 files changed

+39
-39
lines changed

4 files changed

+39
-39
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 103
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-95a3d7780935a38e0cf076d4ad2d68bd1a5641bced8398d972db2e92751d364a.yml
33
openapi_spec_hash: 9ebe818c4ad4f2d9c4e473b5192d7544
4-
config_hash: 3dc5bc1df028fc7301fb2ada9846f038
4+
config_hash: 54edf41f0377bc235f622fdaa7405f22

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ Methods:
7676
- <code title="delete /customers/{customer_id}">client.customers.<a href="./src/orb/resources/customers/customers.py">delete</a>(customer_id) -> None</code>
7777
- <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>
7878
- <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>
79-
- <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>
80-
- <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>
79+
- <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</a>(customer_id) -> None</code>
80+
- <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_by_external_customer_id</a>(external_customer_id) -> None</code>
8181
- <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>
8282

8383
## Costs

src/orb/resources/customers/customers.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ def fetch_by_external_id(
742742

743743
def sync_payment_methods_from_gateway(
744744
self,
745-
external_customer_id: str,
745+
customer_id: str,
746746
*,
747747
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
748748
# 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(
771771
772772
idempotency_key: Specify a custom idempotency key for this request
773773
"""
774-
if not external_customer_id:
775-
raise ValueError(
776-
f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}"
777-
)
774+
if not customer_id:
775+
raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
778776
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
779777
return self._post(
780-
f"/customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway",
778+
f"/customers/{customer_id}/sync_payment_methods_from_gateway",
781779
options=make_request_options(
782780
extra_headers=extra_headers,
783781
extra_query=extra_query,
@@ -790,7 +788,7 @@ def sync_payment_methods_from_gateway(
790788

791789
def sync_payment_methods_from_gateway_by_external_customer_id(
792790
self,
793-
customer_id: str,
791+
external_customer_id: str,
794792
*,
795793
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
796794
# 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(
819817
820818
idempotency_key: Specify a custom idempotency key for this request
821819
"""
822-
if not customer_id:
823-
raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
820+
if not external_customer_id:
821+
raise ValueError(
822+
f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}"
823+
)
824824
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
825825
return self._post(
826-
f"/customers/{customer_id}/sync_payment_methods_from_gateway",
826+
f"/customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway",
827827
options=make_request_options(
828828
extra_headers=extra_headers,
829829
extra_query=extra_query,
@@ -1748,7 +1748,7 @@ async def fetch_by_external_id(
17481748

17491749
async def sync_payment_methods_from_gateway(
17501750
self,
1751-
external_customer_id: str,
1751+
customer_id: str,
17521752
*,
17531753
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
17541754
# 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(
17771777
17781778
idempotency_key: Specify a custom idempotency key for this request
17791779
"""
1780-
if not external_customer_id:
1781-
raise ValueError(
1782-
f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}"
1783-
)
1780+
if not customer_id:
1781+
raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
17841782
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
17851783
return await self._post(
1786-
f"/customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway",
1784+
f"/customers/{customer_id}/sync_payment_methods_from_gateway",
17871785
options=make_request_options(
17881786
extra_headers=extra_headers,
17891787
extra_query=extra_query,
@@ -1796,7 +1794,7 @@ async def sync_payment_methods_from_gateway(
17961794

17971795
async def sync_payment_methods_from_gateway_by_external_customer_id(
17981796
self,
1799-
customer_id: str,
1797+
external_customer_id: str,
18001798
*,
18011799
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
18021800
# 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(
18251823
18261824
idempotency_key: Specify a custom idempotency key for this request
18271825
"""
1828-
if not customer_id:
1829-
raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
1826+
if not external_customer_id:
1827+
raise ValueError(
1828+
f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}"
1829+
)
18301830
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
18311831
return await self._post(
1832-
f"/customers/{customer_id}/sync_payment_methods_from_gateway",
1832+
f"/customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway",
18331833
options=make_request_options(
18341834
extra_headers=extra_headers,
18351835
extra_query=extra_query,

tests/api_resources/test_customers.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,14 @@ def test_path_params_fetch_by_external_id(self, client: Orb) -> None:
361361
@parametrize
362362
def test_method_sync_payment_methods_from_gateway(self, client: Orb) -> None:
363363
customer = client.customers.sync_payment_methods_from_gateway(
364-
"external_customer_id",
364+
"customer_id",
365365
)
366366
assert customer is None
367367

368368
@parametrize
369369
def test_raw_response_sync_payment_methods_from_gateway(self, client: Orb) -> None:
370370
response = client.customers.with_raw_response.sync_payment_methods_from_gateway(
371-
"external_customer_id",
371+
"customer_id",
372372
)
373373

374374
assert response.is_closed is True
@@ -379,7 +379,7 @@ def test_raw_response_sync_payment_methods_from_gateway(self, client: Orb) -> No
379379
@parametrize
380380
def test_streaming_response_sync_payment_methods_from_gateway(self, client: Orb) -> None:
381381
with client.customers.with_streaming_response.sync_payment_methods_from_gateway(
382-
"external_customer_id",
382+
"customer_id",
383383
) as response:
384384
assert not response.is_closed
385385
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -391,22 +391,22 @@ def test_streaming_response_sync_payment_methods_from_gateway(self, client: Orb)
391391

392392
@parametrize
393393
def test_path_params_sync_payment_methods_from_gateway(self, client: Orb) -> None:
394-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_customer_id` but received ''"):
394+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `customer_id` but received ''"):
395395
client.customers.with_raw_response.sync_payment_methods_from_gateway(
396396
"",
397397
)
398398

399399
@parametrize
400400
def test_method_sync_payment_methods_from_gateway_by_external_customer_id(self, client: Orb) -> None:
401401
customer = client.customers.sync_payment_methods_from_gateway_by_external_customer_id(
402-
"customer_id",
402+
"external_customer_id",
403403
)
404404
assert customer is None
405405

406406
@parametrize
407407
def test_raw_response_sync_payment_methods_from_gateway_by_external_customer_id(self, client: Orb) -> None:
408408
response = client.customers.with_raw_response.sync_payment_methods_from_gateway_by_external_customer_id(
409-
"customer_id",
409+
"external_customer_id",
410410
)
411411

412412
assert response.is_closed is True
@@ -417,7 +417,7 @@ def test_raw_response_sync_payment_methods_from_gateway_by_external_customer_id(
417417
@parametrize
418418
def test_streaming_response_sync_payment_methods_from_gateway_by_external_customer_id(self, client: Orb) -> None:
419419
with client.customers.with_streaming_response.sync_payment_methods_from_gateway_by_external_customer_id(
420-
"customer_id",
420+
"external_customer_id",
421421
) as response:
422422
assert not response.is_closed
423423
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
429429

430430
@parametrize
431431
def test_path_params_sync_payment_methods_from_gateway_by_external_customer_id(self, client: Orb) -> None:
432-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `customer_id` but received ''"):
432+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_customer_id` but received ''"):
433433
client.customers.with_raw_response.sync_payment_methods_from_gateway_by_external_customer_id(
434434
"",
435435
)
@@ -873,14 +873,14 @@ async def test_path_params_fetch_by_external_id(self, async_client: AsyncOrb) ->
873873
@parametrize
874874
async def test_method_sync_payment_methods_from_gateway(self, async_client: AsyncOrb) -> None:
875875
customer = await async_client.customers.sync_payment_methods_from_gateway(
876-
"external_customer_id",
876+
"customer_id",
877877
)
878878
assert customer is None
879879

880880
@parametrize
881881
async def test_raw_response_sync_payment_methods_from_gateway(self, async_client: AsyncOrb) -> None:
882882
response = await async_client.customers.with_raw_response.sync_payment_methods_from_gateway(
883-
"external_customer_id",
883+
"customer_id",
884884
)
885885

886886
assert response.is_closed is True
@@ -891,7 +891,7 @@ async def test_raw_response_sync_payment_methods_from_gateway(self, async_client
891891
@parametrize
892892
async def test_streaming_response_sync_payment_methods_from_gateway(self, async_client: AsyncOrb) -> None:
893893
async with async_client.customers.with_streaming_response.sync_payment_methods_from_gateway(
894-
"external_customer_id",
894+
"customer_id",
895895
) as response:
896896
assert not response.is_closed
897897
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_
903903

904904
@parametrize
905905
async def test_path_params_sync_payment_methods_from_gateway(self, async_client: AsyncOrb) -> None:
906-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_customer_id` but received ''"):
906+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `customer_id` but received ''"):
907907
await async_client.customers.with_raw_response.sync_payment_methods_from_gateway(
908908
"",
909909
)
@@ -913,7 +913,7 @@ async def test_method_sync_payment_methods_from_gateway_by_external_customer_id(
913913
self, async_client: AsyncOrb
914914
) -> None:
915915
customer = await async_client.customers.sync_payment_methods_from_gateway_by_external_customer_id(
916-
"customer_id",
916+
"external_customer_id",
917917
)
918918
assert customer is None
919919

@@ -923,7 +923,7 @@ async def test_raw_response_sync_payment_methods_from_gateway_by_external_custom
923923
) -> None:
924924
response = (
925925
await async_client.customers.with_raw_response.sync_payment_methods_from_gateway_by_external_customer_id(
926-
"customer_id",
926+
"external_customer_id",
927927
)
928928
)
929929

@@ -938,7 +938,7 @@ async def test_streaming_response_sync_payment_methods_from_gateway_by_external_
938938
) -> None:
939939
async with (
940940
async_client.customers.with_streaming_response.sync_payment_methods_from_gateway_by_external_customer_id(
941-
"customer_id",
941+
"external_customer_id",
942942
)
943943
) as response:
944944
assert not response.is_closed
@@ -953,7 +953,7 @@ async def test_streaming_response_sync_payment_methods_from_gateway_by_external_
953953
async def test_path_params_sync_payment_methods_from_gateway_by_external_customer_id(
954954
self, async_client: AsyncOrb
955955
) -> None:
956-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `customer_id` but received ''"):
956+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_customer_id` but received ''"):
957957
await async_client.customers.with_raw_response.sync_payment_methods_from_gateway_by_external_customer_id(
958958
"",
959959
)

0 commit comments

Comments
 (0)