fix(audit_events): Add support for object-valued details.change (stored in details.ChangeObject) and the details.changes array
Summary
details.change is returned as an object for some audit events (e.g. project_group_link_updated), which failed to decode into the string field with json: cannot unmarshal object into Go struct field AuditEventDetails.details.change of type string. Some events also emit a plural details.changes array the SDK didn't model. Fixes this without changing any existing field types (backward compatible).
Closes #2275 (closed)
What changed
- Added a custom
UnmarshalJSONonAuditEventDetails: stringchangestays inChange, object/non-stringchangeis preserved in a newChangeObject json.RawMessagefield. - Added
Changes []AuditEventChangeto capture the pluraldetails.changesarray (previously dropped).
Testing
_ObjectChange: objectchangedecodes without error;Changestays empty and the raw object lands inChangeObject._StringChange: plain stringchangestill decodes intoChange, withChangeObjectempty._ChangesArray: the pluralchangesarray is captured inChanges.
Edited by Cesar Hinojosa