@@ -45,39 +45,21 @@ Example usage with a configuration file:
4545package main
4646
4747import (
48+ " encoding/xml"
4849 " fmt"
4950 " log"
5051
51- " github.com/deploymenttheory/go-api-http-client/httpclient"
5252 " github.com/deploymenttheory/go-api-sdk-jamfpro/sdk/jamfpro"
5353)
5454
5555func main () {
56- configFilePath := " /path/to/clientconfig.json"
57- loadedConfig , err := jamfpro.LoadClientConfig (configFilePath)
58- if err != nil {
59- log.Fatalf (" Failed to load client OAuth configuration: %v " , err)
60- }
61-
62- config := httpclient.ClientConfig {
63- Auth: httpclient.AuthConfig {
64- ClientID: loadedConfig.Auth .ClientID ,
65- ClientSecret: loadedConfig.Auth .ClientSecret ,
66- },
67- Environment: httpclient.EnvironmentConfig {
68- APIType: loadedConfig.Environment .APIType ,
69- InstanceName: loadedConfig.Environment .InstanceName ,
70- },
71- ClientOptions: httpclient.ClientOptions {
72- LogLevel: loadedConfig.ClientOptions .LogLevel ,
73- HideSensitiveData: loadedConfig.ClientOptions .HideSensitiveData ,
74- LogOutputFormat: loadedConfig.ClientOptions .LogOutputFormat ,
75- },
76- }
56+ // Define the path to the JSON configuration file
57+ configFilePath := " /path/to/your/clientconfig.json"
7758
78- client , err := jamfpro.BuildClient (config)
59+ // Initialize the Jamf Pro client with the HTTP client configuration
60+ client , err := jamfpro.BuildClientWithConfigFile (configFilePath)
7961 if err != nil {
80- log.Fatalf (" Failed to create client: %v " , err)
62+ log.Fatalf (" Failed to initialize Jamf Pro client: %v " , err)
8163 }
8264}
8365
0 commit comments