@classmethod
def object_from_api(cls, d, raw_json=None):
    """ Создание объекта модели из json-ответа API
        """
    obj = cls()
    obj.raw_json = raw_json
    for k, v in d.items():
        if k == 'PROPERTIES':
            for prop_name, prop_value in v.items():
                if 'NAME' in prop_value and 'VALUE' in prop_value:
                    obj.set_property(prop_name, prop_value['VALUE'],
                        prop_value['NAME'])
                else:
                    raise ValueError(
                        'Invalid property markup: expected NAME and VALUE')
        else:
            obj.set_field(k, v)
    return obj
