コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
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
コード例 #4
0
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
コード例 #5
0
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
コード例 #6
0
def create_connection_to_vhs(identifier):
    q = Qry('user/vhs', method=methods.PUT)
    q.add_data(keys.IDENTIFIER, identifier)
    return q
コード例 #7
0
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
コード例 #8
0
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
コード例 #9
0
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
コード例 #10
0
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
コード例 #11
0
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
コード例 #12
0
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
コード例 #13
0
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
コード例 #14
0
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
コード例 #15
0
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