@classmethod
def from_json(cls, data):
    """Returns a new class object with data populated from json.loads()."""
    attrs = {}
    for attr in cls.__rest__:
        try:
            value = data[attr]
        except KeyError:
            pass
        else:
            prop = cls.__dict__[attr]
            attrs[attr] = prop.from_json(value)
    return cls(**attrs)
