-
Notifications
You must be signed in to change notification settings - Fork 29
/
LastUsed.go
27 lines (22 loc) · 904 Bytes
/
LastUsed.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
package connect
// LastUsed describes the last synchronization.
type LastUsed struct {
DeviceID int `json:"userDeviceId"`
ProfileNumber int `json:"userProfileNumber"`
ApplicationNumber int `json:"applicationNumber"`
DeviceApplicationKey string `json:"lastUsedDeviceApplicationKey"`
DeviceName string `json:"lastUsedDeviceName"`
DeviceUploadTime Time `json:"lastUsedDeviceUploadTime"`
ImageURL string `json:"imageUrl"`
Released bool `json:"released"`
}
// LastUsed will return information about the latest synchronization.
func (c *Client) LastUsed(displayName string) (*LastUsed, error) {
URL := "https://connect.garmin.com/modern/proxy/device-service/deviceservice/userlastused/" + displayName
lastused := new(LastUsed)
err := c.getJSON(URL, lastused)
if err != nil {
return nil, err
}
return lastused, err
}