(value interface{})
| 664 | } |
| 665 | |
| 666 | func firstConversationID(value interface{}) string { |
| 667 | switch item := value.(type) { |
| 668 | case map[string]interface{}: |
| 669 | if cid, _ := item["conversation_id"].(string); cid != "" { |
| 670 | return cid |
| 671 | } |
| 672 | for _, nested := range item { |
| 673 | if cid := firstConversationID(nested); cid != "" { |
| 674 | return cid |
| 675 | } |
| 676 | } |
| 677 | case []interface{}: |
| 678 | for _, nested := range item { |
| 679 | if cid := firstConversationID(nested); cid != "" { |
| 680 | return cid |
| 681 | } |
| 682 | } |
| 683 | } |
| 684 | return "" |
| 685 | } |
| 686 | |
| 687 | func streamEventToMap(ev StreamEvent) map[string]interface{} { |
| 688 | data, err := json.Marshal(ev) |
no outgoing calls
no test coverage detected