-
Notifications
You must be signed in to change notification settings - Fork 8
/
types.go
294 lines (254 loc) · 9.78 KB
/
types.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
/*
* Copyright (c) 2018 Jeffrey Walter <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package arlo
/*
// Credentials is the login credential data.
type Credentials struct {
Email string `json:"email"`
Password string `json:"password"`
}
// Duration holds two dates used when you need to specify a date range in the format "20060102".
type Duration struct {
DateFrom string `json:"dateFrom""`
DateTo string `json:"dateTo"`
}
// PasswordPair is used when updating the account password.
type PasswordPair struct {
CurrentPassword string `json:"currentPassword"`
NewPassword string `json:"newPassword"`
}
// FullName is used when updating the account username.
type FullName struct {
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
}
*/
// Account is the account data.
type Account struct {
UserId string `json:"userId"`
Email string `json:"email"`
Token string `json:"token"`
PaymentId string `json:"paymentId"`
Authenticated uint32 `json:"authenticated"`
AccountStatus string `json:"accountStatus"`
SerialNumber string `json:"serialNumber"`
CountryCode string `json:"countryCode"`
TocUpdate bool `json:"tocUpdate"`
PolicyUpdate bool `json:"policyUpdate"`
ValidEmail bool `json:"validEmail"`
Arlo bool `json:"arlo"`
DateCreated int64 `json:"dateCreated"`
}
type AppStore struct {
Enforce bool `json:"enforce"`
LatestVersion string `json:"latestVersion"`
UpdateLink string `json:"updateLink"`
}
type Session struct {
AccountStatus string `json:"accountStatus"`
AppStore `json:"appStore"`
Account
}
type UserProfile struct {
Type string `json:"_type"`
AcceptedPolicy int `json:"acceptedPolicy"`
Country string `json:"country"`
CurrentPolicy int `json:"currentPolicy"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
ValidEmail bool `json:"validEmail"`
}
// Friend is the account data for non-primary account holders designated as friends.
type Friend struct {
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Devices DeviceOrder `json:"devices"`
LastModified int64 `json:"lastModified"`
AdminUser bool `json:"adminUser"`
Email string `json:"email"`
Id string `json:"id"`
}
// Connectivity is part of the Device data.
type Connectivity struct {
ActiveNetwork string `json:"activeNetwork,omitempty"`
APN string `json:"apn,omitempty"`
CarrierFw string `json:"carrierFw,omitempty"`
Connected bool `json:"connected,omitempty"`
FWVersion string `json:"fwVersion,omitempty"`
ICCID string `json:"iccid,omitempty"`
IMEI string `json:"imei,omitempty"`
MEPStatus string `json:"mepStatus,omitempty"`
MSISDN string `json:"msisdn,omitempty"`
NetworkMode string `json:"networkMode,omitempty"`
NetworkName string `json:"networkName,omitempty"`
RFBand int `json:"rfBand,omitempty"`
Roaming bool `json:"roaming"`
RoamingAllowed bool `json:"roamingAllowed"`
SignalStrength string `json:"signalStrength,omitempty"`
Type string `json:"type,omitempty"`
WWANIPAddr string `json:"wwanIpAddr,omitempty"`
}
type BaseStationMetadata struct {
InterfaceVersion int `json:"interfaceVersion"`
ApiVersion int `json:"apiVersion"`
State string `json:"state"`
SwVersion string `json:"swVersion"`
HwVersion string `json:"hwVersion"`
ModelId string `json:"modelId"`
Capabilities []string `json:"capabilities"`
McsEnabled bool `json:"mcsEnabled"`
AutoUpdateEnabled bool `json:"autoUpdateEnabled"`
TimeZone string `json:"timeZone"`
OlsonTimeZone string `json:"olsonTimeZone"`
UploadBandwidthSaturated bool `json:"uploadBandwidthSaturated"`
AntiFlicker map[string]int `json:"antiFlicker"`
LowBatteryAlert map[string]bool `json:"lowBatteryAlert"`
LowSignalAlert map[string]bool `json:"lowSignalAlert"`
Claimed bool `json:"claimed"`
TimeSyncState string `json:"timeSyncState"`
Connectivity Connectivity `json:"connectivity"`
}
// Owner is the owner of a Device data.
type Owner struct {
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
OwnerId string `json:"ownerId"`
}
// Properties is the Device properties data.
type Properties struct {
ModelId string `json:"modelId"`
OlsonTimeZone string `json:"olsonTimeZone"`
HwVersion string `json:"hwVersion"`
}
type Favorite struct {
NonFavorite uint8 `json:"nonFavorite"`
Favorite uint8 `json:"Favorite"`
}
type BaseDetectionProperties struct {
Armed bool `json:"armed"`
Sensitivity int `json:"sensitivity"`
Zones []string `json:"zones,omitempty"`
}
// MotionDetectionProperties is the Properties struct for the EventStreamPayload type.
type MotionDetectionProperties struct {
BaseDetectionProperties `json:"motionDetection"`
}
// AudioDetectionProperties is the Properties struct for the EventStreamPayload type.
type AudioDetectionProperties struct {
BaseDetectionProperties `json:"audioDetection"`
}
type EmailNotification struct {
Enabled bool `json:"enabled"`
EmailList []string `json:"emailList"`
PushNotification bool `json:"pushNotification"`
}
type PlayTrackProperties struct {
TrackId string `json:"trackId"`
Position int `json:"position"`
}
type BaseLoopbackModeProperties struct {
LoopbackMode string `json:"loopbackMode"`
}
type LoopbackModeProperties struct {
Config BaseLoopbackModeProperties `json:"config"`
}
type BaseSleepTimerProperties struct {
SleepTime int64 `json:"sleepTime"`
SleepTimeRel int `json:"sleepTimeRel"`
}
type SleepTimerProperties struct {
Config BaseSleepTimerProperties `json:"config"`
}
type BaseEventActionProperties struct {
ActionType string `json:"actionType"`
StopType string `json:"stopType"`
Timeout int `json:"timeout"`
EmailNotification `json:"emailNotification"`
}
type EventActionProperties struct {
BaseEventActionProperties `json:"eventAction"`
}
type BaseShuffleProperties struct {
ShuffleActive bool `json:"shuffleActive"`
}
type ShuffleProperties struct {
Config BaseShuffleProperties `json:"config"`
}
type VolumeProperties struct {
Mute bool `json:"mute"`
Volume int `json:"volume,omitempty"`
}
type SpeakerProperties struct {
Speaker VolumeProperties `json:"speaker"`
}
type NightLightRGBProperties struct {
Red int `json:"red"`
Green int `json:"green"`
Blue int `json:"blue"`
}
type BaseNightLightProperties struct {
Brightness int `json:"brightness,omitempty"`
Enabled bool `json:"enabled"`
Mode string `json:"mode,omitempty"`
RGB NightLightRGBProperties `json:"rgb,omitempty"`
SleepTime int64 `json:"sleepTime,omitempty"`
SleepTimeRel int `json:"sleepTimeRel,omitempty"`
}
type NightLightProperties struct {
NightLight BaseNightLightProperties `json:"nightLight"`
}
type SirenProperties struct {
SirenState string `json:"sirenState"`
Duration int `json:"duration"`
Volume int `json:"volume"`
Pattern string `json:"pattern"`
}
type BasestationModeProperties struct {
Active string `json:"active"`
}
type BasestationScheduleProperties struct {
Active bool `json:"active"`
}
type CameraProperties struct {
PrivacyActive bool `json:"privacyActive"`
Brightness int `json:"brightness,omitempty"`
}
// EventStreamPayload is the message that will be sent to the arlo servers via the /notify API.
type EventStreamPayload struct {
Action string `json:"action,omitempty"`
Resource string `json:"resource,omitempty"`
PublishResponse bool `json:"publishResponse"`
Properties interface{} `json:"properties,omitempty"`
TransId string `json:"transId"`
From string `json:"from"`
To string `json:"to"`
}
type PlaylistItem struct {
TZ string `json:"tz"`
D string `json:"d"`
URL string `json:"url"`
SURL string `json:"sUrl"`
S string `json:"s"`
U int64 `json:"u"`
}
type CvrPlaylist struct {
ToDate string `json:"toDate"`
Playlist map[string]map[string][]PlaylistItem `json:"playlist"`
UserId string `json:"userId"`
FromDate string `json:"fromDate"`
DeviceId string `json:"deviceId"`
UniqueId string `json:"uniqueId"`
}