Skip to content

Commit

Permalink
Merge pull request #1073 from dhens/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Aug 30, 2022
2 parents 355c687 + bd72f65 commit 93c3616
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .changelog/1073.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
teams_account: add support for `os_distro_name` and `os_distro_revision`
```
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": "1.0.0",
"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 93c3616

Please sign in to comment.