1
- import bunq
2
1
from bunq .sdk .context .api_context import ApiContext
3
2
from bunq .sdk .context .user_context import UserContext
4
3
from bunq .sdk .exception .bunq_exception import BunqException
@@ -20,47 +19,34 @@ def __init__(self):
20
19
raise TypeError (self ._ERROR_CLASS_SHOULD_NOT_BE_INITIALIZED )
21
20
22
21
@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 :
24
23
"""
25
24
26
25
:param api_context:
27
- :type api_context: bunq.sdk.context.api_context.ApiContext
28
26
"""
29
27
cls ._api_context = api_context
30
28
cls ._user_context = UserContext (api_context .session_context .user_id )
31
29
cls ._user_context .init_main_monetary_account ()
32
30
33
31
@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 :
40
33
if cls ._api_context is not None :
41
34
return cls ._api_context
42
35
43
36
raise BunqException (cls ._ERROR_API_CONTEXT_HAS_NOT_BEEN_LOADED )
44
37
45
38
@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 :
53
40
if cls ._user_context is not None :
54
41
return cls ._user_context
55
42
56
43
raise BunqException (cls ._ERROR_USER_CONTEXT_HAS_NOT_BEEN_LOADED )
57
44
58
45
@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 :
60
47
"""
61
48
62
49
:param api_context:
63
- :type api_context: bunq.sdk.context.api_context.ApiContext
64
50
"""
65
51
66
52
cls ._api_context = api_context
0 commit comments