19
19
from builtins import *
20
20
from past .builtins import basestring
21
21
22
+ from ciscosparkapi .restsession import RestSession
23
+ from ciscosparkapi .sparkdata import SparkData
22
24
from ciscosparkapi .utils import (
23
25
check_type ,
24
26
dict_from_items_with_values ,
25
27
generator_container ,
26
28
)
27
- from ciscosparkapi .restsession import RestSession
28
- from ciscosparkapi .sparkdata import SparkData
29
29
30
30
31
31
__author__ = "Chris Lunsford"
@@ -177,8 +177,8 @@ def list(self, email=None, displayName=None, id=None, orgId=None, max=None,
177
177
id(basestring): List people by ID. Accepts up to 85 person IDs
178
178
separated by commas.
179
179
orgId(basestring): The organization id.
180
- max(int): Limits the maximum number of people returned from the
181
- Spark service per request.
180
+ max(int): Limit the maximum number of items returned from the Spark
181
+ service per request.
182
182
**request_parameters: Additional request parameters (provides
183
183
support for parameters that may be added in the future).
184
184
@@ -271,6 +271,28 @@ def create(self, emails, displayName=None, firstName=None, lastName=None,
271
271
# Return a Person object created from the returned JSON object
272
272
return Person (json_data )
273
273
274
+ def get (self , personId ):
275
+ """Get a person's details, by ID.
276
+
277
+ Args:
278
+ personId(basestring): The ID of the person to be retrieved.
279
+
280
+ Returns:
281
+ Person: A Person object with the details of the requested person.
282
+
283
+ Raises:
284
+ TypeError: If the parameter types are incorrect.
285
+ SparkApiError: If the Cisco Spark cloud returns an error.
286
+
287
+ """
288
+ check_type (personId , basestring , may_be_none = False )
289
+
290
+ # API request
291
+ json_data = self ._session .get ('people/' + personId )
292
+
293
+ # Return a Person object created from the response JSON data
294
+ return Person (json_data )
295
+
274
296
def update (self , personId , emails = None , displayName = None , firstName = None ,
275
297
lastName = None , avatar = None , orgId = None , roles = None ,
276
298
licenses = None , ** request_parameters ):
@@ -286,7 +308,7 @@ def update(self, personId, emails=None, displayName=None, firstName=None,
286
308
unchanged values.
287
309
288
310
Args:
289
- personId(basestring): The 'id' of the person to be updated .
311
+ personId(basestring): The person ID .
290
312
emails(list): Email address(es) of the person (list of strings).
291
313
displayName(basestring): Full name of the person.
292
314
firstName(basestring): First name of the person.
@@ -337,28 +359,6 @@ def update(self, personId, emails=None, displayName=None, firstName=None,
337
359
# Return a Person object created from the returned JSON object
338
360
return Person (json_data )
339
361
340
- def get (self , personId ):
341
- """Get a person's details, by ID.
342
-
343
- Args:
344
- personId(basestring): The ID of the person to be retrieved.
345
-
346
- Returns:
347
- Person: A Person object with the details of the requested person.
348
-
349
- Raises:
350
- TypeError: If the parameter types are incorrect.
351
- SparkApiError: If the Cisco Spark cloud returns an error.
352
-
353
- """
354
- check_type (personId , basestring , may_be_none = False )
355
-
356
- # API request
357
- json_data = self ._session .get ('people/' + personId )
358
-
359
- # Return a Person object created from the response JSON data
360
- return Person (json_data )
361
-
362
362
def delete (self , personId ):
363
363
"""Remove a person from the system.
364
364
0 commit comments