Skip to content

Commit 743670e

Browse files
committed
add synchronize() function to Feed object
1 parent 5d5b1e8 commit 743670e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/cbapi/response/models.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,16 @@ def create_action(self):
366366
new_action.watchlist_id = -1
367367
return new_action
368368

369+
def synchronize(self, full_sync=True):
370+
try:
371+
self._cb.post_object("/api/v1/feed/{0}/synchronize".format(self._model_unique_id),
372+
data={"full_sync": full_sync})
373+
except ServerError as e:
374+
if e.error_code == 409:
375+
raise ApiError("Cannot synchronize feed {0}: feed is disabled".format(self._model_unique_id))
376+
else:
377+
raise
378+
369379

370380
class ActionTypes(object):
371381
TYPE_MAP = {

0 commit comments

Comments
 (0)