@@ -102,14 +102,15 @@ def list(self, max=None, **query_params):
102
102
103
103
By default, lists rooms to which the authenticated user belongs.
104
104
105
- This method supports Cisco Spark's implmentation of RFC5988 Web Linking
106
- to provide pagination support. It returns a generator container that
107
- incrementally yield all rooms returned by the query. The generator
108
- will automatically request additional 'pages' of responses from Spark
109
- as needed until all responses have been returned. The container makes
110
- the generator safe for reuse. A new API call will be made, using the
111
- same parameters that were specified when the generator was created,
112
- every time a new iterator is requested from the container.
105
+ This method supports Cisco Spark's implementation of RFC5988 Web
106
+ Linking to provide pagination support. It returns a generator
107
+ container that incrementally yield all rooms returned by the
108
+ query. The generator will automatically request additional 'pages' of
109
+ responses from Spark as needed until all responses have been returned.
110
+ The container makes the generator safe for reuse. A new API call will
111
+ be made, using the same parameters that were specified when the
112
+ generator was created, every time a new iterator is requested from the
113
+ container.
113
114
114
115
Args:
115
116
max(int): Limits the maximum number of rooms returned from the
@@ -132,11 +133,13 @@ def list(self, max=None, **query_params):
132
133
# Process args
133
134
assert max is None or isinstance (max , int )
134
135
params = {}
135
- if max : params [u'max' ] = max
136
+ if max :
137
+ params [u'max' ] = max
136
138
# Process query_param keyword arguments
137
139
if query_params :
138
140
for param , value in query_params .items ():
139
- if isinstance (value , basestring ): value = utf8 (value )
141
+ if isinstance (value , basestring ):
142
+ value = utf8 (value )
140
143
params [utf8 (param )] = value
141
144
# API request - get items
142
145
items = self .session .get_items ('rooms' , params = params )
@@ -164,10 +167,11 @@ def create(self, title, teamId=None):
164
167
assert teamId is None or isinstance (teamId , basestring )
165
168
post_data = {}
166
169
post_data [u'title' ] = utf8 (title )
167
- if teamId : post_data [u'teamId' ] = utf8 (teamId )
170
+ if teamId :
171
+ post_data [u'teamId' ] = utf8 (teamId )
168
172
# API request
169
173
json_obj = self .session .post ('rooms' , json = post_data )
170
- # Return a Person object created from the response JSON data
174
+ # Return a Room object created from the response JSON data
171
175
return Room (json_obj )
172
176
173
177
def get (self , roomId ):
@@ -185,7 +189,7 @@ def get(self, roomId):
185
189
assert isinstance (roomId , basestring )
186
190
# API request
187
191
json_obj = self .session .get ('rooms/' + roomId )
188
- # Return a Person object created from the response JSON data
192
+ # Return a Room object created from the response JSON data
189
193
return Room (json_obj )
190
194
191
195
def update (self , roomId , ** update_attributes ):
@@ -215,11 +219,12 @@ def update(self, roomId, **update_attributes):
215
219
raise ciscosparkapiException (error_message )
216
220
put_data = {}
217
221
for param , value in update_attributes .items ():
218
- if isinstance (value , basestring ): value = utf8 (value )
222
+ if isinstance (value , basestring ):
223
+ value = utf8 (value )
219
224
put_data [utf8 (param )] = value
220
225
# API request
221
226
json_obj = self .session .post ('rooms' , json = put_data )
222
- # Return a Person object created from the response JSON data
227
+ # Return a Room object created from the response JSON data
223
228
return Room (json_obj )
224
229
225
230
def delete (self , roomId ):
0 commit comments