Skip to content

Commit

Permalink
Merge pull request #464 from deploymenttheory/bugfix-return-to-service
Browse files Browse the repository at this point in the history
Bugfixes for computer prestage structs and updated working examples for create and update
  • Loading branch information
thejoeker12 authored Aug 21, 2024
2 parents 561dd04 + 44f6e64 commit f444ee7
Show file tree
Hide file tree
Showing 35 changed files with 585 additions and 382 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ func main() {

// Define the payload for creating a new computer prestage
prestage := jamfpro.ResourceComputerPrestage{
//ID: "-1",
DisplayName: "jamfpro-sdk-example-computerPrestageMinimum-config",
DisplayName: "jamfpro-sdk-example-computerPrestageFull-config",
Mandatory: jamfpro.TruePtr(),
MDMRemovable: jamfpro.TruePtr(),
SupportPhoneNumber: "111-222-3333",
Expand All @@ -37,39 +36,40 @@ func main() {
EnableDeviceBasedActivationLock: jamfpro.FalsePtr(),
DeviceEnrollmentProgramInstanceId: "1",
SkipSetupItems: jamfpro.ComputerPrestageSubsetSkipSetupItems{
Biometric: jamfpro.FalsePtr(),
TermsOfAddress: jamfpro.FalsePtr(),
FileVault: jamfpro.FalsePtr(),
ICloudDiagnostics: jamfpro.FalsePtr(),
Diagnostics: jamfpro.FalsePtr(),
Accessibility: jamfpro.FalsePtr(),
AppleID: jamfpro.FalsePtr(),
ScreenTime: jamfpro.FalsePtr(),
Siri: jamfpro.FalsePtr(),
DisplayTone: jamfpro.FalsePtr(),
Restore: jamfpro.FalsePtr(),
Appearance: jamfpro.FalsePtr(),
Privacy: jamfpro.FalsePtr(),
Payment: jamfpro.FalsePtr(),
Registration: jamfpro.FalsePtr(),
TOS: jamfpro.FalsePtr(),
ICloudStorage: jamfpro.FalsePtr(),
// Selected items are not displayed in the Setup Assistant during enrollment
Biometric: jamfpro.TruePtr(),
TermsOfAddress: jamfpro.TruePtr(),
FileVault: jamfpro.TruePtr(),
ICloudDiagnostics: jamfpro.TruePtr(),
Diagnostics: jamfpro.TruePtr(),
Accessibility: jamfpro.TruePtr(),
AppleID: jamfpro.TruePtr(),
ScreenTime: jamfpro.TruePtr(),
Siri: jamfpro.TruePtr(),
DisplayTone: jamfpro.FalsePtr(), // Deprecated
Restore: jamfpro.TruePtr(),
Appearance: jamfpro.TruePtr(),
Privacy: jamfpro.TruePtr(),
Payment: jamfpro.TruePtr(),
Registration: jamfpro.TruePtr(),
TOS: jamfpro.TruePtr(),
ICloudStorage: jamfpro.TruePtr(),
Location: jamfpro.FalsePtr(),
},
LocationInformation: jamfpro.ComputerPrestageSubsetLocationInformation{
//ID: "-1",
Username: "",
Realname: "",
Phone: "",
Email: "",
ID: "-1", // Required
Username: "Deployment",
Realname: "Theory",
Phone: "+44-1234-567890",
Email: "[email protected]",
Room: "",
Position: "",
Position: "IT",
DepartmentId: "-1",
BuildingId: "-1",
VersionLock: 1,
VersionLock: 0,
},
PurchasingInformation: jamfpro.ComputerPrestageSubsetPurchasingInformation{
//ID: "-1",
ID: "-1", // Required
Leased: jamfpro.FalsePtr(),
Purchased: jamfpro.TruePtr(),
AppleCareId: "",
Expand All @@ -82,36 +82,33 @@ func main() {
LeaseDate: "1970-01-01",
PODate: "1970-01-01",
WarrantyDate: "1970-01-01",
VersionLock: 1,
},
EnrollmentCustomizationId: "0",
AutoAdvanceSetup: jamfpro.FalsePtr(),
InstallProfilesDuringSetup: jamfpro.TruePtr(),
PrestageInstalledProfileIds: []string{
"3847",
"3864",
"3806",
VersionLock: 0,
},
EnrollmentCustomizationId: "0",
AutoAdvanceSetup: jamfpro.FalsePtr(),
InstallProfilesDuringSetup: jamfpro.TruePtr(),
PrestageInstalledProfileIds: []string{},
CustomPackageIds: []string{},
CustomPackageDistributionPointId: "-1",
EnableRecoveryLock: jamfpro.FalsePtr(),
RecoveryLockPasswordType: "MANUAL",
RotateRecoveryLockPassword: jamfpro.FalsePtr(),
ProfileUuid: "0386E7C8D455A040106850A8A2033968",
ProfileUuid: "0386E7C8D455A040106850A8A2033968", // Automated Device Enrollment instance to associate with the PreStage enrollment. Devices associated with the selected Automated Device Enrollment instance can be assigned the PreStage enrollment
SiteId: "-1",
VersionLock: 1,
VersionLock: 0,
AccountSettings: jamfpro.ComputerPrestageSubsetAccountSettings{
//ID: "-1",
PayloadConfigured: jamfpro.TruePtr(),
LocalAdminAccountEnabled: jamfpro.FalsePtr(),
AdminUsername: "",
AdminPassword: "",
HiddenAdminAccount: jamfpro.FalsePtr(),
LocalAdminAccountEnabled: jamfpro.TruePtr(),
AdminUsername: "testadmin",
AdminPassword: "testpassword",
HiddenAdminAccount: jamfpro.TruePtr(),
LocalUserManaged: jamfpro.FalsePtr(),
UserAccountType: "ADMINISTRATOR",
VersionLock: 1,
PrefillPrimaryAccountInfoFeatureEnabled: jamfpro.FalsePtr(),
PrefillType: "UNKNOWN",
VersionLock: 0,
PrefillPrimaryAccountInfoFeatureEnabled: jamfpro.TruePtr(),
PrefillType: "UNKNOWN", // UNKNOWN / DEVICE_OWNER / CUSTOM
PrefillAccountFullName: "", // Required if PrefillType is CUSTOM
PrefillAccountUserName: "", // Required if PrefillType is CUSTOM
PreventPrefillInfoFromModification: jamfpro.FalsePtr(),
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ func main() {

// Define the payload for creating a new computer prestage
prestage := jamfpro.ResourceComputerPrestage{
//ID: "-1",
DisplayName: "jamfpro-sdk-example-computerPrestageMinimum-config",
Mandatory: jamfpro.TruePtr(),
MDMRemovable: jamfpro.TruePtr(),
Expand Down Expand Up @@ -57,7 +56,7 @@ func main() {
Location: jamfpro.FalsePtr(),
},
LocationInformation: jamfpro.ComputerPrestageSubsetLocationInformation{
//ID: "-1",
ID: "-1", // Required
Username: "",
Realname: "",
Phone: "",
Expand All @@ -69,7 +68,7 @@ func main() {
VersionLock: 0,
},
PurchasingInformation: jamfpro.ComputerPrestageSubsetPurchasingInformation{
//ID: "-1",
ID: "-1", // Required
Leased: jamfpro.FalsePtr(),
Purchased: jamfpro.TruePtr(),
AppleCareId: "",
Expand All @@ -84,14 +83,10 @@ func main() {
WarrantyDate: "1970-01-01",
VersionLock: 0,
},
EnrollmentCustomizationId: "0",
AutoAdvanceSetup: jamfpro.FalsePtr(),
InstallProfilesDuringSetup: jamfpro.TruePtr(),
PrestageInstalledProfileIds: []string{
"3847",
"3864",
"3806",
},
EnrollmentCustomizationId: "0",
AutoAdvanceSetup: jamfpro.FalsePtr(),
InstallProfilesDuringSetup: jamfpro.TruePtr(),
PrestageInstalledProfileIds: []string{},
CustomPackageIds: []string{},
CustomPackageDistributionPointId: "-1",
EnableRecoveryLock: jamfpro.FalsePtr(),
Expand All @@ -101,7 +96,6 @@ func main() {
SiteId: "-1",
VersionLock: 0,
AccountSettings: jamfpro.ComputerPrestageSubsetAccountSettings{
//ID: "-1",
PayloadConfigured: jamfpro.TruePtr(),
LocalAdminAccountEnabled: jamfpro.FalsePtr(),
AdminUsername: "",
Expand All @@ -112,6 +106,8 @@ func main() {
VersionLock: 0,
PrefillPrimaryAccountInfoFeatureEnabled: jamfpro.FalsePtr(),
PrefillType: "UNKNOWN",
PrefillAccountFullName: "",
PrefillAccountUserName: "",
PreventPrefillInfoFromModification: jamfpro.FalsePtr(),
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func main() {
}

// ID of the computer prestage you want to retrieve
prestageID := "45" // Replace with the actual ID
prestageID := "61" // Replace with the actual ID

// Call the GetComputerPrestageByID function
prestage, err := client.GetComputerPrestageByID(prestageID)
Expand Down
Loading

0 comments on commit f444ee7

Please sign in to comment.