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 UnmarshalJSON on AuditEventDetails: string change stays in Change, object/non-string change is preserved in a new ChangeObject json.RawMessage field.
  • Added Changes []AuditEventChange to capture the plural details.changes array (previously dropped).

Testing

  • _ObjectChange: object change decodes without error; Change stays empty and the raw object lands in ChangeObject.
  • _StringChange: plain string change still decodes into Change, with ChangeObject empty.
  • _ChangesArray: the plural changes array is captured in Changes.
Edited by Cesar Hinojosa

Merge request reports

Loading