@@ -113,7 +113,9 @@ def set_channel_data(self, collection, id, channel_id, channel_data):
113113 """
114114 endpoint = '/objects/{}/{}/channel_data/{}' .format (
115115 collection , id , channel_id )
116- return self .client .request ('put' , endpoint , payload = {'data' : channel_data })
116+ return self .client .request (
117+ 'put' , endpoint , payload = {
118+ 'data' : channel_data })
117119
118120 def unset_channel_data (self , collection , id , channel_id ):
119121 """
@@ -187,7 +189,14 @@ def get_preferences(self, collection, id, options={}):
187189
188190 return self .client .request ('get' , endpoint )
189191
190- def set_preferences (self , collection , id , channel_types = None , categories = None , workflows = None , options = {}):
192+ def set_preferences (
193+ self ,
194+ collection ,
195+ id ,
196+ channel_types = None ,
197+ categories = None ,
198+ workflows = None ,
199+ options = {}):
191200 """
192201 Sets the preference set
193202
@@ -215,7 +224,8 @@ def set_preferences(self, collection, id, channel_types=None, categories=None, w
215224
216225 return self .client .request ('put' , endpoint , payload = params )
217226
218- def set_channel_types_preferences (self , collection , id , preferences , options = {}):
227+ def set_channel_types_preferences (
228+ self , collection , id , preferences , options = {}):
219229 """
220230 Sets the channel type preferences
221231
@@ -235,15 +245,21 @@ def set_channel_types_preferences(self, collection, id, preferences, options={})
235245
236246 return self .client .request ('put' , endpoint , payload = preferences )
237247
238- def set_channel_type_preferences (self , collection , id , channel_type , setting , options = {}):
248+ def set_channel_type_preferences (
249+ self ,
250+ collection ,
251+ id ,
252+ channel_type ,
253+ setting ,
254+ options = {}):
239255 """
240256 Sets the channel type preference
241257
242258 Args:
243259 collection (str): The collection the object belongs to
244260 id (str): The id of the object in the collection
245261 channel_type (str): The channel_type to set
246- setting (boolean): The preference setting
262+ setting (boolean): The preference setting
247263 options (dict): A dictionary of options
248264
249265 Returns:
@@ -254,9 +270,16 @@ def set_channel_type_preferences(self, collection, id, channel_type, setting, op
254270 endpoint = '/objects/{}/{}/preferences/{}/channel_types/{}' .format (
255271 collection , id , preference_set_id , channel_type )
256272
257- return self .client .request ('put' , endpoint , payload = {'subscribed' : setting })
273+ return self .client .request (
274+ 'put' , endpoint , payload = {
275+ 'subscribed' : setting })
258276
259- def set_workflows_preferences (self , collection , id , preferences , options = {}):
277+ def set_workflows_preferences (
278+ self ,
279+ collection ,
280+ id ,
281+ preferences ,
282+ options = {}):
260283 """
261284 Sets the workflow preferences
262285
@@ -276,15 +299,21 @@ def set_workflows_preferences(self, collection, id, preferences, options={}):
276299
277300 return self .client .request ('put' , endpoint , payload = preferences )
278301
279- def set_workflow_preferences (self , collection , id , key , setting , options = {}):
302+ def set_workflow_preferences (
303+ self ,
304+ collection ,
305+ id ,
306+ key ,
307+ setting ,
308+ options = {}):
280309 """
281310 Sets the workflow preferences
282311
283312 Args:
284313 collection (str): The collection the object belongs to
285314 id (str): The id of the object in the collection
286315 key (str): The workflow key
287- setting (boolean or dict): The preference setting
316+ setting (boolean or dict): The preference setting
288317 options (dict): A dictionary of options
289318
290319 Returns:
@@ -295,11 +324,17 @@ def set_workflow_preferences(self, collection, id, key, setting, options={}):
295324 endpoint = '/objects/{}/{}/preferences/{}/workflows/{}' .format (
296325 collection , id , preference_set_id , key )
297326
298- params = setting if type (setting ) is dict else {'subscribed' : setting }
327+ params = setting if isinstance (setting , dict ) else {
328+ 'subscribed' : setting }
299329
300330 return self .client .request ('put' , endpoint , payload = params )
301331
302- def set_categories_preferences (self , collection , id , preferences , options = {}):
332+ def set_categories_preferences (
333+ self ,
334+ collection ,
335+ id ,
336+ preferences ,
337+ options = {}):
303338 """
304339 Sets the categories preferences
305340
@@ -319,15 +354,21 @@ def set_categories_preferences(self, collection, id, preferences, options={}):
319354
320355 return self .client .request ('put' , endpoint , payload = preferences )
321356
322- def set_category_preferences (self , collection , id , key , setting , options = {}):
357+ def set_category_preferences (
358+ self ,
359+ collection ,
360+ id ,
361+ key ,
362+ setting ,
363+ options = {}):
323364 """
324365 Sets the category preferences
325366
326367 Args:
327368 collection (str): The collection the object belongs to
328369 id (str): The id of the object in the collection
329370 key (str): The category key
330- setting (boolean or dict): The preference setting
371+ setting (boolean or dict): The preference setting
331372 options (dict): A dictionary of options
332373
333374 Returns:
@@ -338,6 +379,7 @@ def set_category_preferences(self, collection, id, key, setting, options={}):
338379 endpoint = '/objects/{}/{}/preferences/{}/categories/{}' .format (
339380 collection , id , preference_set_id , key )
340381
341- params = setting if type (setting ) is dict else {'subscribed' : setting }
382+ params = setting if isinstance (setting , dict ) else {
383+ 'subscribed' : setting }
342384
343385 return self .client .request ('put' , endpoint , payload = params )
0 commit comments