-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
57 lines (49 loc) · 1.65 KB
/
Copy pathtypes.go
File metadata and controls
57 lines (49 loc) · 1.65 KB
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
package fipe
// VehicleType identifies the category of vehicle being queried.
type VehicleType string
const (
Cars VehicleType = "cars"
Motorcycles VehicleType = "motorcycles"
Trucks VehicleType = "trucks"
)
// Reference is a FIPE monthly reference table. Prices are published per
// reference month; pass a Reference code via WithReference to query
// historical tables.
type Reference struct {
Code string `json:"code"`
Month string `json:"month"`
}
// Brand is a vehicle manufacturer, e.g. "VW - VolksWagen".
type Brand struct {
Code string `json:"code"`
Name string `json:"name"`
}
// Model is a vehicle model within a brand.
type Model struct {
Code string `json:"code"`
Name string `json:"name"`
}
// Year is a model year variant. Code combines year and fuel, e.g. "2022-3".
type Year struct {
Code string `json:"code"`
Name string `json:"name"`
}
// Vehicle holds the FIPE price details for a specific model year.
type Vehicle struct {
Brand string `json:"brand"`
CodeFipe string `json:"codeFipe"`
Fuel string `json:"fuel"`
FuelAcronym string `json:"fuelAcronym"`
Model string `json:"model"`
ModelYear int `json:"modelYear"`
Price string `json:"price"`
PriceHistory []PriceHistory `json:"priceHistory,omitempty"`
ReferenceMonth string `json:"referenceMonth"`
VehicleType int `json:"vehicleType"`
}
// PriceHistory is one entry of a vehicle's price across reference months.
type PriceHistory struct {
Month string `json:"month"`
Price string `json:"price"`
Reference string `json:"reference"`
}