Debian Codegraph @

segment/bank_announcement_unmarshaler.go

raw symbols SCIP
1 // Code generated by *generator.SegmentUnmarshalerGenerator; DO NOT EDIT.
2
3 package segmentscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/
4
5 import (
6 "bytesscip-go gomod github.com/golang/go/src go1.18 bytes/"
7 "fmtscip-go gomod github.com/golang/go/src go1.18 fmt/"
8
9 "github.com/mitch000001/go-hbci/elementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/"
10 )
11
12 func (b *BankAnnouncementSegmentscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/BankAnnouncementSegment#) UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/BankAnnouncementSegment#UnmarshalHBCI().(value []byte) error {
13 elements, err := ExtractElementsscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/ExtractElements().(value)
14 if err != nil {
15 return err
16 }
17 if len(elements) == 0 {
18 return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("Malformed marshaled value")
19 }
20 seg, err := SegmentFromHeaderBytesscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SegmentFromHeaderBytes().(elements[0], b)
21 if err != nil {
22 return err
23 }
24 b.Segmentscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/BankAnnouncementSegment#Segment. = seg
25 if len(elements) > 1 && len(elements[1]) > 0 {
26 b.Subjectscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/BankAnnouncementSegment#Subject. = &elementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/.AlphaNumericDataElementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/AlphaNumericDataElement#{}
27 err = b.Subjectscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/BankAnnouncementSegment#Subject..UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/AlphaNumericDataElement#UnmarshalHBCI().(elements[1])
28 if err != nil {
29 return err
30 }
31 }
32 if len(elements) > 2 && len(elements[2]) > 0 {
33 b.Bodyscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/BankAnnouncementSegment#Body. = &elementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/.TextDataElementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/TextDataElement#{}
34 if len(elements)+1 > 2 {
35 err = b.Bodyscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/BankAnnouncementSegment#Body..UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/TextDataElement#UnmarshalHBCI().(bytesscip-go gomod github.com/golang/go/src go1.18 bytes/.Joinscip-go gomod github.com/golang/go/src go1.18 bytes/Join().(elements[2:], []byte("+")))
36 } else {
37 err = b.Bodyscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/BankAnnouncementSegment#Body..UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/TextDataElement#UnmarshalHBCI().(elements[2])
38 }
39 if err != nil {
40 return err
41 }
42 }
43 return nil
44 }