-
Notifications
You must be signed in to change notification settings - Fork 0
/
vehicle.go
79 lines (65 loc) · 2.6 KB
/
vehicle.go
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package adf
import "encoding/xml"
// ADF/XML standardization vehicle tag
// TODO: several of these string values can be turned into enums
// refer to the specification pdf for more info https://adfxml.info/adf_spec.pdf
type Vehicle struct {
XMLName xml.Name `xml:"vehicle"`
Interest string `xml:"interest,attr,omitempty"`
Status string `xml:"status,attr,omitempty"`
ID *ID `xml:"id,omitempty"`
Year string `xml:"year"`
Make string `xml:"make"`
Model string `xml:"model"`
Vin string `xml:"vin,omitempty"`
Stock string `xml:"stock,omitempty"`
Trim string `xml:"trim,omitempty"`
// NOTE: According to the spec doors is a text value,
// but it could also be an int, which may be more useful?
// need more data to be sure
Doors string `xml:"doors,omitempty"`
BodyStyle string `xml:"bodystyle,omitempty"`
Transmission string `xml:"transmission,omitempty"`
Odometer Odometer `xml:"odometer,omitempty"`
// Valid values: excellent, good, fair, poor, and unknown
Condition string `xml:"condition,omitempty"`
ColorCombination []struct {
InteriorColor string `xml:"interiorcolor,omitempty"`
ExteriorColor string `xml:"exteriorcolor,omitempty"`
Preference int `xml:"preference,omitempty"`
} `xml:"colorcombination,omitempty"`
// does this need to be it's own standalone struct?
ImageTag *struct {
XMLName xml.Name `xml:"imagetag,omitempty"`
Value string `xml:",chardata"`
Width string `xml:"width,attr,omitempty"`
Height string `xml:"height,attr,omitempty"`
AltText string `xml:"alttext,attr,omitempty"`
} `xml:"imagetag,omitempty"`
Price *Price `xml:"price,omitempty"`
PriceComments string `xml:"pricecomments,omitempty"`
Options []struct {
OptionName string `xml:"optionname"`
ManufacturerCode string `xml:"manufacturercode"`
Stock string `xml:"stock"`
Weighting int `xml:"weighting"`
Price Price `xml:"price"`
} `xml:"option"`
Finance *struct {
Method string `xml:"method,omitempty"`
Amount *struct {
// not sure if this is int, float, or string, needs investigation
Value string `xml:",chardata"`
Type string `xml:"type,attr,omitempty"`
Limit string `xml:"limit,attr,omitempty"`
Currency string `xml:"currency,attr,omitempty"`
} `xml:"amount,omitempty"`
Balance *struct {
// not sure if this is int, float, or string. needs investigation
Value int `xml:",chardata"`
Type string `xml:"type,attr,omitempty"`
Currency string `xml:"currency,attr,omitempty"`
} `xml:"balance,omitempty"`
} `xml:"finance,omitempty"`
Comments string `xml:"comments,omitempty"`
}