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