Skip to content

Commit 13fd9bb

Browse files
committed
Add support for account_ids in ListTransactionParams
1 parent 0897d34 commit 13fd9bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

unit/models/transaction.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,14 +571,15 @@ def to_json_api(self) -> Dict:
571571

572572

573573
class ListTransactionParams(UnitParams):
574-
def __init__(self, limit: int = 100, offset: int = 0, account_id: Optional[str] = None,
574+
def __init__(self, limit: int = 100, offset: int = 0, account_id: Optional[str] = None, account_ids: Optional[List[str]],
575575
customer_id: Optional[str] = None, query: Optional[str] = None, tags: Optional[Dict[str, str]] = None,
576576
since: Optional[str] = None, until: Optional[str] = None, card_id: Optional[str] = None,
577577
type: Optional[List[str]] = None, exclude_fees: Optional[bool] = None,
578578
sort: Optional[Literal["createdAt", "-createdAt"]] = None, include: Optional[str] = None):
579579
self.limit = limit
580580
self.offset = offset
581581
self.account_id = account_id
582+
self.account_ids = account_ids
582583
self.customer_id = customer_id
583584
self.query = query
584585
self.tags = tags
@@ -596,6 +597,9 @@ def to_dict(self) -> Dict:
596597
parameters["filter[customerId]"] = self.customer_id
597598
if self.account_id:
598599
parameters["filter[accountId]"] = self.account_id
600+
if self.account_ids:
601+
for idx, account_id in enumerate(self.account_ids):
602+
parameters[f"filter[accountIds][{idx}]"] = account_id
599603
if self.query:
600604
parameters["filter[query]"] = self.query
601605
if self.tags:

0 commit comments

Comments
 (0)