Skip to content

Commit 2425bc0

Browse files
authored
Endpoints: add multi-currency-account (#29)
1 parent 3275fbe commit 2425bc0

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

pywisetransfer/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def add_resources(self) -> None:
77
from pywisetransfer.balance_statements import BalanceStatements
88
from pywisetransfer.balances import Balances
99
from pywisetransfer.borderless_account import BorderlessAccount
10+
from pywisetransfer.multi_currency_account import MultiCurrencyAccount
1011
from pywisetransfer.profile import Profile
1112
from pywisetransfer.subscription import Subscription
1213
from pywisetransfer.user import User
@@ -15,6 +16,7 @@ def add_resources(self) -> None:
1516
self.balance_statements = BalanceStatements(client=self)
1617
self.balances = Balances(client=self)
1718
self.borderless_accounts = BorderlessAccount(client=self)
19+
self.multi_currency_account = MultiCurrencyAccount(client=self)
1820
self.profiles = Profile(client=self)
1921
self.subscriptions = Subscription(client=self)
2022
self.users = User(client=self)
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from typing import Any
2+
3+
from apiron import JsonEndpoint
4+
from munch import munchify
5+
6+
from pywisetransfer import Client
7+
from pywisetransfer.base import Base
8+
9+
10+
class MultiCurrencyAccountService(Base):
11+
available_currencies = JsonEndpoint(
12+
path="/v2/borderless-accounts-configuration/profiles/{profile_id}/available-currencies"
13+
)
14+
get = JsonEndpoint(path="/v4/profiles/{profile_id}/multi-currency-account")
15+
16+
17+
class MultiCurrencyAccount:
18+
def __init__(self, client: Client):
19+
self.service = MultiCurrencyAccountService(client=client)
20+
21+
def available_currencies(self, profile_id: str) -> Any:
22+
return munchify(self.service.available_currencies(profile_id=profile_id))
23+
24+
def get(self, profile_id: str) -> Any:
25+
return munchify(self.service.get(profile_id=profile_id))

0 commit comments

Comments
 (0)