|
17 | 17 | external_bank_account_update_params, |
18 | 18 | external_bank_account_retry_prenote_params, |
19 | 19 | external_bank_account_retry_micro_deposits_params, |
| 20 | + external_bank_account_set_verification_method_params, |
20 | 21 | ) |
21 | 22 | from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given |
22 | 23 | from ..._utils import path_template, required_args, maybe_transform, async_maybe_transform |
@@ -644,6 +645,60 @@ def retry_prenote( |
644 | 645 | cast_to=ExternalBankAccount, |
645 | 646 | ) |
646 | 647 |
|
| 648 | + def set_verification_method( |
| 649 | + self, |
| 650 | + external_bank_account_token: str, |
| 651 | + *, |
| 652 | + verification_method: Literal["MICRO_DEPOSIT", "PRENOTE", "EXTERNALLY_VERIFIED"], |
| 653 | + financial_account_token: str | Omit = omit, |
| 654 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 655 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 656 | + extra_headers: Headers | None = None, |
| 657 | + extra_query: Query | None = None, |
| 658 | + extra_body: Body | None = None, |
| 659 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 660 | + ) -> ExternalBankAccount: |
| 661 | + """Update the verification method for an external bank account. |
| 662 | +
|
| 663 | + Verification method |
| 664 | + can only be updated if the `verification_state` is `PENDING`. |
| 665 | +
|
| 666 | + Args: |
| 667 | + verification_method: The verification method to set for the external bank account |
| 668 | +
|
| 669 | + financial_account_token: The financial account token of the operating account to fund the micro deposits. |
| 670 | + Required when verification_method is MICRO_DEPOSIT or PRENOTE. |
| 671 | +
|
| 672 | + extra_headers: Send extra headers |
| 673 | +
|
| 674 | + extra_query: Add additional query parameters to the request |
| 675 | +
|
| 676 | + extra_body: Add additional JSON properties to the request |
| 677 | +
|
| 678 | + timeout: Override the client-level default timeout for this request, in seconds |
| 679 | + """ |
| 680 | + if not external_bank_account_token: |
| 681 | + raise ValueError( |
| 682 | + f"Expected a non-empty value for `external_bank_account_token` but received {external_bank_account_token!r}" |
| 683 | + ) |
| 684 | + return self._post( |
| 685 | + path_template( |
| 686 | + "/v1/external_bank_accounts/{external_bank_account_token}/set_verification_method", |
| 687 | + external_bank_account_token=external_bank_account_token, |
| 688 | + ), |
| 689 | + body=maybe_transform( |
| 690 | + { |
| 691 | + "verification_method": verification_method, |
| 692 | + "financial_account_token": financial_account_token, |
| 693 | + }, |
| 694 | + external_bank_account_set_verification_method_params.ExternalBankAccountSetVerificationMethodParams, |
| 695 | + ), |
| 696 | + options=make_request_options( |
| 697 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 698 | + ), |
| 699 | + cast_to=ExternalBankAccount, |
| 700 | + ) |
| 701 | + |
647 | 702 | def unpause( |
648 | 703 | self, |
649 | 704 | external_bank_account_token: str, |
@@ -1281,6 +1336,60 @@ async def retry_prenote( |
1281 | 1336 | cast_to=ExternalBankAccount, |
1282 | 1337 | ) |
1283 | 1338 |
|
| 1339 | + async def set_verification_method( |
| 1340 | + self, |
| 1341 | + external_bank_account_token: str, |
| 1342 | + *, |
| 1343 | + verification_method: Literal["MICRO_DEPOSIT", "PRENOTE", "EXTERNALLY_VERIFIED"], |
| 1344 | + financial_account_token: str | Omit = omit, |
| 1345 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1346 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1347 | + extra_headers: Headers | None = None, |
| 1348 | + extra_query: Query | None = None, |
| 1349 | + extra_body: Body | None = None, |
| 1350 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1351 | + ) -> ExternalBankAccount: |
| 1352 | + """Update the verification method for an external bank account. |
| 1353 | +
|
| 1354 | + Verification method |
| 1355 | + can only be updated if the `verification_state` is `PENDING`. |
| 1356 | +
|
| 1357 | + Args: |
| 1358 | + verification_method: The verification method to set for the external bank account |
| 1359 | +
|
| 1360 | + financial_account_token: The financial account token of the operating account to fund the micro deposits. |
| 1361 | + Required when verification_method is MICRO_DEPOSIT or PRENOTE. |
| 1362 | +
|
| 1363 | + extra_headers: Send extra headers |
| 1364 | +
|
| 1365 | + extra_query: Add additional query parameters to the request |
| 1366 | +
|
| 1367 | + extra_body: Add additional JSON properties to the request |
| 1368 | +
|
| 1369 | + timeout: Override the client-level default timeout for this request, in seconds |
| 1370 | + """ |
| 1371 | + if not external_bank_account_token: |
| 1372 | + raise ValueError( |
| 1373 | + f"Expected a non-empty value for `external_bank_account_token` but received {external_bank_account_token!r}" |
| 1374 | + ) |
| 1375 | + return await self._post( |
| 1376 | + path_template( |
| 1377 | + "/v1/external_bank_accounts/{external_bank_account_token}/set_verification_method", |
| 1378 | + external_bank_account_token=external_bank_account_token, |
| 1379 | + ), |
| 1380 | + body=await async_maybe_transform( |
| 1381 | + { |
| 1382 | + "verification_method": verification_method, |
| 1383 | + "financial_account_token": financial_account_token, |
| 1384 | + }, |
| 1385 | + external_bank_account_set_verification_method_params.ExternalBankAccountSetVerificationMethodParams, |
| 1386 | + ), |
| 1387 | + options=make_request_options( |
| 1388 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 1389 | + ), |
| 1390 | + cast_to=ExternalBankAccount, |
| 1391 | + ) |
| 1392 | + |
1284 | 1393 | async def unpause( |
1285 | 1394 | self, |
1286 | 1395 | external_bank_account_token: str, |
@@ -1342,6 +1451,9 @@ def __init__(self, external_bank_accounts: ExternalBankAccounts) -> None: |
1342 | 1451 | self.retry_prenote = _legacy_response.to_raw_response_wrapper( |
1343 | 1452 | external_bank_accounts.retry_prenote, |
1344 | 1453 | ) |
| 1454 | + self.set_verification_method = _legacy_response.to_raw_response_wrapper( |
| 1455 | + external_bank_accounts.set_verification_method, |
| 1456 | + ) |
1345 | 1457 | self.unpause = _legacy_response.to_raw_response_wrapper( |
1346 | 1458 | external_bank_accounts.unpause, |
1347 | 1459 | ) |
@@ -1373,6 +1485,9 @@ def __init__(self, external_bank_accounts: AsyncExternalBankAccounts) -> None: |
1373 | 1485 | self.retry_prenote = _legacy_response.async_to_raw_response_wrapper( |
1374 | 1486 | external_bank_accounts.retry_prenote, |
1375 | 1487 | ) |
| 1488 | + self.set_verification_method = _legacy_response.async_to_raw_response_wrapper( |
| 1489 | + external_bank_accounts.set_verification_method, |
| 1490 | + ) |
1376 | 1491 | self.unpause = _legacy_response.async_to_raw_response_wrapper( |
1377 | 1492 | external_bank_accounts.unpause, |
1378 | 1493 | ) |
@@ -1404,6 +1519,9 @@ def __init__(self, external_bank_accounts: ExternalBankAccounts) -> None: |
1404 | 1519 | self.retry_prenote = to_streamed_response_wrapper( |
1405 | 1520 | external_bank_accounts.retry_prenote, |
1406 | 1521 | ) |
| 1522 | + self.set_verification_method = to_streamed_response_wrapper( |
| 1523 | + external_bank_accounts.set_verification_method, |
| 1524 | + ) |
1407 | 1525 | self.unpause = to_streamed_response_wrapper( |
1408 | 1526 | external_bank_accounts.unpause, |
1409 | 1527 | ) |
@@ -1435,6 +1553,9 @@ def __init__(self, external_bank_accounts: AsyncExternalBankAccounts) -> None: |
1435 | 1553 | self.retry_prenote = async_to_streamed_response_wrapper( |
1436 | 1554 | external_bank_accounts.retry_prenote, |
1437 | 1555 | ) |
| 1556 | + self.set_verification_method = async_to_streamed_response_wrapper( |
| 1557 | + external_bank_accounts.set_verification_method, |
| 1558 | + ) |
1438 | 1559 | self.unpause = async_to_streamed_response_wrapper( |
1439 | 1560 | external_bank_accounts.unpause, |
1440 | 1561 | ) |
|
0 commit comments