def create(self, channel_id, title): data = { 'title': title, } response = self._request_post( 'channels/{}/collections'.format(channel_id), data=data) return Collection.construct_from(response)
def get_by_channel(self, channel_id, limit=10, cursor=None, containing_item=None): if limit > 100: raise TwitchAttributeException( 'Maximum number of objects returned in one request is 100') params = { 'limit': limit, 'cursor': cursor, } if containing_item: params['containing_item'] = containing_item response = self._request_get('channels/{}/collections'.format(channel_id)) return [Collection.construct_from(x) for x in response['collections']]
def get_by_channel(self, channel_id, limit=10, cursor=None, containing_item=None): if limit > 100: raise TwitchAttributeException( "Maximum number of objects returned in one request is 100") params = { "limit": limit, "cursor": cursor, } if containing_item: params["containing_item"] = containing_item response = self._request_get( "channels/{}/collections".format(channel_id)) return [Collection.construct_from(x) for x in response["collections"]]
def get_metadata(self, collection_id): response = self._request_get('collections/{}'.format(collection_id)) return Collection.construct_from(response)