Skip to content

Commit 186f64c

Browse files
committed
feature/python-sdk-refactor Updated bunq_context according to new MR comments. Other classes to follow.
1 parent 2ed259e commit 186f64c

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

bunq/sdk/context/bunq_context.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import bunq
21
from bunq.sdk.context.api_context import ApiContext
32
from bunq.sdk.context.user_context import UserContext
43
from bunq.sdk.exception.bunq_exception import BunqException
@@ -20,47 +19,34 @@ def __init__(self):
2019
raise TypeError(self._ERROR_CLASS_SHOULD_NOT_BE_INITIALIZED)
2120

2221
@classmethod
23-
def load_api_context(cls, api_context: bunq.sdk.context.api_context.ApiContext) -> None:
22+
def load_api_context(cls, api_context: ApiContext) -> None:
2423
"""
2524
2625
:param api_context:
27-
:type api_context: bunq.sdk.context.api_context.ApiContext
2826
"""
2927
cls._api_context = api_context
3028
cls._user_context = UserContext(api_context.session_context.user_id)
3129
cls._user_context.init_main_monetary_account()
3230

3331
@classmethod
34-
def api_context(cls) -> bunq.sdk.context.api_context.ApiContext:
35-
"""
36-
37-
:return:
38-
:rtype: bunq.sdk.context.api_context.ApiContext
39-
"""
32+
def api_context(cls) -> ApiContext:
4033
if cls._api_context is not None:
4134
return cls._api_context
4235

4336
raise BunqException(cls._ERROR_API_CONTEXT_HAS_NOT_BEEN_LOADED)
4437

4538
@classmethod
46-
def user_context(cls) -> bunq.sdk.context.user_context.UserContext:
47-
"""
48-
49-
:return:
50-
:rtype: bunq.sdk.context.user_context.UserContext
51-
"""
52-
39+
def user_context(cls) -> UserContext:
5340
if cls._user_context is not None:
5441
return cls._user_context
5542

5643
raise BunqException(cls._ERROR_USER_CONTEXT_HAS_NOT_BEEN_LOADED)
5744

5845
@classmethod
59-
def update_api_context(cls, api_context: bunq.sdk.context.api_context.ApiContext) -> None:
46+
def update_api_context(cls, api_context: ApiContext) -> None:
6047
"""
6148
6249
:param api_context:
63-
:type api_context: bunq.sdk.context.api_context.ApiContext
6450
"""
6551

6652
cls._api_context = api_context

0 commit comments

Comments
 (0)