Edit preferences in /usr/cdrouter-data/etc/config.yml.

        :param resource: :class:`system.Preferences <system.Preferences>` object
        :return: :class:`system.Preferences <system.Preferences>` object
        :rtype: system.Preferences

def edit_preferences(self, resource):
        """Edit preferences in /usr/cdrouter-data/etc/config.yml.

        :param resource: :class:`system.Preferences <system.Preferences>` object
        :return: :class:`system.Preferences <system.Preferences>` object
        :rtype: system.Preferences
        """
        schema = PreferencesSchema()
        json = self.service.encode(schema, resource)

        schema = PreferencesSchema()
        resp = self.service.patch(self.base+'preferences/', json=json)
        return self.service.decode(schema, resp)