1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Text ;
4
+ using System . Threading . Tasks ;
5
+
6
+ namespace RadarIO . Xamarin
7
+ {
8
+ public abstract class RadarSDK
9
+ {
10
+ public abstract Task < ( RadarStatus , RadarLocation , RadarEvent [ ] , RadarUser ) > TrackOnce ( ) ;
11
+ }
12
+
13
+ public class RadarUser
14
+ {
15
+ public string Id ;
16
+ public string UserId ;
17
+ public string DeviceId ;
18
+ public string Description ;
19
+ public JSONObject Metadata ;
20
+ public RadarLocation Location ;
21
+ public IEnumerable < RadarGeofence > Geofences ;
22
+ public RadarPlace Place ;
23
+ public RadarUserInsights Insights ;
24
+ public IEnumerable < RadarBeacon > Beacons ;
25
+ public bool Stopped ;
26
+ public bool Foreground ;
27
+ public RadarRegion Country ;
28
+ public RadarRegion State ;
29
+ public RadarRegion DMA ;
30
+ public RadarRegion PostalCode ;
31
+ public IEnumerable < RadarChain > NearbyPlaceChains ;
32
+ public IEnumerable < RadarSegment > Segments ;
33
+ public IEnumerable < RadarChain > TopChains ;
34
+ public RadarLocationSource Source ;
35
+ public bool Proxy ;
36
+ public RadarTrip Trip ;
37
+ }
38
+
39
+ public class RadarTrip
40
+ {
41
+ public string Id ;
42
+ public string ExternalId ;
43
+ public JSONObject Metadata ;
44
+ public string DestinationGeofenceTag ;
45
+ public string DestinationGeofenceExternalId ;
46
+ public RadarCoordinate DestinationLocation ;
47
+ public RadarRouteMode Mode ;
48
+ public double EtaDistance ;
49
+ public double EtaDuration ;
50
+ public RadarTripStatus Status ;
51
+ }
52
+
53
+ public enum RadarTripStatus
54
+ {
55
+ Canceled ,
56
+ Completed ,
57
+ Expired ,
58
+ Arrived ,
59
+ Approaching ,
60
+ Started ,
61
+ Unknown
62
+ }
63
+
64
+ public enum RadarRouteMode
65
+ {
66
+ Motorbike ,
67
+ Truck ,
68
+ Car ,
69
+ Bike ,
70
+ Foot
71
+ }
72
+
73
+ public enum RadarLocationSource
74
+ {
75
+ Unknown ,
76
+ BeaconExit ,
77
+ BeaconEnter ,
78
+ MockLocation ,
79
+ GeofenceExit ,
80
+ GeofenceDwell ,
81
+ GeofenceEnter ,
82
+ ManualLocation ,
83
+ BackgroundLocation ,
84
+ ForegroundLocation
85
+ }
86
+
87
+ public class RadarSegment
88
+ {
89
+ public string Description ;
90
+ public string ExternalId ;
91
+ }
92
+
93
+ public class RadarChain
94
+ {
95
+ public string Slug ;
96
+ public string Name ;
97
+ public string ExternalId ;
98
+ public JSONObject Metadata ;
99
+ }
100
+
101
+
102
+ public class RadarRegion
103
+ {
104
+ public string Id ;
105
+ public string Name ;
106
+ public string Code ;
107
+ public string Type ;
108
+ public string Flag ;
109
+ }
110
+
111
+ public class RadarBeacon
112
+ {
113
+ public string Id ;
114
+ public string Description ;
115
+ public string Tag ;
116
+ public string ExternalId ;
117
+ public string UUID ;
118
+ public string Major ;
119
+ public string Minor ;
120
+ public JSONObject Metadata ;
121
+ public RadarLocation Location ;
122
+ }
123
+
124
+ public class RadarUserInsights
125
+ {
126
+ public RadarUserInsightsLocation HomeLocation ;
127
+ public RadarUserInsightsLocation OfficeLocation ;
128
+ public RadarUserInsightsState State ;
129
+ }
130
+
131
+ public class RadarUserInsightsState
132
+ {
133
+ public bool Home ;
134
+ public bool Office ;
135
+ public bool Traveling ;
136
+ public bool Commuting ;
137
+ }
138
+
139
+ public class RadarUserInsightsLocation
140
+ {
141
+ public RadarUserInsightsLocationType Type ;
142
+ public RadarCoordinate Location ;
143
+ public RadarUserInsightsLocationConfidence Confidence ;
144
+ public DateTime ? UpdatedAt ;
145
+ public RadarRegion Country ;
146
+ public RadarRegion State ;
147
+ public RadarRegion DMA ;
148
+ public RadarRegion PostalCode ;
149
+ }
150
+
151
+ public enum RadarUserInsightsLocationConfidence
152
+ {
153
+ High ,
154
+ Medium ,
155
+ Low ,
156
+ None
157
+ }
158
+
159
+ public enum RadarUserInsightsLocationType
160
+ {
161
+ Office ,
162
+ Home ,
163
+ Unknown
164
+ }
165
+
166
+ public class RadarPlace
167
+ {
168
+ public string Id ;
169
+ public string Name ;
170
+ public IEnumerable < string > Categories ;
171
+ public RadarChain Chain ;
172
+ public RadarLocation Location ;
173
+ public string Group ;
174
+ public JSONObject Metadata ;
175
+ }
176
+
177
+ public class RadarGeofence
178
+ {
179
+ public string Id ;
180
+ public string Description ;
181
+ public string Tag ;
182
+ public string ExternalId ;
183
+ public JSONObject Metadata ;
184
+ public RadarGeofenceGeometry Geometry ;
185
+ }
186
+
187
+ public abstract class RadarGeofenceGeometry { }
188
+
189
+ public class RadarCircleGeometry : RadarGeofenceGeometry
190
+ {
191
+ public RadarCoordinate Center ;
192
+ public double Radius ;
193
+ }
194
+
195
+ public class RadarPolygonGeometry : RadarGeofenceGeometry
196
+ {
197
+ public RadarCoordinate Center ;
198
+ public IEnumerable < RadarCoordinate > Coordinates ;
199
+ public double Radius ;
200
+ }
201
+
202
+ public class RadarCoordinate
203
+ {
204
+ public double Latitude ;
205
+ public double Longitude ;
206
+ }
207
+
208
+ public class RadarEvent
209
+ {
210
+
211
+ }
212
+
213
+ public class RadarLocation
214
+ {
215
+ public double Longitude ;
216
+ public double Latitude ;
217
+ public float Bearing ;
218
+ public double Altitude ;
219
+ public float Speed ;
220
+ public DateTime ? Timestamp ;
221
+ // todo
222
+ }
223
+
224
+ public enum RadarStatus
225
+ {
226
+ ErrorUnknown ,
227
+ ErrorServer ,
228
+ ErrorRateLimit ,
229
+ ErrorNotFound ,
230
+ ErrorForbidden ,
231
+ ErrorPaymentRequired ,
232
+ ErrorUnauthorized ,
233
+ ErrorBadRequest ,
234
+ ErrorNetwork ,
235
+ ErrorBluetooth ,
236
+ ErrorLocation ,
237
+ ErrorPermissions ,
238
+ ErrorPublishableKey ,
239
+ Success
240
+ }
241
+
242
+ public class JSONObject : Dictionary < string , object > { }
243
+
244
+ }
0 commit comments