Skip to content

Commit

Permalink
Add MDM SUE platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
np5 committed Dec 6, 2023
1 parent 2b7e5eb commit 51f3948
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion goztl.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

const (
libraryVersion = "0.1.43"
libraryVersion = "0.1.44"
userAgent = "goztl/" + libraryVersion
mediaType = "application/json"
)
Expand Down
20 changes: 11 additions & 9 deletions mdm_software_update_enforcements.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type MDMSoftwareUpdateEnforcement struct {
ID int `json:"id"`
Name string `json:"name"`
DetailsURL string `json:"details_url"`
Platforms []string `json:"platforms"`
TagIDs []int `json:"tags"`
OSVersion string `json:"os_version"`
BuildVersion string `json:"build_version"`
Expand All @@ -49,15 +50,16 @@ func (msue MDMSoftwareUpdateEnforcement) String() string {

// MDMSoftwareUpdateEnforcementRequest represents a request to create or update a MDM software update enforcement
type MDMSoftwareUpdateEnforcementRequest struct {
Name string `json:"name"`
DetailsURL string `json:"details_url"`
TagIDs []int `json:"tags"`
OSVersion string `json:"os_version"`
BuildVersion string `json:"build_version"`
LocalDateTime *string `json:"local_datetime"`
MaxOSVersion string `json:"max_os_version"`
DelayDays *int `json:"delay_days"`
LocalTime *string `json:"local_time"`
Name string `json:"name"`
DetailsURL string `json:"details_url"`
Platforms []string `json:"platforms"`
TagIDs []int `json:"tags"`
OSVersion string `json:"os_version"`
BuildVersion string `json:"build_version"`
LocalDateTime *string `json:"local_datetime"`
MaxOSVersion string `json:"max_os_version"`
DelayDays *int `json:"delay_days"`
LocalTime *string `json:"local_time"`
}

type listMSUEOptions struct {
Expand Down
11 changes: 11 additions & 0 deletions mdm_software_update_enforcements_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var msueListJSONResponse = `
"id": 4,
"name": "Default",
"details_url": "https://www.example.com",
"platforms": ["macOS"],
"tags": [1, 2],
"os_version": "14.1",
"build_version": "23B74",
Expand All @@ -36,6 +37,7 @@ var msueGetJSONResponse = `
"id": 4,
"name": "Default",
"details_url": "https://www.example.com",
"platforms": ["macOS"],
"tags": [],
"os_version": "",
"build_version": "",
Expand All @@ -53,6 +55,7 @@ var msueCreateJSONResponse = `
"id": 4,
"name": "Default",
"details_url": "https://www.example.com",
"platforms": ["macOS"],
"tags": [1, 2],
"os_version": "",
"build_version": "",
Expand All @@ -70,6 +73,7 @@ var msueUpdateJSONResponse = `
"id": 4,
"name": "Default",
"details_url": "https://www.example.com",
"platforms": ["macOS"],
"tags": [1, 2],
"os_version": "",
"build_version": "",
Expand Down Expand Up @@ -103,6 +107,7 @@ func TestMDMSoftwareUpdateEnforcementsService_List(t *testing.T) {
ID: 4,
Name: "Default",
DetailsURL: "https://www.example.com",
Platforms: []string{"macOS"},
TagIDs: []int{1, 2},
OSVersion: "14.1",
BuildVersion: "23B74",
Expand Down Expand Up @@ -136,6 +141,7 @@ func TestMDMSoftwareUpdateEnforcementsService_GetByID(t *testing.T) {
ID: 4,
Name: "Default",
DetailsURL: "https://www.example.com",
Platforms: []string{"macOS"},
TagIDs: []int{},
MaxOSVersion: "15",
DelayDays: Int(7),
Expand Down Expand Up @@ -169,6 +175,7 @@ func TestMDMSoftwareUpdateEnforcementsService_GetByName(t *testing.T) {
ID: 4,
Name: "Default",
DetailsURL: "https://www.example.com",
Platforms: []string{"macOS"},
TagIDs: []int{1, 2},
OSVersion: "14.1",
BuildVersion: "23B74",
Expand All @@ -188,6 +195,7 @@ func TestMDMSoftwareUpdateEnforcementsService_Create(t *testing.T) {
createRequest := &MDMSoftwareUpdateEnforcementRequest{
Name: "Default",
DetailsURL: "https://www.example.com",
Platforms: []string{"macOS"},
TagIDs: []int{1, 2},
MaxOSVersion: "15",
DelayDays: Int(7),
Expand Down Expand Up @@ -217,6 +225,7 @@ func TestMDMSoftwareUpdateEnforcementsService_Create(t *testing.T) {
want := &MDMSoftwareUpdateEnforcement{
ID: 4,
Name: "Default",
Platforms: []string{"macOS"},
TagIDs: []int{1, 2},
DetailsURL: "https://www.example.com",
MaxOSVersion: "15",
Expand All @@ -236,6 +245,7 @@ func TestMDMSoftwareUpdateEnforcementsService_Update(t *testing.T) {

updateRequest := &MDMSoftwareUpdateEnforcementRequest{
Name: "Default",
Platforms: []string{"macOS"},
TagIDs: []int{1, 2},
DetailsURL: "https://www.example.com",
MaxOSVersion: "15",
Expand Down Expand Up @@ -265,6 +275,7 @@ func TestMDMSoftwareUpdateEnforcementsService_Update(t *testing.T) {
want := &MDMSoftwareUpdateEnforcement{
ID: 4,
Name: "Default",
Platforms: []string{"macOS"},
TagIDs: []int{1, 2},
DetailsURL: "https://www.example.com",
MaxOSVersion: "15",
Expand Down

0 comments on commit 51f3948

Please sign in to comment.