def report_violation(community_id, channel_id): q = Qry('communities/{community_id}/report_channel', use_token=False, method=methods.POST) q.add_urlkw(keys.COMMUNITY_ID, community_id) q.add_data(keys.CHANNEL_ID, channel_id) return q
def follow_channel(user_id, channel_id, notifications=Boolean.FALSE): q = Qry('users/{user_id}/follows/channels/{channel_id}', method=methods.PUT) q.add_urlkw(keys.USER_ID, user_id) q.add_urlkw(keys.CHANNEL_ID, channel_id) q.add_data(keys.NOTIFICATIONS, Boolean.validate(notifications), Boolean.FALSE) return q
def add_timeout(community_id, user_id, duration=1, reason=None): q = Qry('communities/{community_id}/timeouts/{user_id}', method=methods.PUT) q.add_urlkw(keys.COMMUNITY_ID, community_id) q.add_urlkw(keys.USER_ID, user_id) q.add_data(keys.DURATION, duration) q.add_data(keys.REASON, reason) return q
def update(channel_id, status=None, game=None, delay=None, channel_feed_enabled=None): q = Qry('channels/{channel_id}', method=methods.PUT) q.add_urlkw(keys.CHANNEL_ID, channel_id) channel = {} if status is not None: channel[keys.STATUS] = status if game is not None: channel[keys.GAME] = game if delay is not None: channel[keys.DELAY] = delay if channel_feed_enabled is not None: channel[keys.CHANNEL_FEED_ENABLED] = Boolean.validate( channel_feed_enabled) q.add_data(keys.CHANNEL, channel) return q
def update(community_id, summary=None, description=None, rules=None, email=None): q = Qry('communities/{community_id}', method=methods.PUT) q.add_urlkw(keys.COMMUNITY_ID, community_id) q.add_data(keys.SUMMARY, summary) q.add_data(keys.DESCRIPTION, description) q.add_data(keys.RULES, rules) q.add_data(keys.EMAIL, email) return q
def create_connection_to_vhs(identifier): q = Qry('user/vhs', method=methods.PUT) q.add_data(keys.IDENTIFIER, identifier) return q
def start_commercial(channel_id, duration=30): q = Qry('channels/{channel_id}/commercial', method=methods.POST) q.add_urlkw(keys.CHANNEL_ID, channel_id) q.add_data(keys.DURATION, Duration.validate(duration)) return q
def comment(channel_id, post_id, content): q = Qry('feed/{channel_id}/posts/{post_id}/comments', method=methods.POST) q.add_urlkw(keys.CHANNEL_ID, channel_id) q.add_urlkw(keys.POST_ID, post_id) q.add_data(keys.CONTENT, content) return q
def create_post(channel_id, content, share=Boolean.FALSE): q = Qry('feed/{channel_id}/posts/', method=methods.POST) q.add_urlkw(keys.CHANNEL_ID, channel_id) q.add_param(keys.SHARE, Boolean.validate(share)) q.add_data(keys.CONTENT, content) return q
def move_in_collection(collection_id, item_id, position): q = Qry('collections/{collection_id}/items/{item_id}', method=methods.PUT) q.add_urlkw(keys.COLLECTION_ID, collection_id) q.add_urlkw(keys.ITEM_ID, item_id) q.add_data(keys.POSITION, position) return q
def add_to_collection(collection_id, video_id): q = Qry('collections/{collection_id}/items', method=methods.POST) q.add_urlkw(keys.COLLECTION_ID, collection_id) q.add_data(keys.ID, video_id) q.add_data(keys.TYPE, 'video') # must be 'video' return q
def create_thumbnail(collection_id, item_id): q = Qry('collections/{collection_id}/thumbnail', method=methods.PUT) q.add_urlkw(keys.COLLECTION_ID, collection_id) q.add_data(keys.ITEM_ID, item_id) return q
def update(collection_id, title): q = Qry('collections/{collection_id}', method=methods.PUT) q.add_urlkw(keys.COLLECTION_ID, collection_id) q.add_data(keys.TITLE, title) return q
def create(channel_id, title): q = Qry('channels/{channel_id}/collections', method=methods.POST) q.add_urlkw(keys.CHANNEL_ID, channel_id) q.add_data(keys.TITLE, title) return q
def set_communities(channel_id, community_ids): q = Qry('channels/{channel_id}/communities', method=methods.PUT) q.add_urlkw(keys.CHANNEL_ID, channel_id) q.add_data(keys.COMMUNITY_IDS, community_ids) return q