HistoricEvent.go 494 B

123456789101112131415161718192021222324
  1. package response
  2. import (
  3. "encoding/xml"
  4. )
  5. type HistoricMarketDataEvent struct {
  6. XMLName xml.Name `xml:"historicMarketData"`
  7. InstructionId string `xml:"instructionId"`
  8. Urls []string `xml:"urls>url"`
  9. }
  10. func (this *HistoricMarketDataEvent) GetId() string {
  11. return this.InstructionId
  12. }
  13. func NewHistoricMarketData(data string) *HistoricMarketDataEvent {
  14. r := HistoricMarketDataEvent{}
  15. err := xml.Unmarshal([]byte(data), &r)
  16. if err != nil {
  17. return nil
  18. }
  19. return &r
  20. }