Skip to content

Commit 6a748e4

Browse files
committed
Consistency Update - people.py
1 parent d90c6f9 commit 6a748e4

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

ciscosparkapi/api/people.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
from builtins import *
2020
from past.builtins import basestring
2121

22+
from ciscosparkapi.restsession import RestSession
23+
from ciscosparkapi.sparkdata import SparkData
2224
from ciscosparkapi.utils import (
2325
check_type,
2426
dict_from_items_with_values,
2527
generator_container,
2628
)
27-
from ciscosparkapi.restsession import RestSession
28-
from ciscosparkapi.sparkdata import SparkData
2929

3030

3131
__author__ = "Chris Lunsford"
@@ -177,8 +177,8 @@ def list(self, email=None, displayName=None, id=None, orgId=None, max=None,
177177
id(basestring): List people by ID. Accepts up to 85 person IDs
178178
separated by commas.
179179
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.
182182
**request_parameters: Additional request parameters (provides
183183
support for parameters that may be added in the future).
184184
@@ -271,6 +271,28 @@ def create(self, emails, displayName=None, firstName=None, lastName=None,
271271
# Return a Person object created from the returned JSON object
272272
return Person(json_data)
273273

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+
274296
def update(self, personId, emails=None, displayName=None, firstName=None,
275297
lastName=None, avatar=None, orgId=None, roles=None,
276298
licenses=None, **request_parameters):
@@ -286,7 +308,7 @@ def update(self, personId, emails=None, displayName=None, firstName=None,
286308
unchanged values.
287309
288310
Args:
289-
personId(basestring): The 'id' of the person to be updated.
311+
personId(basestring): The person ID.
290312
emails(list): Email address(es) of the person (list of strings).
291313
displayName(basestring): Full name of the person.
292314
firstName(basestring): First name of the person.
@@ -337,28 +359,6 @@ def update(self, personId, emails=None, displayName=None, firstName=None,
337359
# Return a Person object created from the returned JSON object
338360
return Person(json_data)
339361

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-
362362
def delete(self, personId):
363363
"""Remove a person from the system.
364364

0 commit comments

Comments
 (0)