Skip to content

Commit b0030b1

Browse files
committed
Update comments and docstrings
1 parent d407716 commit b0030b1

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

ciscosparkapi/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ def __init__(self, access_token, base_url=None, timeout=None):
1313
session_args = {}
1414
if base_url: session_args['base_url'] = base_url
1515
if timeout: session_args['timeout'] = timeout
16-
# Create API session
16+
# Create API session - All of the API calls associated with a
17+
# CiscoSparkAPI object will leverage a single RESTful 'session'
18+
# connecting to the Cisco Spark cloud.
1719
self.session = RestSession(access_token, **session_args)
1820
# Setup Spark API wrappers
1921
self.rooms = RoomsAPI(self.session)

ciscosparkapi/api/rooms.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Spark - Rooms API - wrapper classes."""
1+
"""Cisco Spark rooms API wrapper classes."""
22

33

44
from ciscosparkapi.exceptions import ciscosparkapiException
@@ -8,7 +8,7 @@
88

99

1010
class Room(SparkData):
11-
"""Spark Room-object wrapper class."""
11+
"""Spark room-object wrapper class."""
1212

1313
def __init__(self, json):
1414
super(Room, self).__init__(json)
@@ -39,11 +39,18 @@ def created(self):
3939

4040
@property
4141
def teamId(self):
42+
"""Return the room teamId, if it exists, otherwise return None.
43+
44+
teamId is an 'optional' attribute that only exists for Spark rooms that
45+
are associated with a Spark Team. To simplify use, rather than
46+
requiring use of try/catch statements or hasattr() calls, we simply
47+
return None if a room does not have a teamId attribute.
48+
"""
4249
return self._json.get(u'teamId', None)
4350

4451

4552
class RoomsAPI(object):
46-
"""Spark Rooms API request wrapper."""
53+
"""Cisco Spark rooms API request wrapper class."""
4754

4855
def __init__(self, session):
4956
assert isinstance(session, RestSession)

0 commit comments

Comments
 (0)