code: func (te *TraceEventV1) UnmarshalJSON(bs []byte) error {
  
  	keys := map[string]json.RawMessage{}
  
  	if err := util.UnmarshalJSON(bs, &keys); err != nil {
  		return err
  	}
  
  	if err := util.UnmarshalJSON(keys["type"], &te.Type); err != nil {
  		return err
  	}
  
  	if err := util.UnmarshalJSON(keys["op"], &te.Op); err != nil {
  		return err
  	}
  
  	if err := util.UnmarshalJSON(keys["query_id"], &te.QueryID); err != nil {
  		return err
  	}
  
  	if err := util.UnmarshalJSON(keys["parent_id"], &te.ParentID); err != nil {
  		return err
  	}
  
  	switch te.Type {
  	case "body":
  		var body ast.Body
  		if err := util.UnmarshalJSON(keys["node"], &body); err != nil {
  			return err
  		}
  		te.Node = body
  	case "expr":
  		var expr ast.Expr
  		if err := util.UnmarshalJSON(keys["node"], &expr); err != nil {
  			return err
  		}
  		te.Node = &expr
  	case "rule":
  		var rule ast.Rule
  		if err := util.UnmarshalJSON(keys["node"], &rule); err != nil {
  			return err
  		}
  		te.Node = &rule
  	}
  
  	return util.UnmarshalJSON(keys["locals"], &te.Locals)
  }
docs: // UnmarshalJSON deserializes a TraceEventV1 object. The Node field is
  // deserialized based on the type hint from the type property in the JSON
  // object.