-
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 #499 from deploymenttheory/feat-recipes
Various bug fixes for computer software update structs and example tweaks
- Loading branch information
Showing
7 changed files
with
114 additions
and
86 deletions.
There are no files selected for viewing
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
33 changes: 33 additions & 0 deletions
33
...re_updates/GetManagedSoftwareUpdateFeatureToggle/GetManagedSoftwareUpdateFeatureToggle.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) | ||
} | ||
|
||
// Call GetManagedSoftwareUpdateFeatureToggle function | ||
updatePlans, err := client.GetManagedSoftwareUpdateFeatureToggle() | ||
if err != nil { | ||
log.Fatalf("Error fetching managed software updates: %v", err) | ||
} | ||
|
||
// Pretty print the managed software updates in json | ||
updateJSON, err := json.MarshalIndent(updatePlans, "", " ") // Indent with 4 spaces | ||
if err != nil { | ||
log.Fatalf("Error marshaling managed software updates data: %v", err) | ||
} | ||
fmt.Println("Fetched managed software update feature enablement status:\n", string(updateJSON)) | ||
} |
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