airwallex-sdk 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airwallex/api/base.py +75 -171
- airwallex/api/beneficiary.py +12 -12
- airwallex/api/issuing_transaction.py +1 -40
- {airwallex_sdk-0.1.0.dist-info → airwallex_sdk-0.1.1.dist-info}/METADATA +1 -1
- {airwallex_sdk-0.1.0.dist-info → airwallex_sdk-0.1.1.dist-info}/RECORD +6 -6
- {airwallex_sdk-0.1.0.dist-info → airwallex_sdk-0.1.1.dist-info}/WHEEL +0 -0
airwallex/api/base.py
CHANGED
@@ -19,18 +19,9 @@ from typing import (
|
|
19
19
|
get_args,
|
20
20
|
get_origin
|
21
21
|
)
|
22
|
-
import httpx
|
23
22
|
|
24
|
-
from ..models.base import AirwallexModel
|
25
|
-
from ..utils import snake_to_pascal_case
|
26
|
-
from ..exceptions import (
|
27
|
-
AirwallexAPIError,
|
28
|
-
AuthenticationError,
|
29
|
-
RateLimitError,
|
30
|
-
ResourceNotFoundError,
|
31
|
-
ValidationError,
|
32
|
-
ServerError
|
33
|
-
)
|
23
|
+
from ..models.base import AirwallexModel
|
24
|
+
from ..utils import snake_to_pascal_case
|
34
25
|
|
35
26
|
logger = logging.getLogger(__name__)
|
36
27
|
|
@@ -89,7 +80,7 @@ class AirwallexAPIBase(Generic[T]):
|
|
89
80
|
:param dataframe: If True, return a DataFrame instead of a list of dictionaries.
|
90
81
|
"""
|
91
82
|
url = self._build_url(resource_id=self.id, suffix=path_item)
|
92
|
-
if not self.client.__class__.__name__.startswith('Async'):
|
83
|
+
if not str(self.client.__class__.__name__).startswith('Async'):
|
93
84
|
response = self.client._request("GET", url, params=kwargs)
|
94
85
|
data = self._parse_response_data(response.json())
|
95
86
|
return data
|
@@ -118,12 +109,12 @@ class AirwallexAPIBase(Generic[T]):
|
|
118
109
|
For async clients, returns a coroutine that yields an AsyncGenerator[T, None].
|
119
110
|
"""
|
120
111
|
if resource_id is not None:
|
121
|
-
if not self.client.__class__.__name__.startswith('Async'):
|
112
|
+
if not str(self.client.__class__.__name__).startswith('Async'):
|
122
113
|
return self.fetch(resource_id)
|
123
114
|
else:
|
124
115
|
return self.fetch_async(resource_id)
|
125
116
|
else:
|
126
|
-
if not self.client.__class__.__name__.startswith('Async'):
|
117
|
+
if not str(self.client.__class__.__name__).startswith('Async'):
|
127
118
|
return self.paginate_generator(**kwargs)
|
128
119
|
else:
|
129
120
|
return self.paginate_async_generator(**kwargs)
|
@@ -195,7 +186,7 @@ class AirwallexAPIBase(Generic[T]):
|
|
195
186
|
|
196
187
|
def fetch(self, resource_id: Any) -> T:
|
197
188
|
"""Fetch a single resource by ID."""
|
198
|
-
if self.client.__class__.__name__.startswith('Async'):
|
189
|
+
if str(self.client.__class__.__name__).startswith('Async'):
|
199
190
|
raise ValueError("This method requires a sync client.")
|
200
191
|
url = self._build_url(resource_id)
|
201
192
|
response = self.client._request("GET", url)
|
@@ -207,10 +198,10 @@ class AirwallexAPIBase(Generic[T]):
|
|
207
198
|
|
208
199
|
def list(self, **params: Any) -> List[T]:
|
209
200
|
"""List resources with optional filtering parameters."""
|
210
|
-
if self.client.__class__.__name__.startswith('Async'):
|
201
|
+
if str(self.client.__class__.__name__).startswith('Async'):
|
211
202
|
raise ValueError("This method requires a sync client.")
|
212
203
|
url = self._build_url()
|
213
|
-
response = self.client._request("GET", url, params=
|
204
|
+
response = self.client._request("GET", url, params=params)
|
214
205
|
data_list = self._parse_response_data(response.json())
|
215
206
|
return [self.model_class.from_api_response(item) for item in data_list]
|
216
207
|
|
@@ -219,11 +210,10 @@ class AirwallexAPIBase(Generic[T]):
|
|
219
210
|
if str(self.client.__class__.__name__).startswith('Async'):
|
220
211
|
raise ValueError("This method requires a sync client.")
|
221
212
|
|
213
|
+
payload_dict = payload
|
222
214
|
# Convert Pydantic model to dict if needed
|
223
215
|
if isinstance(payload, AirwallexModel):
|
224
216
|
payload_dict = payload.to_api_dict()
|
225
|
-
else:
|
226
|
-
payload_dict = serialize(payload)
|
227
217
|
|
228
218
|
url = self._build_url()
|
229
219
|
response = self.client._request("POST", url, json=payload_dict)
|
@@ -235,14 +225,13 @@ class AirwallexAPIBase(Generic[T]):
|
|
235
225
|
|
236
226
|
def update(self, resource_id: Any, payload: Union[Dict[str, Any], T]) -> T:
|
237
227
|
"""Update an existing resource."""
|
238
|
-
if self.client.__class__.__name__.startswith('Async'):
|
228
|
+
if str(self.client.__class__.__name__).startswith('Async'):
|
239
229
|
raise ValueError("This method requires a sync client.")
|
240
|
-
|
230
|
+
|
231
|
+
payload_dict = payload
|
241
232
|
# Convert Pydantic model to dict if needed
|
242
233
|
if isinstance(payload, AirwallexModel):
|
243
234
|
payload_dict = payload.to_api_dict()
|
244
|
-
else:
|
245
|
-
payload_dict = serialize(payload)
|
246
235
|
|
247
236
|
url = self._build_url(resource_id)
|
248
237
|
response = self.client._request("PUT", url, json=payload_dict)
|
@@ -254,96 +243,55 @@ class AirwallexAPIBase(Generic[T]):
|
|
254
243
|
|
255
244
|
def delete(self, resource_id: Any) -> None:
|
256
245
|
"""Delete a resource."""
|
257
|
-
if self.client.__class__.__name__.startswith('Async'):
|
246
|
+
if str(self.client.__class__.__name__).startswith('Async'):
|
258
247
|
raise ValueError("This method requires a sync client.")
|
259
248
|
url = self._build_url(resource_id)
|
260
249
|
self.client._request("DELETE", url)
|
261
|
-
|
262
|
-
def paginate(self, **params: Any) ->
|
263
|
-
"""
|
250
|
+
|
251
|
+
def paginate(self, stop_page: Optional[int] = None, **params: Any) -> Generator[T, None, None]:
|
252
|
+
"""
|
253
|
+
Generate items one by one from paginated results.
|
254
|
+
|
255
|
+
Args:
|
256
|
+
stop_page: The page number to stop at (optional).
|
257
|
+
**params: Filter parameters to pass to the API.
|
258
|
+
|
259
|
+
Yields:
|
260
|
+
T: Each item from the paginated results.
|
261
|
+
"""
|
264
262
|
if str(self.client.__class__.__name__).startswith('Async'):
|
265
263
|
raise ValueError("This method requires a sync client.")
|
266
264
|
|
267
|
-
|
268
|
-
page = params.get("page", 1)
|
265
|
+
page_num = params.get("page_num", 1)
|
269
266
|
page_size = params.get("page_size", 100)
|
270
267
|
|
271
268
|
while True:
|
272
|
-
params["
|
269
|
+
params["page_num"] = page_num
|
273
270
|
params["page_size"] = page_size
|
274
271
|
url = self._build_url()
|
275
|
-
response = self.client._request("GET", url, params=
|
276
|
-
|
272
|
+
response = self.client._request("GET", url, params=params)
|
273
|
+
data = response.json()
|
277
274
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
if not items:
|
284
|
-
break
|
285
|
-
|
286
|
-
all_items.extend(items)
|
275
|
+
items = data.get("items", [])
|
276
|
+
has_more = data.get("has_more", False)
|
277
|
+
|
278
|
+
for item in items:
|
279
|
+
yield self.model_class.from_api_response(item)
|
287
280
|
|
288
|
-
|
289
|
-
break
|
290
|
-
|
291
|
-
page += 1
|
292
|
-
else:
|
293
|
-
# Not paginated, just use the data as is
|
294
|
-
page_data = self._parse_response_data(response_data)
|
295
|
-
if not page_data:
|
296
|
-
break
|
297
|
-
all_items.extend(page_data)
|
281
|
+
if not has_more or not items:
|
298
282
|
break
|
299
283
|
|
300
|
-
|
301
|
-
|
302
|
-
def paginate_generator(self, **params: Any) -> Generator[T, None, None]:
|
303
|
-
"""Generate items one by one from paginated results."""
|
304
|
-
if self.client.__class__.__name__.startswith('Async'):
|
305
|
-
raise ValueError("This method requires a sync client.")
|
284
|
+
page_num += 1
|
306
285
|
|
307
|
-
|
308
|
-
page_size = params.get("page_size", 100)
|
309
|
-
|
310
|
-
while True:
|
311
|
-
params["page"] = page
|
312
|
-
params["page_size"] = page_size
|
313
|
-
url = self._build_url()
|
314
|
-
response = self.client._request("GET", url, params=serialize(params))
|
315
|
-
response_data = response.json()
|
316
|
-
|
317
|
-
# Check if response is paginated
|
318
|
-
if isinstance(response_data, dict) and 'items' in response_data:
|
319
|
-
items = response_data['items']
|
320
|
-
total_pages = response_data.get('total_pages', 1)
|
321
|
-
|
322
|
-
if not items:
|
323
|
-
break
|
324
|
-
|
325
|
-
for item in items:
|
326
|
-
yield self.model_class.from_api_response(item)
|
327
|
-
|
328
|
-
if page >= total_pages:
|
329
|
-
break
|
330
|
-
|
331
|
-
page += 1
|
332
|
-
else:
|
333
|
-
# Not paginated, just use the data as is
|
334
|
-
page_data = self._parse_response_data(response_data)
|
335
|
-
if not page_data:
|
336
|
-
break
|
337
|
-
|
338
|
-
for item in page_data:
|
339
|
-
yield self.model_class.from_api_response(item)
|
286
|
+
if stop_page and page_num > stop_page:
|
340
287
|
break
|
341
|
-
|
288
|
+
|
289
|
+
|
342
290
|
# Asynchronous API methods
|
343
291
|
|
344
292
|
async def fetch_async(self, resource_id: Any) -> T:
|
345
293
|
"""Fetch a single resource by ID asynchronously."""
|
346
|
-
if not self.client.__class__.__name__.startswith('Async'):
|
294
|
+
if not str(self.client.__class__.__name__).startswith('Async'):
|
347
295
|
raise ValueError("This method requires an async client.")
|
348
296
|
url = self._build_url(resource_id)
|
349
297
|
response = await self.client._request("GET", url)
|
@@ -355,23 +303,22 @@ class AirwallexAPIBase(Generic[T]):
|
|
355
303
|
|
356
304
|
async def list_async(self, **params: Any) -> List[T]:
|
357
305
|
"""List resources with optional filtering parameters asynchronously."""
|
358
|
-
if not self.client.__class__.__name__.startswith('Async'):
|
306
|
+
if not str(self.client.__class__.__name__).startswith('Async'):
|
359
307
|
raise ValueError("This method requires an async client.")
|
360
308
|
url = self._build_url()
|
361
|
-
response = await self.client._request("GET", url, params=
|
309
|
+
response = await self.client._request("GET", url, params=params)
|
362
310
|
data_list = self._parse_response_data(response.json())
|
363
311
|
return [self.model_class.from_api_response(item) for item in data_list]
|
364
312
|
|
365
313
|
async def create_async(self, payload: Union[Dict[str, Any], T]) -> T:
|
366
314
|
"""Create a new resource asynchronously."""
|
367
|
-
if not self.client.__class__.__name__.startswith('Async'):
|
315
|
+
if not str(self.client.__class__.__name__).startswith('Async'):
|
368
316
|
raise ValueError("This method requires an async client.")
|
369
|
-
|
317
|
+
|
318
|
+
payload_dict = payload
|
370
319
|
# Convert Pydantic model to dict if needed
|
371
320
|
if isinstance(payload, AirwallexModel):
|
372
321
|
payload_dict = payload.to_api_dict()
|
373
|
-
else:
|
374
|
-
payload_dict = serialize(payload)
|
375
322
|
|
376
323
|
url = self._build_url()
|
377
324
|
response = await self.client._request("POST", url, json=payload_dict)
|
@@ -383,14 +330,13 @@ class AirwallexAPIBase(Generic[T]):
|
|
383
330
|
|
384
331
|
async def update_async(self, resource_id: Any, payload: Union[Dict[str, Any], T]) -> T:
|
385
332
|
"""Update an existing resource asynchronously."""
|
386
|
-
if not self.client.__class__.__name__.startswith('Async'):
|
333
|
+
if not str(self.client.__class__.__name__).startswith('Async'):
|
387
334
|
raise ValueError("This method requires an async client.")
|
388
|
-
|
335
|
+
|
336
|
+
payload_dict = payload
|
389
337
|
# Convert Pydantic model to dict if needed
|
390
338
|
if isinstance(payload, AirwallexModel):
|
391
339
|
payload_dict = payload.to_api_dict()
|
392
|
-
else:
|
393
|
-
payload_dict = serialize(payload)
|
394
340
|
|
395
341
|
url = self._build_url(resource_id)
|
396
342
|
response = await self.client._request("PUT", url, json=payload_dict)
|
@@ -402,87 +348,45 @@ class AirwallexAPIBase(Generic[T]):
|
|
402
348
|
|
403
349
|
async def delete_async(self, resource_id: Any) -> None:
|
404
350
|
"""Delete a resource asynchronously."""
|
405
|
-
if not self.client.__class__.__name__.startswith('Async'):
|
351
|
+
if not str(self.client.__class__.__name__).startswith('Async'):
|
406
352
|
raise ValueError("This method requires an async client.")
|
407
353
|
url = self._build_url(resource_id)
|
408
354
|
await self.client._request("DELETE", url)
|
409
|
-
|
410
|
-
async def paginate_async(self, **params: Any) ->
|
411
|
-
"""
|
412
|
-
|
413
|
-
raise ValueError("This method requires an async client.")
|
414
|
-
|
415
|
-
all_items: List[Dict[str, Any]] = []
|
416
|
-
page = params.get("page", 1)
|
417
|
-
page_size = params.get("page_size", 100)
|
355
|
+
|
356
|
+
async def paginate_async(self, stop_page: Optional[int] = None, **params: Any) -> AsyncGenerator[T, None]:
|
357
|
+
"""
|
358
|
+
Generate items one by one from paginated results, asynchronously.
|
418
359
|
|
419
|
-
|
420
|
-
|
421
|
-
params
|
422
|
-
url = self._build_url()
|
423
|
-
response = await self.client._request("GET", url, params=serialize(params))
|
424
|
-
response_data = response.json()
|
360
|
+
Args:
|
361
|
+
stop_page: The page number to stop at (optional).
|
362
|
+
**params: Filter parameters to pass to the API.
|
425
363
|
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
if not items:
|
432
|
-
break
|
433
|
-
|
434
|
-
all_items.extend(items)
|
435
|
-
|
436
|
-
if page >= total_pages:
|
437
|
-
break
|
438
|
-
|
439
|
-
page += 1
|
440
|
-
else:
|
441
|
-
# Not paginated, just use the data as is
|
442
|
-
page_data = self._parse_response_data(response_data)
|
443
|
-
if not page_data:
|
444
|
-
break
|
445
|
-
all_items.extend(page_data)
|
446
|
-
break
|
447
|
-
|
448
|
-
return [self.model_class.from_api_response(item) for item in all_items]
|
449
|
-
|
450
|
-
async def paginate_async_generator(self, **params: Any) -> AsyncGenerator[T, None]:
|
451
|
-
"""Generate items one by one from paginated results asynchronously."""
|
452
|
-
if not self.client.__class__.__name__.startswith('Async'):
|
364
|
+
Yields:
|
365
|
+
T: Each item from the paginated results.
|
366
|
+
"""
|
367
|
+
if not str(self.client.__class__.__name__).startswith('Async'):
|
453
368
|
raise ValueError("This method requires an async client.")
|
454
369
|
|
455
|
-
|
370
|
+
page_num = params.get("page_num", 1)
|
456
371
|
page_size = params.get("page_size", 100)
|
457
372
|
|
458
373
|
while True:
|
459
|
-
params["
|
374
|
+
params["page_num"] = page_num
|
460
375
|
params["page_size"] = page_size
|
461
376
|
url = self._build_url()
|
462
|
-
response = await self.client._request("GET", url, params=
|
463
|
-
|
377
|
+
response = await self.client._request("GET", url, params=params)
|
378
|
+
data = response.json()
|
464
379
|
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
if not items:
|
471
|
-
break
|
472
|
-
|
473
|
-
for item in items:
|
474
|
-
yield self.model_class.from_api_response(item)
|
380
|
+
items = data.get("items", [])
|
381
|
+
has_more = data.get("has_more", False)
|
382
|
+
|
383
|
+
for item in items:
|
384
|
+
yield self.model_class.from_api_response(item)
|
475
385
|
|
476
|
-
|
477
|
-
break
|
478
|
-
|
479
|
-
page += 1
|
480
|
-
else:
|
481
|
-
# Not paginated, just use the data as is
|
482
|
-
page_data = self._parse_response_data(response_data)
|
483
|
-
if not page_data:
|
484
|
-
break
|
485
|
-
|
486
|
-
for item in page_data:
|
487
|
-
yield self.model_class.from_api_response(item)
|
386
|
+
if not has_more or not items:
|
488
387
|
break
|
388
|
+
|
389
|
+
page_num += 1
|
390
|
+
|
391
|
+
if stop_page and page_num > stop_page:
|
392
|
+
break
|
airwallex/api/beneficiary.py
CHANGED
@@ -2,22 +2,22 @@
|
|
2
2
|
Airwallex Beneficiary API.
|
3
3
|
"""
|
4
4
|
from typing import Dict, Any, List, Optional, Type, TypeVar, Union, cast
|
5
|
-
from ..models.beneficiary import Beneficiary, BeneficiaryCreateRequest, BeneficiaryUpdateRequest
|
5
|
+
from ..models.beneficiary import Beneficiary as BeneficiaryModel, BeneficiaryCreateRequest, BeneficiaryUpdateRequest
|
6
6
|
from .base import AirwallexAPIBase
|
7
7
|
|
8
|
-
T = TypeVar("T", bound=
|
8
|
+
T = TypeVar("T", bound=BeneficiaryModel)
|
9
9
|
|
10
10
|
|
11
|
-
class Beneficiary(AirwallexAPIBase[
|
11
|
+
class Beneficiary(AirwallexAPIBase[BeneficiaryModel]):
|
12
12
|
"""
|
13
13
|
Operations for Airwallex beneficiaries.
|
14
14
|
|
15
15
|
Beneficiaries represent recipients of payments.
|
16
16
|
"""
|
17
17
|
endpoint = "beneficiaries"
|
18
|
-
model_class = cast(Type[
|
18
|
+
model_class = cast(Type[BeneficiaryModel], BeneficiaryModel)
|
19
19
|
|
20
|
-
def create_from_model(self, beneficiary: BeneficiaryCreateRequest) ->
|
20
|
+
def create_from_model(self, beneficiary: BeneficiaryCreateRequest) -> BeneficiaryModel:
|
21
21
|
"""
|
22
22
|
Create a new beneficiary using a Pydantic model.
|
23
23
|
|
@@ -29,7 +29,7 @@ class Beneficiary(AirwallexAPIBase[Beneficiary]):
|
|
29
29
|
"""
|
30
30
|
return self.create(beneficiary)
|
31
31
|
|
32
|
-
async def create_from_model_async(self, beneficiary: BeneficiaryCreateRequest) ->
|
32
|
+
async def create_from_model_async(self, beneficiary: BeneficiaryCreateRequest) -> BeneficiaryModel:
|
33
33
|
"""
|
34
34
|
Create a new beneficiary using a Pydantic model asynchronously.
|
35
35
|
|
@@ -41,7 +41,7 @@ class Beneficiary(AirwallexAPIBase[Beneficiary]):
|
|
41
41
|
"""
|
42
42
|
return await self.create_async(beneficiary)
|
43
43
|
|
44
|
-
def update_from_model(self, beneficiary_id: str, beneficiary: BeneficiaryUpdateRequest) ->
|
44
|
+
def update_from_model(self, beneficiary_id: str, beneficiary: BeneficiaryUpdateRequest) -> BeneficiaryModel:
|
45
45
|
"""
|
46
46
|
Update a beneficiary using a Pydantic model.
|
47
47
|
|
@@ -54,7 +54,7 @@ class Beneficiary(AirwallexAPIBase[Beneficiary]):
|
|
54
54
|
"""
|
55
55
|
return self.update(beneficiary_id, beneficiary)
|
56
56
|
|
57
|
-
async def update_from_model_async(self, beneficiary_id: str, beneficiary: BeneficiaryUpdateRequest) ->
|
57
|
+
async def update_from_model_async(self, beneficiary_id: str, beneficiary: BeneficiaryUpdateRequest) -> BeneficiaryModel:
|
58
58
|
"""
|
59
59
|
Update a beneficiary using a Pydantic model asynchronously.
|
60
60
|
|
@@ -103,7 +103,7 @@ class Beneficiary(AirwallexAPIBase[Beneficiary]):
|
|
103
103
|
else:
|
104
104
|
raise ValueError("Use validate for sync clients")
|
105
105
|
|
106
|
-
def deactivate(self, beneficiary_id: str) ->
|
106
|
+
def deactivate(self, beneficiary_id: str) -> BeneficiaryModel:
|
107
107
|
"""
|
108
108
|
Deactivate a beneficiary.
|
109
109
|
|
@@ -116,7 +116,7 @@ class Beneficiary(AirwallexAPIBase[Beneficiary]):
|
|
116
116
|
update_request = BeneficiaryUpdateRequest(status="disabled")
|
117
117
|
return self.update(beneficiary_id, update_request)
|
118
118
|
|
119
|
-
async def deactivate_async(self, beneficiary_id: str) ->
|
119
|
+
async def deactivate_async(self, beneficiary_id: str) -> BeneficiaryModel:
|
120
120
|
"""
|
121
121
|
Deactivate a beneficiary asynchronously.
|
122
122
|
|
@@ -129,7 +129,7 @@ class Beneficiary(AirwallexAPIBase[Beneficiary]):
|
|
129
129
|
update_request = BeneficiaryUpdateRequest(status="disabled")
|
130
130
|
return await self.update_async(beneficiary_id, update_request)
|
131
131
|
|
132
|
-
def activate(self, beneficiary_id: str) ->
|
132
|
+
def activate(self, beneficiary_id: str) -> BeneficiaryModel:
|
133
133
|
"""
|
134
134
|
Activate a beneficiary.
|
135
135
|
|
@@ -142,7 +142,7 @@ class Beneficiary(AirwallexAPIBase[Beneficiary]):
|
|
142
142
|
update_request = BeneficiaryUpdateRequest(status="active")
|
143
143
|
return self.update(beneficiary_id, update_request)
|
144
144
|
|
145
|
-
async def activate_async(self, beneficiary_id: str) ->
|
145
|
+
async def activate_async(self, beneficiary_id: str) -> BeneficiaryModel:
|
146
146
|
"""
|
147
147
|
Activate a beneficiary asynchronously.
|
148
148
|
|
@@ -189,43 +189,4 @@ class IssuingTransaction(AirwallexAPIBase[Transaction]):
|
|
189
189
|
|
190
190
|
page_num += 1
|
191
191
|
|
192
|
-
return [self.model_class.from_api_response(item) for item in all_items]
|
193
|
-
|
194
|
-
async def paginate_async(self, **params: Any) -> List[Transaction]:
|
195
|
-
"""
|
196
|
-
Fetch all pages of transactions asynchronously.
|
197
|
-
|
198
|
-
Args:
|
199
|
-
**params: Filter parameters to pass to the API
|
200
|
-
|
201
|
-
Returns:
|
202
|
-
List[Transaction]: All transactions matching the filters
|
203
|
-
"""
|
204
|
-
if not self.client.__class__.__name__.startswith('Async'):
|
205
|
-
raise ValueError("This method requires an async client.")
|
206
|
-
|
207
|
-
all_items: List[Dict[str, Any]] = []
|
208
|
-
page_num = params.get("page_num", 0)
|
209
|
-
page_size = params.get("page_size", 10)
|
210
|
-
|
211
|
-
while True:
|
212
|
-
params["page_num"] = page_num
|
213
|
-
params["page_size"] = page_size
|
214
|
-
|
215
|
-
response = await self.client._request("GET", self._build_url(), params=params)
|
216
|
-
data = response.json()
|
217
|
-
|
218
|
-
items = data.get("items", [])
|
219
|
-
has_more = data.get("has_more", False)
|
220
|
-
|
221
|
-
if not items:
|
222
|
-
break
|
223
|
-
|
224
|
-
all_items.extend(items)
|
225
|
-
|
226
|
-
if not has_more:
|
227
|
-
break
|
228
|
-
|
229
|
-
page_num += 1
|
230
|
-
|
231
|
-
return [self.model_class.from_api_response(item) for item in all_items]
|
192
|
+
return [self.model_class.from_api_response(item) for item in all_items]
|
@@ -2,8 +2,8 @@ airwallex/__init__.py,sha256=u37jsOHa_cPHZWNV2w5BIq65HPWimCCmMGeoCbJbzgQ,2389
|
|
2
2
|
airwallex/api/__init__.py,sha256=1T54Z3An7kgBNxHMhkQFv6jk2dnaT9OKL79MytcGhtg,1042
|
3
3
|
airwallex/api/account.py,sha256=kdIBXNoeAYl0p1gD6Oz1nCuQn1v6E_ESJfYxPwD5sF4,3760
|
4
4
|
airwallex/api/account_detail.py,sha256=XRrWlUm99jEhh4clqlJr3uCs6Awd2ZhXsr4h89A3eyc,17885
|
5
|
-
airwallex/api/base.py,sha256=
|
6
|
-
airwallex/api/beneficiary.py,sha256=
|
5
|
+
airwallex/api/base.py,sha256=RMz1QER61CtOWs7-g0xeoDebu0-YOSUI_ozKgYh5Q0U,16293
|
6
|
+
airwallex/api/beneficiary.py,sha256=IRrivxCiP4gJQRN27RAjOhzHTHcf_g4Kvz1LtrvnHok,5660
|
7
7
|
airwallex/api/financial_transaction.py,sha256=6INPjTwLO99LL2ph0uVHcPSpIJ5Qyc4xW38KXrIq8TQ,4137
|
8
8
|
airwallex/api/invoice.py,sha256=JZSSqhqG5I2pATOlplvuRs70uW8JUYRU-Po08O3SW90,9488
|
9
9
|
airwallex/api/issuing_authorization.py,sha256=PSbf4MMalI7u3-xb6GGHzi2o9nh9xWTGyexgtPDvfQo,11297
|
@@ -11,7 +11,7 @@ airwallex/api/issuing_card.py,sha256=1SX1mMpeOsaKyICDtzuPO_E-3hwD5J0Fhai1nJuggEo
|
|
11
11
|
airwallex/api/issuing_cardholder.py,sha256=JmblwrNN8dstzYr6Yie8FRGNuw5zcsLKu5eqJtZ4C3k,8422
|
12
12
|
airwallex/api/issuing_config.py,sha256=P_C_4hskUnwCpoxKro36xG3O6AN5Ena7dz-_NHgogPc,3015
|
13
13
|
airwallex/api/issuing_digital_wallet_token.py,sha256=CIEn15rsONkofChpOtZ_pAQnmHFwVaYlm_NF_wH3Fnk,9447
|
14
|
-
airwallex/api/issuing_transaction.py,sha256=
|
14
|
+
airwallex/api/issuing_transaction.py,sha256=EppsT0LaZ4WTRqrbB337QALAjwu58iMOh7XB_izxVSo,7173
|
15
15
|
airwallex/api/issuing_transaction_dispute.py,sha256=C7rJO5LHSwq5mjsMCZlEqjWquxbZxGWFuNLBJrlpMZ8,13244
|
16
16
|
airwallex/api/payment.py,sha256=JfQJWwtvJpmYCzdLL4Sn5_FbFyd7ruez0zE5maRy_kU,5214
|
17
17
|
airwallex/client.py,sha256=21EjrBsXpdWWpvMvRz1OBpYpxiCOzlpWyRri5zm3pJM,14924
|
@@ -34,6 +34,6 @@ airwallex/models/issuing_transaction.py,sha256=SPprY12C6sLV5-fZqExzzFV3l6Llh-A93
|
|
34
34
|
airwallex/models/issuing_transaction_dispute.py,sha256=OR78VtO9a5_C3FYyVrwH6UVsvW5ptym5SeDokWgoP4w,3062
|
35
35
|
airwallex/models/payment.py,sha256=Yxr2w8sesAEko7BccHR3Qwz5hly1OLfctzU3V-3levU,4393
|
36
36
|
airwallex/utils.py,sha256=qKiA1e7g-RcUs7yXpaYsUgcxoeYjCoGvytFohYwPV-Q,3685
|
37
|
-
airwallex_sdk-0.1.
|
38
|
-
airwallex_sdk-0.1.
|
39
|
-
airwallex_sdk-0.1.
|
37
|
+
airwallex_sdk-0.1.1.dist-info/METADATA,sha256=Mz8REwz85RmSHo2BPzTEM1lXBbOZ1R-O2-3Eztk1UEo,5600
|
38
|
+
airwallex_sdk-0.1.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
39
|
+
airwallex_sdk-0.1.1.dist-info/RECORD,,
|
File without changes
|