-
Notifications
You must be signed in to change notification settings - Fork 2
/
data.go
32 lines (28 loc) · 1.04 KB
/
data.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
package search
// Model represents a model returned by the search api
type Model struct {
Count int `json:"count"`
Items []Item `json:"items"`
Limit int `json:"limit"`
Offset int `json:"offset"`
TotalCount int `json:"total_count"`
}
// Item represents a single hierarchy item returned by the search api
type Item struct {
Code string `json:"code,omitempty"`
DimensionOptionURL string `json:"dimension_option_url,omitempty"`
HasData bool `json:"has_data,omitempty"`
Label string `json:"label,omitempty"`
Matches Matches `json:"matches,omitempty"`
NumberOfChildren int `json:"number_of_children,omitempty"`
}
// Matches represent matches from the input query against the returned item
type Matches struct {
Code []Match `json:"code,omitempty"`
Label []Match `json:"label,omitempty"`
}
// Match defines the start and end character numbers that the item matched with
type Match struct {
Start int `json:"start,omitempty"`
End int `json:"end,omitempty"`
}