VirusTotal / vt-py

The official Python 3 client library for VirusTotal
https://virustotal.github.io/vt-py/
Apache License 2.0
531 stars 121 forks source link

patch modified_attributes_only prevent attributes from being sent #155

Open fcosantos opened 1 year ago

fcosantos commented 1 year ago

if the object has been created locally instead of retrieved:

https://github.com/VirusTotal/vt-py/blob/master/vt/client.py#L586C33-L586C57

example: image rules attribute will not be uploaded.

plusvic commented 1 year ago

I tool at look at this, and there's no way to do fix it in a way that makes sense for the API user. Instead you could simply do this:

with vt.Client(...) as client:
   id = '11111111'
  ruleset = vt.Object('hunting_ruleset', obj_id=id)
  ruleset.rules = 'eso'
  client.patch(...)