| 1 | // Code generated by *generator.VersionedSegmentUnmarshalerGenerator; 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 (s *SignatureEndSegmentscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndSegment#) UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndSegment#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 | header := &elementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/.SegmentHeaderscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/SegmentHeader#{} |
| 18 | err = header.UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/SegmentHeader#UnmarshalHBCI().(elements[0]) |
| 19 | if err != nil { |
| 20 | return err |
| 21 | } |
| 22 | var segment signatureEndSegmentscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/signatureEndSegment# |
| 23 | switch header.Versionscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/SegmentHeader#Version..Valscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/NumberDataElement#Val().() { |
| 24 | case 1: |
| 25 | segment = &SignatureEndV1scip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV1#{} |
| 26 | err = segment.UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/Unmarshaler#UnmarshalHBCI.(value) |
| 27 | if err != nil { |
| 28 | return err |
| 29 | } |
| 30 | case 2: |
| 31 | segment = &SignatureEndV2scip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV2#{} |
| 32 | err = segment.UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/Unmarshaler#UnmarshalHBCI.(value) |
| 33 | if err != nil { |
| 34 | return err |
| 35 | } |
| 36 | default: |
| 37 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("Unknown segment version: %d", header.Versionscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/SegmentHeader#Version..Valscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/NumberDataElement#Val().()) |
| 38 | } |
| 39 | s.signatureEndSegmentscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndSegment#signatureEndSegment. = segment |
| 40 | return nil |
| 41 | } |
| 42 | |
| 43 | func (s *SignatureEndV1scip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV1#) UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV1#UnmarshalHBCI().(value []byte) error { |
| 44 | elements, err := ExtractElementsscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/ExtractElements().(value) |
| 45 | if err != nil { |
| 46 | return err |
| 47 | } |
| 48 | if len(elements) == 0 { |
| 49 | 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") |
| 50 | } |
| 51 | seg, err := SegmentFromHeaderBytesscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SegmentFromHeaderBytes().(elements[0], s) |
| 52 | if err != nil { |
| 53 | return err |
| 54 | } |
| 55 | s.ClientSegmentscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV1#ClientSegment. = seg |
| 56 | if len(elements) > 1 && len(elements[1]) > 0 { |
| 57 | s.SecurityControlRefscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV1#SecurityControlRef. = &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#{} |
| 58 | err = s.SecurityControlRefscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV1#SecurityControlRef..UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/AlphaNumericDataElement#UnmarshalHBCI().(elements[1]) |
| 59 | if err != nil { |
| 60 | return err |
| 61 | } |
| 62 | } |
| 63 | if len(elements) > 2 && len(elements[2]) > 0 { |
| 64 | s.Signaturescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV1#Signature. = &elementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/.BinaryDataElementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/BinaryDataElement#{} |
| 65 | err = s.Signaturescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV1#Signature..UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/BinaryDataElement#UnmarshalHBCI().(elements[2]) |
| 66 | if err != nil { |
| 67 | return err |
| 68 | } |
| 69 | } |
| 70 | if len(elements) > 3 && len(elements[3]) > 0 { |
| 71 | s.PinTanscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV1#PinTan. = &elementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/.PinTanDataElementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/PinTanDataElement#{} |
| 72 | if len(elements)+1 > 3 { |
| 73 | err = s.PinTanscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV1#PinTan..UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/DataElement#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[3:], []byte("+"))) |
| 74 | } else { |
| 75 | err = s.PinTanscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV1#PinTan..UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/DataElement#UnmarshalHBCI.(elements[3]) |
| 76 | } |
| 77 | if err != nil { |
| 78 | return err |
| 79 | } |
| 80 | } |
| 81 | return nil |
| 82 | } |
| 83 | |
| 84 | func (s *SignatureEndV2scip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV2#) UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV2#UnmarshalHBCI().(value []byte) error { |
| 85 | elements, err := ExtractElementsscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/ExtractElements().(value) |
| 86 | if err != nil { |
| 87 | return err |
| 88 | } |
| 89 | if len(elements) == 0 { |
| 90 | 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") |
| 91 | } |
| 92 | seg, err := SegmentFromHeaderBytesscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SegmentFromHeaderBytes().(elements[0], s) |
| 93 | if err != nil { |
| 94 | return err |
| 95 | } |
| 96 | s.ClientSegmentscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV2#ClientSegment. = seg |
| 97 | if len(elements) > 1 && len(elements[1]) > 0 { |
| 98 | s.SecurityControlRefscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV2#SecurityControlRef. = &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#{} |
| 99 | err = s.SecurityControlRefscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV2#SecurityControlRef..UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/AlphaNumericDataElement#UnmarshalHBCI().(elements[1]) |
| 100 | if err != nil { |
| 101 | return err |
| 102 | } |
| 103 | } |
| 104 | if len(elements) > 2 && len(elements[2]) > 0 { |
| 105 | s.Signaturescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV2#Signature. = &elementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/.BinaryDataElementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/BinaryDataElement#{} |
| 106 | err = s.Signaturescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV2#Signature..UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/BinaryDataElement#UnmarshalHBCI().(elements[2]) |
| 107 | if err != nil { |
| 108 | return err |
| 109 | } |
| 110 | } |
| 111 | if len(elements) > 3 && len(elements[3]) > 0 { |
| 112 | s.CustomSignaturescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV2#CustomSignature. = &elementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/.CustomSignatureDataElementscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/CustomSignatureDataElement#{} |
| 113 | if len(elements)+1 > 3 { |
| 114 | err = s.CustomSignaturescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV2#CustomSignature..UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/DataElement#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[3:], []byte("+"))) |
| 115 | } else { |
| 116 | err = s.CustomSignaturescip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/segment`/SignatureEndV2#CustomSignature..UnmarshalHBCIscip-go gomod github.com/mitch000001/go-hbci . `github.com/mitch000001/go-hbci/element`/DataElement#UnmarshalHBCI.(elements[3]) |
| 117 | } |
| 118 | if err != nil { |
| 119 | return err |
| 120 | } |
| 121 | } |
| 122 | return nil |
| 123 | } |