@@ -100,21 +100,48 @@ def group(self, group_id):
100100 """
101101 return Group (session = self ._session , object_id = group_id )
102102
103- def users (self ):
103+ def users (self , limit = None , offset = 0 , filter_term = None ):
104104 """
105105 Get a list of all users for the Enterprise along with their user_id, public_name, and login.
106106
107+ :param limit:
108+ The maximum number of users to return. If not specified, the Box API will determine an appropriate limit.
109+ :type limit:
110+ `int` or None
111+ :param offset:
112+ The user index at which to start the response.
113+ :type offset:
114+ `int`
115+ :param filter_term:
116+ Filters the results to only users starting with the filter_term in either the name or the login.
117+ :type filter_term:
118+ `unicode` or None
107119 :return:
108120 The list of all users in the enterprise.
109121 :rtype:
110122 `list` of :class:`User`
111123 """
112124 url = '{0}/users' .format (API .BASE_API_URL )
113- box_response = self ._session .get (url )
125+ params = dict (offset = offset )
126+ if limit is not None :
127+ params ['limit' ] = limit
128+ if filter_term is not None :
129+ params ['filter_term' ] = filter_term
130+ box_response = self ._session .get (url , params = params )
114131 response = box_response .json ()
115132 return [User (self ._session , item ['id' ], item ) for item in response ['entries' ]]
116133
117- def search (self , query , limit , offset , ancestor_folders = None , file_extensions = None , metadata_filters = None , result_type = None , content_types = None ):
134+ def search (
135+ self ,
136+ query ,
137+ limit ,
138+ offset ,
139+ ancestor_folders = None ,
140+ file_extensions = None ,
141+ metadata_filters = None ,
142+ result_type = None ,
143+ content_types = None
144+ ):
118145 """
119146 Search Box for items matching the given query.
120147
@@ -155,14 +182,16 @@ def search(self, query, limit, offset, ancestor_folders=None, file_extensions=No
155182 :rtype:
156183 `list` of :class:`Item`
157184 """
158- return Search (self ._session ).search (query = query ,
159- limit = limit ,
160- offset = offset ,
161- ancestor_folders = ancestor_folders ,
162- file_extensions = file_extensions ,
163- metadata_filters = metadata_filters ,
164- result_type = result_type ,
165- content_types = content_types )
185+ return Search (self ._session ).search (
186+ query = query ,
187+ limit = limit ,
188+ offset = offset ,
189+ ancestor_folders = ancestor_folders ,
190+ file_extensions = file_extensions ,
191+ metadata_filters = metadata_filters ,
192+ result_type = result_type ,
193+ content_types = content_types ,
194+ )
166195
167196 def events (self ):
168197 """
@@ -333,5 +362,8 @@ def with_shared_link(self, shared_link, shared_link_password):
333362
334363
335364class DeveloperTokenClient (Client ):
365+ """
366+ Box client subclass which authorizes with a developer token.
367+ """
336368 def __init__ (self , oauth = None , network_layer = None , session = None ):
337369 super (DeveloperTokenClient , self ).__init__ (oauth or DeveloperTokenAuth (), network_layer , session )
0 commit comments