Debian Codegraph @

element/swift.go

raw
1 package element
2
3 import (
4 "github.com/mitch000001/go-hbci/swift"
5 )
6
7 // SwiftMT940DataElement represents a DataElement containing SWIFT MT940
8 // binary data
9 type SwiftMT940DataElement struct {
10 *BinaryDataElement
11 swiftMT940Messages *swift.MT940Messages
12 }
13
14 // UnmarshalHBCI unmarshals value into s
15 func (s *SwiftMT940DataElement) UnmarshalHBCI(value []byte) error {
16 s.BinaryDataElement = &BinaryDataElement{}
17 err := s.BinaryDataElement.UnmarshalHBCI(value)
18 if err != nil {
19 return err
20 }
21 s.swiftMT940Messages = swift.NewMT940Messages(s.BinaryDataElement.Val())
22 return nil
23 }
24
25 // Val returns the embodied transactions as *swift.MT940Messages
26 func (s *SwiftMT940DataElement) Val() *swift.MT940Messages {
27 return s.swiftMT940Messages
28 }