Skip to content

Commit 8f1b51c

Browse files
feat: Add missing blockchain/stablecoin endpoints to the spec
1 parent 3cdcf9f commit 8f1b51c

4 files changed

Lines changed: 182 additions & 5 deletions

File tree

‎.stats.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 216
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-17e70cd484ec2fc2aca1243462ac8849153dbbe9b9245959ff51681b14f74024.yml
3-
openapi_spec_hash: cc75e169c1c5ddc9ed619de07ee94d70
4-
config_hash: e95c2dda5d175f9316457e0a84e35dce
1+
configured_endpoints: 217
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-c4c2ee9eddaa18ab29ef2d881e7c373d214d167b3eb7a74559f862ce36e95f74.yml
3+
openapi_spec_hash: 3b1897cb075e1f19e2ce33e95781656a
4+
config_hash: b314c3c5c82a483d1a7812b31b1d1fc4

‎api.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ from lithic.types import BlockchainRecipient
702702
Methods:
703703

704704
- <code title="post /v1/blockchain_recipients">client.blockchain_recipients.<a href="./src/lithic/resources/blockchain_recipients.py">create</a>(\*\*<a href="src/lithic/types/blockchain_recipient_create_params.py">params</a>) -> <a href="./src/lithic/types/blockchain_recipient.py">BlockchainRecipient</a></code>
705+
- <code title="get /v1/blockchain_recipients/{blockchain_recipient_token}">client.blockchain_recipients.<a href="./src/lithic/resources/blockchain_recipients.py">retrieve</a>(blockchain_recipient_token) -> <a href="./src/lithic/types/blockchain_recipient.py">BlockchainRecipient</a></code>
705706

706707
# Payments
707708

‎src/lithic/resources/blockchain_recipients.py‎

Lines changed: 97 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .. import _legacy_response
88
from ..types import OwnerType, blockchain_recipient_create_params
99
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
10-
from .._utils import maybe_transform, async_maybe_transform
10+
from .._utils import path_template, maybe_transform, async_maybe_transform
1111
from .._compat import cached_property
1212
from .._resource import SyncAPIResource, AsyncAPIResource
1313
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
@@ -108,6 +108,48 @@ def create(
108108
cast_to=BlockchainRecipient,
109109
)
110110

111+
def retrieve(
112+
self,
113+
blockchain_recipient_token: str,
114+
*,
115+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
116+
# The extra values given here take precedence over values defined on the client or passed to this method.
117+
extra_headers: Headers | None = None,
118+
extra_query: Query | None = None,
119+
extra_body: Body | None = None,
120+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
121+
) -> BlockchainRecipient:
122+
"""
123+
Get a blockchain recipient by token
124+
125+
Use this to poll the `verification_state` after registering an address: a
126+
recipient cannot receive a payout until screening completes and moves it out of
127+
`PENDING`
128+
129+
Args:
130+
extra_headers: Send extra headers
131+
132+
extra_query: Add additional query parameters to the request
133+
134+
extra_body: Add additional JSON properties to the request
135+
136+
timeout: Override the client-level default timeout for this request, in seconds
137+
"""
138+
if not blockchain_recipient_token:
139+
raise ValueError(
140+
f"Expected a non-empty value for `blockchain_recipient_token` but received {blockchain_recipient_token!r}"
141+
)
142+
return self._get(
143+
path_template(
144+
"/v1/blockchain_recipients/{blockchain_recipient_token}",
145+
blockchain_recipient_token=blockchain_recipient_token,
146+
),
147+
options=make_request_options(
148+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
149+
),
150+
cast_to=BlockchainRecipient,
151+
)
152+
111153

112154
class AsyncBlockchainRecipients(AsyncAPIResource):
113155
@cached_property
@@ -199,6 +241,48 @@ async def create(
199241
cast_to=BlockchainRecipient,
200242
)
201243

244+
async def retrieve(
245+
self,
246+
blockchain_recipient_token: str,
247+
*,
248+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
249+
# The extra values given here take precedence over values defined on the client or passed to this method.
250+
extra_headers: Headers | None = None,
251+
extra_query: Query | None = None,
252+
extra_body: Body | None = None,
253+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
254+
) -> BlockchainRecipient:
255+
"""
256+
Get a blockchain recipient by token
257+
258+
Use this to poll the `verification_state` after registering an address: a
259+
recipient cannot receive a payout until screening completes and moves it out of
260+
`PENDING`
261+
262+
Args:
263+
extra_headers: Send extra headers
264+
265+
extra_query: Add additional query parameters to the request
266+
267+
extra_body: Add additional JSON properties to the request
268+
269+
timeout: Override the client-level default timeout for this request, in seconds
270+
"""
271+
if not blockchain_recipient_token:
272+
raise ValueError(
273+
f"Expected a non-empty value for `blockchain_recipient_token` but received {blockchain_recipient_token!r}"
274+
)
275+
return await self._get(
276+
path_template(
277+
"/v1/blockchain_recipients/{blockchain_recipient_token}",
278+
blockchain_recipient_token=blockchain_recipient_token,
279+
),
280+
options=make_request_options(
281+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
282+
),
283+
cast_to=BlockchainRecipient,
284+
)
285+
202286

