Skip to content

Commit

Permalink
add linux distro device fields
Browse files Browse the repository at this point in the history
  • Loading branch information
da-cf committed Aug 30, 2022
1 parent 355c687 commit a9c585c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 32 deletions.
36 changes: 19 additions & 17 deletions teams_devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@ type TeamsDeviceDetail struct {
}

type TeamsDeviceListItem struct {
User UserItem `json:"user,omitempty"`
ID string `json:"id,omitempty"`
Key string `json:"key,omitempty"`
DeviceType string `json:"device_type,omitempty"`
Name string `json:"name,omitempty"`
Model string `json:"model,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Version string `json:"version,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
OSVersion string `json:"os_version,omitempty"`
MacAddress string `json:"mac_address,omitempty"`
IP string `json:"ip,omitempty"`
Created string `json:"created,omitempty"`
Updated string `json:"updated,omitempty"`
LastSeen string `json:"last_seen,omitempty"`
RevokedAt string `json:"revoked_at,omitempty"`
User UserItem `json:"user,omitempty"`
ID string `json:"id,omitempty"`
Key string `json:"key,omitempty"`
DeviceType string `json:"device_type,omitempty"`
Name string `json:"name,omitempty"`
Model string `json:"model,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Version string `json:"version,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
OSVersion string `json:"os_version,omitempty"`
OSDistroName string `json:"os_distro_name,omitempty"`
OsDistroRevision string `json:"os_distro_revision,omitempty"`
MacAddress string `json:"mac_address,omitempty"`
IP string `json:"ip,omitempty"`
Created string `json:"created,omitempty"`
Updated string `json:"updated,omitempty"`
LastSeen string `json:"last_seen,omitempty"`
RevokedAt string `json:"revoked_at,omitempty"`
}

type UserItem struct {
Expand Down
34 changes: 19 additions & 15 deletions teams_devices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ func TestTeamsDevicesList(t *testing.T) {
"version": "1.0.0",
"serial_number": "EXAMPLEHMD6R",
"os_version": "10.0.0",
"os_distro_name": "ubuntu",
"os_distro_revision": "20.04",
"mac_address": "00-00-5E-00-53-00",
"ip": "192.0.2.1",
"created": "2017-06-14T00:00:00Z",
Expand All @@ -58,21 +60,23 @@ func TestTeamsDevicesList(t *testing.T) {
Name: "John Appleseed",
Email: "user@example.com",
},
Key: "yek0SUYoOQ10vMGsIYAevozXUQpQtNFJFfFGqER/BGc=",
DeviceType: "windows",
Name: "My mobile device",
Model: "MyPhone(pro-X)",
Manufacturer: "My phone corp",
Deleted: true,
Version: "1.0.0",
SerialNumber: "EXAMPLEHMD6R",
OSVersion: "10.0.0",
MacAddress: "00-00-5E-00-53-00",
IP: "192.0.2.1",
Created: "2017-06-14T00:00:00Z",
Updated: "2017-06-14T00:00:00Z",
LastSeen: "2017-06-14T00:00:00Z",
RevokedAt: "2017-06-14T00:00:00Z",
Key: "yek0SUYoOQ10vMGsIYAevozXUQpQtNFJFfFGqER/BGc=",
DeviceType: "windows",
Name: "My mobile device",
Model: "MyPhone(pro-X)",
Manufacturer: "My phone corp",
Deleted: true,
Version: "1.0.0",
SerialNumber: "EXAMPLEHMD6R",
OSVersion: "10.0.0",
OSDistroName: "ubuntu",
OsDistroRevision: "1.0.0",
MacAddress: "00-00-5E-00-53-00",
IP: "192.0.2.1",
Created: "2017-06-14T00:00:00Z",
Updated: "2017-06-14T00:00:00Z",
LastSeen: "2017-06-14T00:00:00Z",
RevokedAt: "2017-06-14T00:00:00Z",
}}

mux.HandleFunc("/accounts/"+testAccountID+"/devices", handler)
Expand Down

0 comments on commit a9c585c

Please sign in to comment.