Skip to content

Commit

Permalink
chore(api): add business_account_token param for listing Balances (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 11, 2024
1 parent d067e5e commit 7513850
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lithic/resources/balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def list(
*,
account_token: str | NotGiven = NOT_GIVEN,
balance_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
business_account_token: str | NotGiven = NOT_GIVEN,
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -56,14 +57,16 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[Balance]:
"""
Get the balances for a program or a given end-user account
Get the balances for a program, business, or a given end-user account
Args:
account_token: List balances for all financial accounts of a given account_token.
balance_date: UTC date and time of the balances to retrieve. Defaults to latest available
balances
business_account_token: List balances for all financial accounts of a given business_account_token.
financial_account_type: List balances for a given Financial Account type.
extra_headers: Send extra headers
Expand All @@ -86,6 +89,7 @@ def list(
{
"account_token": account_token,
"balance_date": balance_date,
"business_account_token": business_account_token,
"financial_account_type": financial_account_type,
},
balance_list_params.BalanceListParams,
Expand Down Expand Up @@ -120,6 +124,7 @@ def list(
*,
account_token: str | NotGiven = NOT_GIVEN,
balance_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
business_account_token: str | NotGiven = NOT_GIVEN,
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -129,14 +134,16 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[Balance, AsyncSinglePage[Balance]]:
"""
Get the balances for a program or a given end-user account
Get the balances for a program, business, or a given end-user account
Args:
account_token: List balances for all financial accounts of a given account_token.
balance_date: UTC date and time of the balances to retrieve. Defaults to latest available
balances
business_account_token: List balances for all financial accounts of a given business_account_token.
financial_account_type: List balances for a given Financial Account type.
extra_headers: Send extra headers
Expand All @@ -159,6 +166,7 @@ def list(
{
"account_token": account_token,
"balance_date": balance_date,
"business_account_token": business_account_token,
"financial_account_type": financial_account_type,
},
balance_list_params.BalanceListParams,
Expand Down
3 changes: 3 additions & 0 deletions src/lithic/types/balance_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ class BalanceListParams(TypedDict, total=False):
Defaults to latest available balances
"""

business_account_token: str
"""List balances for all financial accounts of a given business_account_token."""

financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"]
"""List balances for a given Financial Account type."""
2 changes: 2 additions & 0 deletions tests/api_resources/test_balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def test_method_list_with_all_params(self, client: Lithic) -> None:
balance = client.balances.list(
account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
balance_date=parse_datetime("2019-12-27T18:11:19.117Z"),
business_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
financial_account_type="ISSUING",
)
assert_matches_type(SyncSinglePage[Balance], balance, path=["response"])
Expand Down Expand Up @@ -67,6 +68,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> N
balance = await async_client.balances.list(
account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
balance_date=parse_datetime("2019-12-27T18:11:19.117Z"),
business_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
financial_account_type="ISSUING",
)
assert_matches_type(AsyncSinglePage[Balance], balance, path=["response"])
Expand Down

0 comments on commit 7513850

Please sign in to comment.