Beispiel #1
0
    def get_list(self, list_id=None):
        """
        Return all lists if you don't pass in a list_id, by page, available to the given group. Otherwise you
        can search for a specific list by passing in a list_id.
        """

        url = f'{self.mobile_url}/api/{self.api_version}/list/'
        if list_id:
            response = self._request(url, 'GET', self.api_key, list_id)
        else:
            response = self._request(url, 'GET', self.api_key)

        content = self._parse(response.content.decode('utf-8'))

        return [List.from_json(l) for l in content]
Beispiel #2
0
 def get_by_id(self, list_id):
     """ Fetches a specific List using the unique id property """
     json_obj = self.get_json('/lists/' + list_id)
     return List.from_json(json_obj)