77from .. import _legacy_response
88from ..types import OwnerType , blockchain_recipient_create_params
99from .._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
1111from .._compat import cached_property
1212from .._resource import SyncAPIResource , AsyncAPIResource
1313from .._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
112154class 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
203287class 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
212299class 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
221311class 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
230323class 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+ )
0 commit comments