-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresponse.go
More file actions
40 lines (34 loc) · 783 Bytes
/
response.go
File metadata and controls
40 lines (34 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package intacct
import (
"encoding/xml"
)
// Status consts
const (
Failure = "failure"
Success = "success"
)
// TODO Set result type method?
type Response struct {
XMLName xml.Name `xml:"response"`
Control Control
Operation ResultOperation
Errors []Error `xml:"errormessage"`
}
type ResultOperation struct {
XMLName xml.Name `xml:"operation"`
Authentication Authentication
Content Content `xml:"content"`
Result Result `xml:"result"`
}
// TODO Or use delayed parsing?
type Result struct {
Status string `xml:"status"`
Function string `xml:"function"`
ControlID string `xml:"controlid"`
// TODO listtype?
Data Data `xml:"data"`
}
type Data struct {
Invoices []Invoice `xml:"invoice"`
Customers []Customer `xml:"customer"`
}