52
52
from ..._resource import SyncAPIResource , AsyncAPIResource
53
53
from ..._response import to_streamed_response_wrapper , async_to_streamed_response_wrapper
54
54
from ...pagination import SyncCursorPage , AsyncCursorPage
55
+ from ...types .card import Card
55
56
from ..._base_client import AsyncPaginator , _merge_mappings , make_request_options
56
57
from .aggregate_balances import (
57
58
AggregateBalances ,
61
62
AggregateBalancesWithStreamingResponse ,
62
63
AsyncAggregateBalancesWithStreamingResponse ,
63
64
)
65
+ from ...types .non_pci_card import NonPCICard
64
66
from .financial_transactions import (
65
67
FinancialTransactions ,
66
68
AsyncFinancialTransactions ,
70
72
AsyncFinancialTransactionsWithStreamingResponse ,
71
73
)
72
74
from ...types .card_spend_limits import CardSpendLimits
73
- from ...types .card_list_response import CardListResponse
74
- from ...types .card_renew_response import CardRenewResponse
75
- from ...types .card_create_response import CardCreateResponse
76
- from ...types .card_update_response import CardUpdateResponse
77
75
from ...types .spend_limit_duration import SpendLimitDuration
78
- from ...types .card_reissue_response import CardReissueResponse
79
76
from ...types .shared_params .carrier import Carrier
80
- from ...types .card_retrieve_response import CardRetrieveResponse
81
77
from ...types .card_provision_response import CardProvisionResponse
82
- from ...types .card_search_by_pan_response import CardSearchByPanResponse
83
- from ...types .card_convert_physical_response import CardConvertPhysicalResponse
84
78
from ...types .shared_params .shipping_address import ShippingAddress
85
79
86
80
__all__ = ["Cards" , "AsyncCards" ]
@@ -145,7 +139,7 @@ def create(
145
139
extra_query : Query | None = None ,
146
140
extra_body : Body | None = None ,
147
141
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
148
- ) -> CardCreateResponse :
142
+ ) -> Card :
149
143
"""Create a new virtual or physical card.
150
144
151
145
Parameters `shipping_address` and
@@ -289,7 +283,7 @@ def create(
289
283
options = make_request_options (
290
284
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
291
285
),
292
- cast_to = CardCreateResponse ,
286
+ cast_to = Card ,
293
287
)
294
288
295
289
def retrieve (
@@ -302,7 +296,7 @@ def retrieve(
302
296
extra_query : Query | None = None ,
303
297
extra_body : Body | None = None ,
304
298
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
305
- ) -> CardRetrieveResponse :
299
+ ) -> Card :
306
300
"""
307
301
Get card configuration such as spend limit and state.
308
302
@@ -322,7 +316,7 @@ def retrieve(
322
316
options = make_request_options (
323
317
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
324
318
),
325
- cast_to = CardRetrieveResponse ,
319
+ cast_to = Card ,
326
320
)
327
321
328
322
def update (
@@ -342,7 +336,7 @@ def update(
342
336
extra_query : Query | None = None ,
343
337
extra_body : Body | None = None ,
344
338
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
345
- ) -> CardUpdateResponse :
339
+ ) -> Card :
346
340
"""Update the specified properties of the card.
347
341
348
342
Unsupplied properties will remain
@@ -423,7 +417,7 @@ def update(
423
417
options = make_request_options (
424
418
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
425
419
),
426
- cast_to = CardUpdateResponse ,
420
+ cast_to = Card ,
427
421
)
428
422
429
423
def list (
@@ -442,7 +436,7 @@ def list(
442
436
extra_query : Query | None = None ,
443
437
extra_body : Body | None = None ,
444
438
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
445
- ) -> SyncCursorPage [CardListResponse ]:
439
+ ) -> SyncCursorPage [NonPCICard ]:
446
440
"""
447
441
List cards.
448
442
@@ -475,7 +469,7 @@ def list(
475
469
"""
476
470
return self ._get_api_list (
477
471
"/v1/cards" ,
478
- page = SyncCursorPage [CardListResponse ],
472
+ page = SyncCursorPage [NonPCICard ],
479
473
options = make_request_options (
480
474
extra_headers = extra_headers ,
481
475
extra_query = extra_query ,
@@ -494,7 +488,7 @@ def list(
494
488
card_list_params .CardListParams ,
495
489
),
496
490
),
497
- model = CardListResponse ,
491
+ model = NonPCICard ,
498
492
)
499
493
500
494
def convert_physical (
@@ -512,7 +506,7 @@ def convert_physical(
512
506
extra_query : Query | None = None ,
513
507
extra_body : Body | None = None ,
514
508
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
515
- ) -> CardConvertPhysicalResponse :
509
+ ) -> Card :
516
510
"""Convert a virtual card into a physical card and manufacture it.
517
511
518
512
Customer must
@@ -572,7 +566,7 @@ def convert_physical(
572
566
options = make_request_options (
573
567
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
574
568
),
575
- cast_to = CardConvertPhysicalResponse ,
569
+ cast_to = Card ,
576
570
)
577
571
578
572
def embed (
@@ -852,7 +846,7 @@ def reissue(
852
846
extra_query : Query | None = None ,
853
847
extra_body : Body | None = None ,
854
848
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
855
- ) -> CardReissueResponse :
849
+ ) -> Card :
856
850
"""Initiate print and shipment of a duplicate physical card (e.g.
857
851
858
852
card is
@@ -907,7 +901,7 @@ def reissue(
907
901
options = make_request_options (
908
902
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
909
903
),
910
- cast_to = CardReissueResponse ,
904
+ cast_to = Card ,
911
905
)
912
906
913
907
def renew (
@@ -927,7 +921,7 @@ def renew(
927
921
extra_query : Query | None = None ,
928
922
extra_body : Body | None = None ,
929
923
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
930
- ) -> CardRenewResponse :
924
+ ) -> Card :
931
925
"""Applies to card types `PHYSICAL` and `VIRTUAL`.
932
926
933
927
For `PHYSICAL`, creates a new
@@ -994,7 +988,7 @@ def renew(
994
988
options = make_request_options (
995
989
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
996
990
),
997
- cast_to = CardRenewResponse ,
991
+ cast_to = Card ,
998
992
)
999
993
1000
994
def retrieve_spend_limits (
@@ -1043,7 +1037,7 @@ def search_by_pan(
1043
1037
extra_query : Query | None = None ,
1044
1038
extra_body : Body | None = None ,
1045
1039
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
1046
- ) -> CardSearchByPanResponse :
1040
+ ) -> Card :
1047
1041
"""Get card configuration such as spend limit and state.
1048
1042
1049
1043
Customers must be PCI
@@ -1069,7 +1063,7 @@ def search_by_pan(
1069
1063
options = make_request_options (
1070
1064
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
1071
1065
),
1072
- cast_to = CardSearchByPanResponse ,
1066
+ cast_to = Card ,
1073
1067
)
1074
1068
1075
1069
@@ -1132,7 +1126,7 @@ async def create(
1132
1126
extra_query : Query | None = None ,
1133
1127
extra_body : Body | None = None ,
1134
1128
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
1135
- ) -> CardCreateResponse :
1129
+ ) -> Card :
1136
1130
"""Create a new virtual or physical card.
1137
1131
1138
1132
Parameters `shipping_address` and
@@ -1276,7 +1270,7 @@ async def create(
1276
1270
options = make_request_options (
1277
1271
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
1278
1272
),
1279
- cast_to = CardCreateResponse ,
1273
+ cast_to = Card ,
1280
1274
)
1281
1275
1282
1276
async def retrieve (
@@ -1289,7 +1283,7 @@ async def retrieve(
1289
1283
extra_query : Query | None = None ,
1290
1284
extra_body : Body | None = None ,
1291
1285
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
1292
- ) -> CardRetrieveResponse :
1286
+ ) -> Card :
1293
1287
"""
1294
1288
Get card configuration such as spend limit and state.
1295
1289
@@ -1309,7 +1303,7 @@ async def retrieve(
1309
1303
options = make_request_options (
1310
1304
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
1311
1305
),
1312
- cast_to = CardRetrieveResponse ,
1306
+ cast_to = Card ,
1313
1307
)
1314
1308
1315
1309
async def update (
@@ -1329,7 +1323,7 @@ async def update(
1329
1323
extra_query : Query | None = None ,
1330
1324
extra_body : Body | None = None ,
1331
1325
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
1332
- ) -> CardUpdateResponse :
1326
+ ) -> Card :
1333
1327
"""Update the specified properties of the card.
1334
1328
1335
1329
Unsupplied properties will remain
@@ -1410,7 +1404,7 @@ async def update(
1410
1404
options = make_request_options (
1411
1405
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
1412
1406
),
1413
- cast_to = CardUpdateResponse ,
1407
+ cast_to = Card ,
1414
1408
)
1415
1409
1416
1410
def list (
@@ -1429,7 +1423,7 @@ def list(
1429
1423
extra_query : Query | None = None ,
1430
1424
extra_body : Body | None = None ,
1431
1425
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
1432
- ) -> AsyncPaginator [CardListResponse , AsyncCursorPage [CardListResponse ]]:
1426
+ ) -> AsyncPaginator [NonPCICard , AsyncCursorPage [NonPCICard ]]:
1433
1427
"""
1434
1428
List cards.
1435
1429
@@ -1462,7 +1456,7 @@ def list(
1462
1456
"""
1463
1457
return self ._get_api_list (
1464
1458
"/v1/cards" ,
1465
- page = AsyncCursorPage [CardListResponse ],
1459
+ page = AsyncCursorPage [NonPCICard ],
1466
1460
options = make_request_options (
1467
1461
extra_headers = extra_headers ,
1468
1462
extra_query = extra_query ,
@@ -1481,7 +1475,7 @@ def list(
1481
1475
card_list_params .CardListParams ,
1482
1476
),
1483
1477
),
1484
- model = CardListResponse ,
1478
+ model = NonPCICard ,
1485
1479
)
1486
1480
1487
1481
async def convert_physical (
@@ -1499,7 +1493,7 @@ async def convert_physical(
1499
1493
extra_query : Query | None = None ,
1500
1494
extra_body : Body | None = None ,
1501
1495
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
1502
- ) -> CardConvertPhysicalResponse :
1496
+ ) -> Card :
1503
1497
"""Convert a virtual card into a physical card and manufacture it.
1504
1498
1505
1499
Customer must
@@ -1559,7 +1553,7 @@ async def convert_physical(
1559
1553
options = make_request_options (
1560
1554
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
1561
1555
),
1562
- cast_to = CardConvertPhysicalResponse ,
1556
+ cast_to = Card ,
1563
1557
)
1564
1558
1565
1559
async def embed (
@@ -1839,7 +1833,7 @@ async def reissue(
1839
1833
extra_query : Query | None = None ,
1840
1834
extra_body : Body | None = None ,
1841
1835
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
1842
- ) -> CardReissueResponse :
1836
+ ) -> Card :
1843
1837
"""Initiate print and shipment of a duplicate physical card (e.g.
1844
1838
1845
1839
card is
@@ -1894,7 +1888,7 @@ async def reissue(
1894
1888
options = make_request_options (
1895
1889
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
1896
1890
),
1897
- cast_to = CardReissueResponse ,
1891
+ cast_to = Card ,
1898
1892
)
1899
1893
1900
1894
async def renew (
@@ -1914,7 +1908,7 @@ async def renew(
1914
1908
extra_query : Query | None = None ,
1915
1909
extra_body : Body | None = None ,
1916
1910
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
1917
- ) -> CardRenewResponse :
1911
+ ) -> Card :
1918
1912
"""Applies to card types `PHYSICAL` and `VIRTUAL`.
1919
1913
1920
1914
For `PHYSICAL`, creates a new
@@ -1981,7 +1975,7 @@ async def renew(
1981
1975
options = make_request_options (
1982
1976
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
1983
1977
),
1984
- cast_to = CardRenewResponse ,
1978
+ cast_to = Card ,
1985
1979
)
1986
1980
1987
1981
async def retrieve_spend_limits (
@@ -2030,7 +2024,7 @@ async def search_by_pan(
2030
2024
extra_query : Query | None = None ,
2031
2025
extra_body : Body | None = None ,
2032
2026
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
2033
- ) -> CardSearchByPanResponse :
2027
+ ) -> Card :
2034
2028
"""Get card configuration such as spend limit and state.
2035
2029
2036
2030
Customers must be PCI
@@ -2056,7 +2050,7 @@ async def search_by_pan(
2056
2050
options = make_request_options (
2057
2051
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
2058
2052
),
2059
- cast_to = CardSearchByPanResponse ,
2053
+ cast_to = Card ,
2060
2054
)
2061
2055
2062
2056
0 commit comments