203287
class BlockchainRecipientsWithRawResponse:
204288
def __init__(self, blockchain_recipients: BlockchainRecipients) -> None:
@@ -207,6 +291,9 @@ def __init__(self, blockchain_recipients: BlockchainRecipients) -> None:
207291
self.create = _legacy_response.to_raw_response_wrapper(
208292
blockchain_recipients.create,
209293
)
294+
self.retrieve = _legacy_response.to_raw_response_wrapper(
295+
blockchain_recipients.retrieve,
296+
)
210297

211298

212299
class AsyncBlockchainRecipientsWithRawResponse:
@@ -216,6 +303,9 @@ def __init__(self, blockchain_recipients: AsyncBlockchainRecipients) -> None:
216303
self.create = _legacy_response.async_to_raw_response_wrapper(
217304
blockchain_recipients.create,
218305
)
306+
self.retrieve = _legacy_response.async_to_raw_response_wrapper(
307+
blockchain_recipients.retrieve,
308+
)
219309

220310

221311
class BlockchainRecipientsWithStreamingResponse:
@@ -225,6 +315,9 @@ def __init__(self, blockchain_recipients: BlockchainRecipients) -> None:
225315
self.create = to_streamed_response_wrapper(
226316
blockchain_recipients.create,
227317
)
318+
self.retrieve = to_streamed_response_wrapper(
319+
blockchain_recipients.retrieve,
320+
)
228321

229322

230323
class AsyncBlockchainRecipientsWithStreamingResponse:
@@ -234,3 +327,6 @@ def __init__(self, blockchain_recipients: AsyncBlockchainRecipients) -> None:
234327
self.create = async_to_streamed_response_wrapper(
235328
blockchain_recipients.create,
236329
)
330+
self.retrieve = async_to_streamed_response_wrapper(
331+
blockchain_recipients.retrieve,
332+
)

‎tests/api_resources/test_blockchain_recipients.py‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,46 @@ def test_streaming_response_create(self, client: Lithic) -> None:
7373

7474
assert cast(Any, response.is_closed) is True
7575

76+
@parametrize
77+
def test_method_retrieve(self, client: Lithic) -> None:
78+
blockchain_recipient = client.blockchain_recipients.retrieve(
79+
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
80+
)
81+
assert_matches_type(BlockchainRecipient, blockchain_recipient, path=["response"])
82+
83+
@parametrize
84+
def test_raw_response_retrieve(self, client: Lithic) -> None:
85+
response = client.blockchain_recipients.with_raw_response.retrieve(
86+
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
87+
)
88+
89+
assert response.is_closed is True
90+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
91+
blockchain_recipient = response.parse()
92+
assert_matches_type(BlockchainRecipient, blockchain_recipient, path=["response"])
93+
94+
@parametrize
95+
def test_streaming_response_retrieve(self, client: Lithic) -> None:
96+
with client.blockchain_recipients.with_streaming_response.retrieve(
97+
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
98+
) as response:
99+
assert not response.is_closed
100+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
101+
102+
blockchain_recipient = response.parse()
103+
assert_matches_type(BlockchainRecipient, blockchain_recipient, path=["response"])
104+
105+
assert cast(Any, response.is_closed) is True
106+
107+
@parametrize
108+
def test_path_params_retrieve(self, client: Lithic) -> None:
109+
with pytest.raises(
110+
ValueError, match=r"Expected a non-empty value for `blockchain_recipient_token` but received ''"
111+
):
112+
client.blockchain_recipients.with_raw_response.retrieve(
113+
"",
114+
)
115+
76116

77117
class TestAsyncBlockchainRecipients:
78118
parametrize = pytest.mark.parametrize(
@@ -134,3 +174,43 @@ async def test_streaming_response_create(self, async_client: AsyncLithic) -> Non
134174
assert_matches_type(BlockchainRecipient, blockchain_recipient, path=["response"])
135175

136176
assert cast(Any, response.is_closed) is True
177+
178+
@parametrize
179+
async def test_method_retrieve(self, async_client: AsyncLithic) -> None:
180+
blockchain_recipient = await async_client.blockchain_recipients.retrieve(
181+
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
182+
)
183+
assert_matches_type(BlockchainRecipient, blockchain_recipient, path=["response"])
184+
185+
@parametrize
186+
async def test_raw_response_retrieve(self, async_client: AsyncLithic) -> None:
187+
response = await async_client.blockchain_recipients.with_raw_response.retrieve(
188+
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
189+
)
190+
191+
assert response.is_closed is True
192+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
193+
blockchain_recipient = response.parse()
194+
assert_matches_type(BlockchainRecipient, blockchain_recipient, path=["response"])
195+
196+
@parametrize
197+
async def test_streaming_response_retrieve(self, async_client: AsyncLithic) -> None:
198+
async with async_client.blockchain_recipients.with_streaming_response.retrieve(
199+
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
200+
) as response:
201+
assert not response.is_closed
202+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
203+
204+
blockchain_recipient = await response.parse()
205+
assert_matches_type(BlockchainRecipient, blockchain_recipient, path=["response"])
206+
207+
assert cast(Any, response.is_closed) is True
208+
209+
@parametrize
210+
async def test_path_params_retrieve(self, async_client: AsyncLithic) -> None:
211+
with pytest.raises(
212+
ValueError, match=r"Expected a non-empty value for `blockchain_recipient_token` but received ''"
213+
):
214+
await async_client.blockchain_recipients.with_raw_response.retrieve(
215+
"",
216+
)

0 commit comments

Comments
 (0)