@@ -113,7 +113,9 @@ def set_channel_data(self, collection, id, channel_id, channel_data):
113
113
"""
114
114
endpoint = '/objects/{}/{}/channel_data/{}' .format (
115
115
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 })
117
119
118
120
def unset_channel_data (self , collection , id , channel_id ):
119
121
"""
@@ -187,7 +189,14 @@ def get_preferences(self, collection, id, options={}):
187
189
188
190
return self .client .request ('get' , endpoint )
189
191
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 = {}):
191
200
"""
192
201
Sets the preference set
193
202
@@ -215,7 +224,8 @@ def set_preferences(self, collection, id, channel_types=None, categories=None, w
215
224
216
225
return self .client .request ('put' , endpoint , payload = params )
217
226
218
- def set_channel_types_preferences (self , collection , id , preferences , options = {}):
227
+ def set_channel_types_preferences (
228
+ self , collection , id , preferences , options = {}):
219
229
"""
220
230
Sets the channel type preferences
221
231
@@ -235,15 +245,21 @@ def set_channel_types_preferences(self, collection, id, preferences, options={})
235
245
236
246
return self .client .request ('put' , endpoint , payload = preferences )
237
247
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 = {}):
239
255
"""
240
256
Sets the channel type preference
241
257
242
258
Args:
243
259
collection (str): The collection the object belongs to
244
260
id (str): The id of the object in the collection
245
261
channel_type (str): The channel_type to set
246
- setting (boolean): The preference setting
262
+ setting (boolean): The preference setting
247
263
options (dict): A dictionary of options
248
264
249
265
Returns:
@@ -254,9 +270,16 @@ def set_channel_type_preferences(self, collection, id, channel_type, setting, op
254
270
endpoint = '/objects/{}/{}/preferences/{}/channel_types/{}' .format (
255
271
collection , id , preference_set_id , channel_type )
256
272
257
- return self .client .request ('put' , endpoint , payload = {'subscribed' : setting })
273
+ return self .client .request (
274
+ 'put' , endpoint , payload = {
275
+ 'subscribed' : setting })
258
276
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 = {}):
260
283
"""
261
284
Sets the workflow preferences
262
285
@@ -276,15 +299,21 @@ def set_workflows_preferences(self, collection, id, preferences, options={}):
276
299
277
300
return self .client .request ('put' , endpoint , payload = preferences )
278
301
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 = {}):
280
309
"""
281
310
Sets the workflow preferences
282
311
283
312
Args:
284
313
collection (str): The collection the object belongs to
285
314
id (str): The id of the object in the collection
286
315
key (str): The workflow key
287
- setting (boolean or dict): The preference setting
316
+ setting (boolean or dict): The preference setting
288
317
options (dict): A dictionary of options
289
318
290
319
Returns:
@@ -295,11 +324,17 @@ def set_workflow_preferences(self, collection, id, key, setting, options={}):
295
324
endpoint = '/objects/{}/{}/preferences/{}/workflows/{}' .format (
296
325
collection , id , preference_set_id , key )
297
326
298
- params = setting if type (setting ) is dict else {'subscribed' : setting }
327
+ params = setting if isinstance (setting , dict ) else {
328
+ 'subscribed' : setting }
299
329
300
330
return self .client .request ('put' , endpoint , payload = params )
301
331
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 = {}):
303
338
"""
304
339
Sets the categories preferences
305
340
@@ -319,15 +354,21 @@ def set_categories_preferences(self, collection, id, preferences, options={}):
319
354
320
355
return self .client .request ('put' , endpoint , payload = preferences )
321
356
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 = {}):
323
364
"""
324
365
Sets the category preferences
325
366
326
367
Args:
327
368
collection (str): The collection the object belongs to
328
369
id (str): The id of the object in the collection
329
370
key (str): The category key
330
- setting (boolean or dict): The preference setting
371
+ setting (boolean or dict): The preference setting
331
372
options (dict): A dictionary of options
332
373
333
374
Returns:
@@ -338,6 +379,7 @@ def set_category_preferences(self, collection, id, key, setting, options={}):
338
379
endpoint = '/objects/{}/{}/preferences/{}/categories/{}' .format (
339
380
collection , id , preference_set_id , key )
340
381
341
- params = setting if type (setting ) is dict else {'subscribed' : setting }
382
+ params = setting if isinstance (setting , dict ) else {
383
+ 'subscribed' : setting }
342
384
343
385
return self .client .request ('put' , endpoint , payload = params )
0 commit comments