11# coding: utf-8
22
3- from __future__ import unicode_literals
3+ from __future__ import unicode_literals , absolute_import
44import json
55
6- from ..auth import OAuth2
76from ..config import API
87from ..session .box_session import BoxSession
98from ..network .default_network import DefaultNetwork
1615from ..object .group_membership import GroupMembership
1716from ..util .shared_link import get_shared_link_header
1817from ..util .translator import Translator
19- from ..util .url import get_url
2018
2119
2220class Client (object ):
@@ -26,10 +24,6 @@ def __init__(
2624 oauth = None ,
2725 network_layer = None ,
2826 session = None ,
29- client_id = None ,
30- client_secret = None ,
31- store_tokens = None ,
32- ** kwargs
3327 ):
3428 """
3529 :param oauth:
@@ -44,24 +38,9 @@ def __init__(
4438 The session object to use. If None is provided then an instance of :class:`BoxSession` will be used.
4539 :type session:
4640 :class:`BoxSession`
47- :param client_id:
48- Box API key used for identifying the application the user is authenticating with.
49- Ignored if oauth instance is passed into this constructor.
50- :type client_id:
51- `unicode`
52- :param client_secret:
53- Box API secret used for making OAuth2 requests.
54- Ignored if oauth instance is passed into this constructor.
55- :type client_secret:
56- `unicode`
57- :param store_tokens:
58- Optional callback for getting access to tokens for storing them.
59- Ignored if oauth instance is passed into this constructor.
60- :type store_tokens:
61- `callable`
6241 """
6342 network_layer = network_layer or DefaultNetwork ()
64- self ._oauth = oauth or OAuth2 ( client_id , client_secret , store_tokens = store_tokens , ** kwargs )
43+ self ._oauth = oauth
6544 self ._network = network_layer
6645 self ._session = session or BoxSession (oauth = oauth , network_layer = network_layer )
6746
@@ -411,4 +390,4 @@ def get_url(self, endpoint, *args):
411390 `unicode`
412391 """
413392 # pylint:disable=no-self-use
414- return get_url (endpoint , * args )
393+ return self . _session . get_url (endpoint , * args )
0 commit comments