-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #478 from deploymenttheory/bugfix-computerprestages
Feature - added sdk funcs for accepting and getting app installer t&c's status
- Loading branch information
Showing
11 changed files
with
159 additions
and
53 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
examples/_templates/authentication/example_client_setup_with_configfile.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 27 additions & 24 deletions
51
examples/_templates/authentication/example_client_setup_with_manual_conf.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ func main() { | |
} | ||
|
||
// The ID of the computer prestage you want to update | ||
prestageID := "61" | ||
prestageID := "83" | ||
|
||
// First, get the current prestage to obtain the current version lock | ||
currentPrestage, err := client.GetComputerPrestageByID(prestageID) | ||
|
@@ -32,12 +32,12 @@ func main() { | |
DisplayName: "jamfpro-sdk-example-computerPrestageMinimum-config", | ||
Mandatory: jamfpro.TruePtr(), | ||
MDMRemovable: jamfpro.TruePtr(), | ||
SupportPhoneNumber: "111-222-3333", | ||
SupportPhoneNumber: "111-222-3344", | ||
SupportEmailAddress: "[email protected]", | ||
Department: "department name", | ||
DefaultPrestage: jamfpro.FalsePtr(), | ||
EnrollmentSiteId: "-1", | ||
KeepExistingSiteMembership: jamfpro.FalsePtr(), | ||
KeepExistingSiteMembership: jamfpro.TruePtr(), | ||
KeepExistingLocationInformation: jamfpro.FalsePtr(), | ||
RequireAuthentication: jamfpro.FalsePtr(), | ||
AuthenticationPrompt: "hello welcome to your enterprise managed macOS device", | ||
|
@@ -53,7 +53,6 @@ func main() { | |
EnableRecoveryLock: jamfpro.FalsePtr(), | ||
RecoveryLockPasswordType: "MANUAL", | ||
RotateRecoveryLockPassword: jamfpro.FalsePtr(), | ||
ProfileUuid: "0386E7C8D455A040106850A8A2033968", | ||
SiteId: "-1", | ||
VersionLock: currentPrestage.VersionLock, | ||
} | ||
|
27 changes: 27 additions & 0 deletions
27
...talogAppInstallerTermsAndConditions/AcceptJamfAppCatalogAppInstallerTermsAndConditions.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
"github.com/deploymenttheory/go-api-sdk-jamfpro/sdk/jamfpro" | ||
) | ||
|
||
func main() { | ||
// Define the path to the JSON configuration file | ||
configFilePath := "/Users/dafyddwatkins/localtesting/jamfpro/clientconfig.json" | ||
|
||
// Initialize the Jamf Pro client with the HTTP client configuration | ||
client, err := jamfpro.BuildClientWithConfigFile(configFilePath) | ||
if err != nil { | ||
log.Fatalf("Failed to initialize Jamf Pro client: %v", err) | ||
} | ||
|
||
// Accept the terms and conditions | ||
err = client.AcceptJamfAppCatalogAppInstallerTermsAndConditions() | ||
if err != nil { | ||
log.Fatalf("Error: %v", err) | ||
} | ||
|
||
fmt.Println("Successfully accepted Jamf App Catalog App Installer terms and conditions.") | ||
} |
33 changes: 33 additions & 0 deletions
33
...nstallerTermsAndConditionsStatus/GetJamfAppCatalogAppInstallerTermsAndConditionsStatus.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"log" | ||
|
||
"github.com/deploymenttheory/go-api-sdk-jamfpro/sdk/jamfpro" | ||
) | ||
|
||
func main() { | ||
// Define the path to the JSON configuration file | ||
configFilePath := "/Users/dafyddwatkins/localtesting/jamfpro/clientconfig.json" | ||
|
||
// Initialize the Jamf Pro client with the HTTP client configuration | ||
client, err := jamfpro.BuildClientWithConfigFile(configFilePath) | ||
if err != nil { | ||
log.Fatalf("Failed to initialize Jamf Pro client: %v", err) | ||
} | ||
|
||
// Fetch t&c status | ||
status, err := client.GetJamfAppCatalogAppInstallerTermsAndConditionsStatus() | ||
if err != nil { | ||
log.Fatalf("Error fetching Terms And Conditions Status: %v", err) | ||
} | ||
|
||
// Pretty print the fetched Terms And Conditions Status using JSON marshaling | ||
statusJSON, err := json.MarshalIndent(status, "", " ") // Indent with 4 spaces | ||
if err != nil { | ||
log.Fatalf("Error marshaling Terms And Conditions Status data: %v", err) | ||
} | ||
fmt.Println("Fetched Terms And Conditions Status:", string(statusJSON)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters