1010"""
1111
1212
13- from builtins import object
14- from six import string_types
13+ # Use future for Python v2 and v3 compatibility
14+ from __future__ import (
15+ absolute_import ,
16+ division ,
17+ print_function ,
18+ unicode_literals ,
19+ )
20+ from builtins import *
1521
1622from ciscosparkapi .exceptions import ciscosparkapiException
1723from ciscosparkapi .utils import generator_container
@@ -32,7 +38,7 @@ def __init__(self, json):
3238 """Init a new Membership data object from a JSON dictionary or string.
3339
3440 Args:
35- json(dict, string_types ): Input JSON object.
41+ json(dict, str ): Input JSON object.
3642
3743 Raises:
3844 TypeError: If the input object is not a dictionary or string.
@@ -120,10 +126,10 @@ def list(self, roomId=None, personId=None, personEmail=None, max=None):
120126 container.
121127
122128 Args:
123- roomId(string_types ): List memberships for the room with roomId.
124- personId(string_types ): Filter results to include only those with
129+ roomId(str ): List memberships for the room with roomId.
130+ personId(str ): Filter results to include only those with
125131 personId.
126- personEmail(string_types ): Filter results to include only those
132+ personEmail(str ): Filter results to include only those
127133 with personEmail.
128134 max(int): Limits the maximum number of memberships returned from
129135 the Spark service per request.
@@ -141,9 +147,9 @@ def list(self, roomId=None, personId=None, personEmail=None, max=None):
141147
142148 """
143149 # Process args
144- assert roomId is None or isinstance (roomId , string_types )
145- assert personId is None or isinstance (personId , string_types )
146- assert personEmail is None or isinstance (personEmail , string_types )
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 )
147153 assert max is None or isinstance (max , int )
148154 params = {}
149155 if roomId :
@@ -174,10 +180,10 @@ def create(self, roomId, personId=None, personEmail=None,
174180 making them a moderator.
175181
176182 Args:
177- roomId(string_types ): ID of the room to which the person will be
183+ roomId(str ): ID of the room to which the person will be
178184 added.
179- personId(string_types ): ID of the person to be added to the room.
180- personEmail(string_types ): Email address of the person to be 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
181187 to the room.
182188 isModerator(bool): If True, adds the person as a moderator for the
183189 room. If False, adds the person as normal member of the room.
@@ -193,9 +199,9 @@ def create(self, roomId, personId=None, personEmail=None,
193199
194200 """
195201 # Process args
196- assert isinstance (roomId , string_types )
197- assert personId is None or isinstance (personId , string_types )
198- assert personEmail is None or isinstance (personEmail , string_types )
202+ assert isinstance (roomId , str )
203+ assert personId is None or isinstance (personId , str )
204+ assert personEmail is None or isinstance (personEmail , str )
199205 assert isModerator is None or isinstance (isModerator , bool )
200206 post_data = {}
201207 post_data ['roomId' ] = roomId
@@ -217,7 +223,7 @@ def get(self, membershipId):
217223 """Get details for a membership by ID.
218224
219225 Args:
220- membershipId(string_types ): The membershipId of the membership.
226+ membershipId(str ): The membershipId of the membership.
221227
222228 Returns:
223229 Membership: With the details of the requested membership.
@@ -228,7 +234,7 @@ def get(self, membershipId):
228234
229235 """
230236 # Process args
231- assert isinstance (membershipId , string_types )
237+ assert isinstance (membershipId , str )
232238 # API request
233239 json_obj = self ._session .get ('memberships/' + membershipId )
234240 # Return a Membership object created from the response JSON data
@@ -238,7 +244,7 @@ def update(self, membershipId, **update_attributes):
238244 """Update details for a membership.
239245
240246 Args:
241- membershipId(string_types ): The membershipId of the membership to
247+ membershipId(str ): The membershipId of the membership to
242248 be updated.
243249 isModerator(bool): If True, sets the person as a moderator for the
244250 room. If False, removes the person as a moderator for the room.
@@ -253,7 +259,7 @@ def update(self, membershipId, **update_attributes):
253259
254260 """
255261 # Process args
256- assert isinstance (membershipId , string_types )
262+ assert isinstance (membershipId , str )
257263 # Process update_attributes keyword arguments
258264 if not update_attributes :
259265 error_message = "At least one **update_attributes keyword " \
@@ -269,7 +275,7 @@ def delete(self, membershipId):
269275 """Delete a membership, by ID.
270276
271277 Args:
272- membershipId(string_types ): The membershipId of the membership to
278+ membershipId(str ): The membershipId of the membership to
273279 be deleted.
274280
275281 Raises:
@@ -278,6 +284,6 @@ def delete(self, membershipId):
278284
279285 """
280286 # Process args
281- assert isinstance (membershipId , string_types )
287+ assert isinstance (membershipId , str )
282288 # API request
283289 self ._session .delete ('memberships/' + membershipId )
0 commit comments