Added attribute for previous event object in webhook events. Used a HashMap<String, Value> to represent it but I am not sure if this is a good choice. My reasoning is that not all attributes of the object are present, only ones that have been updated, so deserializing to a specific EventObject variant may not be a good fit as all the attributes in the EventObject struct will need to be iterated to check which ones are set. Additionally, since the developer doesn't know which attributes will be updated, it is best to keep the entries flexible and let the developer choose how to access the data in "previous_attributes" depending on the attributes present.
Summary
Added attribute for previous event object in webhook events. Used a
HashMap<String, Value>
to represent it but I am not sure if this is a good choice. My reasoning is that not all attributes of the object are present, only ones that have been updated, so deserializing to a specific EventObject variant may not be a good fit as all the attributes in the EventObject struct will need to be iterated to check which ones are set. Additionally, since the developer doesn't know which attributes will be updated, it is best to keep the entries flexible and let the developer choose how to access the data in"previous_attributes"
depending on the attributes present.Open to feedback. Thanks!
Checklist
cargo make fmt