-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap_models.go
150 lines (106 loc) · 3.79 KB
/
map_models.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
package dnas
// MapHierarchyResponse is the top level response for GetHierarchy
type MapHierarchyResponse struct {
// Top level item for Map Items
Map []MapItem `json:"map"`
}
// MapElementResponse is the top level response for GetMapElement
type MapElementResponse struct {
Success bool `json:"success,omitempty"`
Map MapItem `json:"map"`
}
// MapItem represents an individual map element
type MapItem struct {
Address string `json:"address,omitempty"`
// The date and time of the level being created.
// Format: date-time
CreatedOn string `json:"createdOn,omitempty"`
// details
Details MapItemDetails `json:"details,omitempty"`
// Campus unique identifier.
ID string `json:"id,omitempty"`
// imported Id
ImportedID string `json:"importedId,omitempty"`
// The level in the hireachy.
Level string `json:"level,omitempty"`
// Campus name.
Name string `json:"name,omitempty"`
// relationship data
RelationshipData MapItemRelationshipData `json:"relationshipData,omitempty"`
SourceType string `json:"sourceType,omitempty"`
}
// MapItemDetails contains additional detail for a MapItem
type MapItemDetails struct {
CalibrationModelRef string `json:"calibrationModelRef,omitempty"`
FloorNumber int64 `json:"floorNumber,omitempty"`
GpsMarkers []string `json:"GpsMarkers,omitempty"`
// The level's map height.
Height float64 `json:"height,omitempty"`
// image
Image MapResImage `json:"image,omitempty"`
InclusionExclusionRegion []map[string]interface{} `json:"inclusionExclusionRegion,omitempty"`
Latitude float64 `json:"latitude,omitempty"`
// The level's map length.
Length float64 `json:"length,omitempty"`
Longitude float64 `json:"longitude,omitempty"`
Obstacles []string `json:"obstacles,omitempty"`
OffsetX float64 `json:"offsetX,omitempty"`
OffsetY float64 `json:"offsetY,omitempty"`
// The level's map width.
Width float64 `json:"width,omitempty"`
}
// MapInclusionExclusionRegionItem is supposed to represent an InclusionExclusionRegionItem.
// This is not currently used, but you could use it to extract InclusionExclusionRegionItems to.
type MapInclusionExclusionRegionItem struct {
// Indicate how to handle the vertices on map.
Type string `json:"type,omitempty"`
// The number of vertices.
Vertices int64 `json:"vertices,omitempty"`
}
// MapItemCorner is supposed to represent part of an InclusionExclusionRegionItem.
// This is not currently used, but you could use it to extract InclusionExclusionRegionItems to.
type MapItemCorner struct {
// x
X float64 `json:"x,omitempty"`
// y
Y float64 `json:"y,omitempty"`
// z
Z float64 `json:"z,omitempty"`
// Unit
Unit string `json:"unit,omitempty"`
}
// MapItemRelationshipData contains the relationships with other map items
type MapItemRelationshipData struct {
// ancestor ids
AncestorIds []string `json:"ancestorIds"`
// ancestors
Ancestors []string `json:"ancestors"`
// children
Children []MapItem `json:"children"`
// parent
Parent interface{} `json:"parent,omitempty"`
}
// MapResImage represents a map item image.
type MapResImage struct {
Cksum string `json:"cksum,omitempty"`
// color depth
ColorDepth int64 `json:"colorDepth,omitempty"`
// height
Height int64 `json:"height,omitempty"`
// Indicate if the source image is compressed(true) or not(false).
ImageCompressed bool `json:"imageCompressed,omitempty"`
// The image for the map.
ImageName string `json:"imageName,omitempty"`
// max resolution
MaxResolution int64 `json:"maxResolution,omitempty"`
// size
Size int64 `json:"size,omitempty"`
// source file
SourceFile string `json:"sourceFile,omitempty"`
// Indicate if the source image is valid(true) or not(false).
ValidImageSupplied bool `json:"validImageSupplied,omitempty"`
// width
Width int64 `json:"width,omitempty"`
// zoom level
ZoomLevel int64 `json:"zoomLevel,omitempty"`
}