1818 unicode_literals ,
1919)
2020from builtins import *
21+ from past .builtins import basestring
2122
2223from ciscosparkapi .exceptions import ciscosparkapiException
2324from ciscosparkapi .utils import generator_container
@@ -38,7 +39,7 @@ def __init__(self, json):
3839 """Init a new Membership data object from a JSON dictionary or string.
3940
4041 Args:
41- json(dict, str ): Input JSON object.
42+ json(dict, basestring ): Input JSON object.
4243
4344 Raises:
4445 TypeError: If the input object is not a dictionary or string.
@@ -126,10 +127,10 @@ def list(self, roomId=None, personId=None, personEmail=None, max=None):
126127 container.
127128
128129 Args:
129- roomId(str ): List memberships for the room with roomId.
130- personId(str ): Filter results to include only those with
130+ roomId(basestring ): List memberships for the room with roomId.
131+ personId(basestring ): Filter results to include only those with
131132 personId.
132- personEmail(str ): Filter results to include only those
133+ personEmail(basestring ): Filter results to include only those
133134 with personEmail.
134135 max(int): Limits the maximum number of memberships returned from
135136 the Spark service per request.
@@ -147,9 +148,9 @@ def list(self, roomId=None, personId=None, personEmail=None, max=None):
147148
148149 """
149150 # Process args
150- assert roomId is None or isinstance (roomId , str )
151- assert personId is None or isinstance (personId , str )
152- assert personEmail is None or isinstance (personEmail , str )
151+ assert roomId is None or isinstance (roomId , basestring )
152+ assert personId is None or isinstance (personId , basestring )
153+ assert personEmail is None or isinstance (personEmail , basestring )
153154 assert max is None or isinstance (max , int )
154155 params = {}
155156 if roomId :
@@ -180,10 +181,10 @@ def create(self, roomId, personId=None, personEmail=None,
180181 making them a moderator.
181182
182183 Args:
183- roomId(str ): ID of the room to which the person will be
184+ roomId(basestring ): ID of the room to which the person will be
184185 added.
185- personId(str ): ID of the person to be added to the room.
186- personEmail(str ): Email address of the person to be added
186+ personId(basestring ): ID of the person to be added to the room.
187+ personEmail(basestring ): Email address of the person to be added
187188 to the room.
188189 isModerator(bool): If True, adds the person as a moderator for the
189190 room. If False, adds the person as normal member of the room.
@@ -199,9 +200,9 @@ def create(self, roomId, personId=None, personEmail=None,
199200
200201 """
201202 # Process args
202- assert isinstance (roomId , str )
203- assert personId is None or isinstance (personId , str )
204- assert personEmail is None or isinstance (personEmail , str )
203+ assert isinstance (roomId , basestring )
204+ assert personId is None or isinstance (personId , basestring )
205+ assert personEmail is None or isinstance (personEmail , basestring )
205206 assert isModerator is None or isinstance (isModerator , bool )
206207 post_data = {}
207208 post_data ['roomId' ] = roomId
@@ -223,7 +224,7 @@ def get(self, membershipId):
223224 """Get details for a membership by ID.
224225
225226 Args:
226- membershipId(str ): The membershipId of the membership.
227+ membershipId(basestring ): The membershipId of the membership.
227228
228229 Returns:
229230 Membership: With the details of the requested membership.
@@ -234,7 +235,7 @@ def get(self, membershipId):
234235
235236 """
236237 # Process args
237- assert isinstance (membershipId , str )
238+ assert isinstance (membershipId , basestring )
238239 # API request
239240 json_obj = self ._session .get ('memberships/' + membershipId )
240241 # Return a Membership object created from the response JSON data
@@ -244,7 +245,7 @@ def update(self, membershipId, **update_attributes):
244245 """Update details for a membership.
245246
246247 Args:
247- membershipId(str ): The membershipId of the membership to
248+ membershipId(basestring ): The membershipId of the membership to
248249 be updated.
249250 isModerator(bool): If True, sets the person as a moderator for the
250251 room. If False, removes the person as a moderator for the room.
@@ -259,7 +260,7 @@ def update(self, membershipId, **update_attributes):
259260
260261 """
261262 # Process args
262- assert isinstance (membershipId , str )
263+ assert isinstance (membershipId , basestring )
263264 # Process update_attributes keyword arguments
264265 if not update_attributes :
265266 error_message = "At least one **update_attributes keyword " \
@@ -275,7 +276,7 @@ def delete(self, membershipId):
275276 """Delete a membership, by ID.
276277
277278 Args:
278- membershipId(str ): The membershipId of the membership to
279+ membershipId(basestring ): The membershipId of the membership to
279280 be deleted.
280281
281282 Raises:
@@ -284,6 +285,6 @@ def delete(self, membershipId):
284285
285286 """
286287 # Process args
287- assert isinstance (membershipId , str )
288+ assert isinstance (membershipId , basestring )
288289 # API request
289290 self ._session .delete ('memberships/' + membershipId )
0 commit comments