<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sync(self, resource_types='["all"]'):
 """Synchronize the user's data with the Todoist server. This function will pull data from the Todoist server and update the state of the user object such that they match. It does not *push* data to Todoist. If you want to do that use :func:`pytodoist.todoist.User.update`. :param resource_types: A JSON-encoded list of Todoist resources which should be synced. By default this is everything, but you can choose to sync only selected resources. See `here <https://developer.todoist.com/#retrieve-data>`_ for a list of resources. """

        response = API.sync(self.api_token, '*', resource_types)
        _fail_if_contains_errors(response)
        response_json = response.json()
        self.sync_token = response_json['sync_token']
        if 'projects' in response_json:
            self._sync_projects(response_json['projects'])
        if 'items' in response_json:
            self._sync_tasks(response_json['items'])
        if 'notes' in response_json:
            self._sync_notes(response_json['notes'])
        if 'labels' in response_json:
            self._sync_labels(response_json['labels'])
        if 'filters' in response_json:
            self._sync_filters(response_json['filters'])
        if 'reminders' in response_json:
            self._sync_reminders(response_json['reminders'])