Skip to content

Commit 4ffe79d

Browse files
chore(api): add business_account_token param for listing Balances (#625)
1 parent 99ee833 commit 4ffe79d

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/lithic/resources/balances.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def list(
4747
*,
4848
account_token: str | NotGiven = NOT_GIVEN,
4949
balance_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
50+
business_account_token: str | NotGiven = NOT_GIVEN,
5051
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
5152
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5253
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -56,14 +57,16 @@ def list(
5657
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
5758
) -> SyncSinglePage[Balance]:
5859
"""
59-
Get the balances for a program or a given end-user account
60+
Get the balances for a program, business, or a given end-user account
6061
6162
Args:
6263
account_token: List balances for all financial accounts of a given account_token.
6364
6465
balance_date: UTC date and time of the balances to retrieve. Defaults to latest available
6566
balances
6667
68+
business_account_token: List balances for all financial accounts of a given business_account_token.
69+
6770
financial_account_type: List balances for a given Financial Account type.
6871
6972
extra_headers: Send extra headers
@@ -86,6 +89,7 @@ def list(
8689
{
8790
"account_token": account_token,
8891
"balance_date": balance_date,
92+
"business_account_token": business_account_token,
8993
"financial_account_type": financial_account_type,
9094
},
9195
balance_list_params.BalanceListParams,
@@ -120,6 +124,7 @@ def list(
120124
*,
121125
account_token: str | NotGiven = NOT_GIVEN,
122126
balance_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
127+
business_account_token: str | NotGiven = NOT_GIVEN,
123128
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
124129
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
125130
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -129,14 +134,16 @@ def list(
129134
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
130135
) -> AsyncPaginator[Balance, AsyncSinglePage[Balance]]:
131136
"""
132-
Get the balances for a program or a given end-user account
137+
Get the balances for a program, business, or a given end-user account
133138
134139
Args:
135140
account_token: List balances for all financial accounts of a given account_token.
136141
137142
balance_date: UTC date and time of the balances to retrieve. Defaults to latest available
138143
balances
139144
145+
business_account_token: List balances for all financial accounts of a given business_account_token.
146+
140147
financial_account_type: List balances for a given Financial Account type.
141148
142149
extra_headers: Send extra headers
@@ -159,6 +166,7 @@ def list(
159166
{
160167
"account_token": account_token,
161168
"balance_date": balance_date,
169+
"business_account_token": business_account_token,
162170
"financial_account_type": financial_account_type,
163171
},
164172
balance_list_params.BalanceListParams,

src/lithic/types/balance_list_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ class BalanceListParams(TypedDict, total=False):
2121
Defaults to latest available balances
2222
"""
2323

24+
business_account_token: str
25+
"""List balances for all financial accounts of a given business_account_token."""
26+
2427
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"]
2528
"""List balances for a given Financial Account type."""

tests/api_resources/test_balances.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def test_method_list_with_all_params(self, client: Lithic) -> None:
2929
balance = client.balances.list(
3030
account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
3131
balance_date=parse_datetime("2019-12-27T18:11:19.117Z"),
32+
business_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
3233
financial_account_type="ISSUING",
3334
)
3435
assert_matches_type(SyncSinglePage[Balance], balance, path=["response"])
@@ -67,6 +68,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> N
6768
balance = await async_client.balances.list(
6869
account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
6970
balance_date=parse_datetime("2019-12-27T18:11:19.117Z"),
71+
business_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
7072
financial_account_type="ISSUING",
7173
)
7274
assert_matches_type(AsyncSinglePage[Balance], balance, path=["response"])

0 commit comments

Comments
 (0)