InstructionRejectedEvent.go 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package response
  2. import "log"
  3. import "encoding/xml"
  4. ///////////// InstructionRejectedEvent
  5. type InstructionRejectedEvent struct {
  6. XMLName xml.Name `xml:"instructionRejected"`
  7. InstructionId string `xml:"instructionId"`
  8. Reason string `xml:"reason"`
  9. AccountId int64 `xml:"accountId"`
  10. InstrumentId int64 `xml:"instrumentId"`
  11. }
  12. func (this *InstructionRejectedEvent) GetId() string {
  13. return this.InstructionId
  14. }
  15. func (this *InstructionRejectedEvent) SetId(id string) {
  16. this.InstructionId = id
  17. }
  18. func (this *InstructionRejectedEvent) Clone() interface{} {
  19. tmp := *this
  20. return &tmp
  21. }
  22. func (this *InstructionRejectedEvent) SetAccountId(id int64) {
  23. this.AccountId = id
  24. }
  25. func NewInstructionRejectedEvent(eventData string) *InstructionRejectedEvent {
  26. event := InstructionRejectedEvent{}
  27. err := xml.Unmarshal([]byte(eventData), &event)
  28. if err != nil {
  29. log.Println("NewInstructionRejectedEvent:", err, eventData)
  30. return nil
  31. }
  32. return &event
  33. }