Skip to content

Commit 7522194

Browse files
authored
Merge branch 'main' into dev-jl-testing
2 parents 03d356b + d0685d1 commit 7522194

File tree

23 files changed

+534
-181
lines changed

23 files changed

+534
-181
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ For scenarios where you prefer not to use configuration files (e.g., in containe
6161
export BASIC_AUTH_PASSWORD="your_basic_auth_password" # Required if using basic auth
6262
export CLIENT_ID="your_client_id" # Required if using oauth2
6363
export CLIENT_SECRET="your_client_secret" # Required if using oauth2
64-
export LOG_LEVEL="LogLevelDebug" # or "LogLevelInfo" / "LogLevelWarn" / "LogLevelError" / "LogLevelFatal" / "LogLevelPanic"
64+
export LOG_LEVEL="info" # or "debug" / "info" / "warn" / "dpanic" / "error"
6565
export LOG_OUTPUT_FORMAT="pretty" # or "json"
6666
export LOG_CONSOLE_SEPARATOR=" " # or any other separator
6767
export LOG_EXPORT_PATH="/your/log/path/" # optional, ensure permissions to file path
@@ -99,7 +99,7 @@ For those who prefer using configuration files for setting up the client, the SD
9999
100100
```json
101101
{
102-
"log_level": "LogLevelDebug", // or "LogLevelInfo" / "LogLevelWarn" / "LogLevelError" / "LogLevelFatal" / "LogLevelPanic"
102+
"log_level": "info", // or "debug" / "info" / "warn" / "dpanic" / "error"
103103
"log_output_format": "pretty", // or "json"
104104
"log_console_separator": " ",
105105
"log_export_path": "/your/log/path/", // optional, ensure permissions to file path

examples/accounts/GetAccountByID/GetAccountByID.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func main() {
1919
}
2020

2121
// Define the variable for the ID number
22-
accountID := "2" // Change this value as needed
22+
accountID := "502" // Change this value as needed
2323

2424
// Call GetAccountByID function
2525
account, err := client.GetAccountByID(accountID)

examples/jamf_api_privileges/GetJamfAPIRolePrivByName/GetAPIRolePrivByName.go renamed to examples/jamf_api_privileges/GetJamfAPIRolePrivilegeByName/GetJamfAPIRolePrivilegeByName.go

File renamed without changes.

examples/jamf_content_distribution_server/DoPackageUpload/DoPackageUpload.go

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,46 +23,40 @@ func main() {
2323

2424
// Define package metadata
2525
packageData := jamfpro.ResourcePackage{
26-
Name: "Microsoft Edge",
27-
Category: "Web Browsers",
28-
// Filename is a required field to assign the uploaded JCDS2 package to the Jamf Pro package reference.
29-
// Without this field the package stays in a pending state. Value must match the filename of the file being uploaded.
30-
Filename: "microsoft-edge-121-0-2277-106.pkg",
31-
Info: "Microsoft Edge Browser Package",
32-
Notes: "Version 121.0.2277.106. This package installs Microsoft Edge on macOS devices.",
33-
Priority: 10, // Set priority (lower number means higher priority)
34-
RebootRequired: false, // Set to true if a reboot is required after installation
35-
FillUserTemplate: false, // Set to true if the package should fill the user template
36-
FillExistingUsers: false, // Set to true if the package should fill existing user directories
37-
BootVolumeRequired: true, // Set to true if the package must be installed on the boot volume
38-
AllowUninstalled: false, // Set to true if the package can be uninstalled
39-
OSRequirements: "macOS 10.15.x, macOS 11.x, macOS 12.x", // Specify OS requirements
40-
RequiredProcessor: "", // Specify if a particular processor is required, leave blank if no specific requirement
41-
SwitchWithPackage: "", // Specify package ID to switch with this package, leave blank if not applicable
42-
InstallIfReportedAvailable: false, // Set to true to install the package even if it's reported as available
43-
ReinstallOption: "Do Not Reinstall", // Specify reinstall option, possible values might include "Do Not Reinstall", "Reinstall on Same Version", or "Reinstall on Different Version"
44-
TriggeringFiles: "", // Specify triggering files, leave blank if not applicable
45-
SendNotification: false, // Set to true to send a notification when the package is deployed
26+
PackageName: "Microsoft Edge",
27+
FileName: "microsoft-edge-121-0-2277-106.pkg", // Ensure this matches the actual file name
28+
CategoryID: "1", // Set appropriate Category ID
29+
Info: "Microsoft Edge Browser Package",
30+
Notes: "Version 121.0.2277.106. This package installs Microsoft Edge on macOS devices.",
31+
Priority: 10, // Set priority (lower number means higher priority)
32+
RebootRequired: BoolPtr(false), // Set to true if a reboot is required after installation
33+
FillUserTemplate: BoolPtr(false), // Set to true if the package should fill the user template
34+
FillExistingUsers: BoolPtr(false), // Set to true if the package should fill existing user directories
35+
OSInstall: BoolPtr(true), // Set to true if this is an OS install package
36+
SuppressUpdates: BoolPtr(false), // Set to true to suppress updates
37+
SuppressFromDock: BoolPtr(false), // Set to true to suppress from dock
38+
SuppressEula: BoolPtr(false), // Set to true to suppress EULA
39+
SuppressRegistration: BoolPtr(false), // Set to true to suppress registration
40+
OSRequirements: "macOS 10.15.x, macOS 11.x, macOS 12.x", // Specify OS requirements
4641
}
4742

4843
// Call DoPackageUpload with the file path and package metadata
49-
fileResponse, packageResponse, err := client.DoPackageUpload(filePath, &packageData)
44+
uploadResponse, err := client.DoPackageUpload(filePath, &packageData)
5045
if err != nil {
5146
log.Fatalf("Failed to upload package: %v", err)
5247
}
5348

54-
// Combine responses into a single map and marshal
55-
combinedResponses := map[string]interface{}{
56-
"fileUploadResponse": fileResponse,
57-
"packageCreationResponse": packageResponse,
58-
}
59-
60-
combinedResponseBytes, err := json.Marshal(combinedResponses)
49+
// Marshal the response to JSON for output
50+
responseBytes, err := json.Marshal(uploadResponse)
6151
if err != nil {
62-
log.Fatalf("Failed to marshal DoPackageUpload responses: %v", err)
52+
log.Fatalf("Failed to marshal upload response: %v", err)
6353
}
6454

6555
// Print the response
66-
fmt.Println("Response:", string(combinedResponseBytes))
56+
fmt.Println("Response:", string(responseBytes))
57+
}
6758

59+
// Helper function to create a pointer to a bool
60+
func BoolPtr(b bool) *bool {
61+
return &b
6862
}

go.mod

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,29 @@ require (
99
)
1010

1111
require (
12-
github.com/aws/aws-sdk-go-v2 v1.30.1
13-
github.com/aws/aws-sdk-go-v2/config v1.27.23
14-
github.com/aws/aws-sdk-go-v2/credentials v1.17.23
15-
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.3
16-
github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1
12+
github.com/aws/aws-sdk-go-v2 v1.30.3
13+
github.com/aws/aws-sdk-go-v2/config v1.27.27
14+
github.com/aws/aws-sdk-go-v2/credentials v1.17.27
15+
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.10
16+
github.com/aws/aws-sdk-go-v2/service/s3 v1.58.3
1717
github.com/mitchellh/mapstructure v1.5.0
1818
howett.net/plist v1.0.1
1919
)
2020

2121
require (
2222
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 // indirect
23-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.9 // indirect
24-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13 // indirect
25-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13 // indirect
23+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect
24+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect
25+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect
2626
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
27-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.13 // indirect
27+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.15 // indirect
2828
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect
29-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.15 // indirect
30-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15 // indirect
31-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13 // indirect
32-
github.com/aws/aws-sdk-go-v2/service/sso v1.22.1 // indirect
33-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.1 // indirect
34-
github.com/aws/aws-sdk-go-v2/service/sts v1.30.1 // indirect
29+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17 // indirect
30+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect
31+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15 // indirect
32+
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 // indirect
33+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect
34+
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect
3535
github.com/aws/smithy-go v1.20.3 // indirect
3636
github.com/jmespath/go-jmespath v0.4.0 // indirect
3737
golang.org/x/text v0.17.0 // indirect

go.sum

Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,44 @@ github.com/antchfx/xmlquery v1.4.1 h1:YgpSwbeWvLp557YFTi8E3z6t6/hYjmFEtiEKbDfEbl
22
github.com/antchfx/xmlquery v1.4.1/go.mod h1:lKezcT8ELGt8kW5L+ckFMTbgdR61/odpPgDv8Gvi1fI=
33
github.com/antchfx/xpath v1.3.1 h1:PNbFuUqHwWl0xRjvUPjJ95Agbmdj2uzzIwmQKgu4oCk=
44
github.com/antchfx/xpath v1.3.1/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs=
5-
github.com/aws/aws-sdk-go-v2 v1.30.1 h1:4y/5Dvfrhd1MxRDD77SrfsDaj8kUkkljU7XE83NPV+o=
6-
github.com/aws/aws-sdk-go-v2 v1.30.1/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc=
5+
github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY=
6+
github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc=
77
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 h1:tW1/Rkad38LA15X4UQtjXZXNKsCgkshC3EbmcUmghTg=
88
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3/go.mod h1:UbnqO+zjqk3uIt9yCACHJ9IVNhyhOCnYk8yA19SAWrM=
9-
github.com/aws/aws-sdk-go-v2/config v1.27.23 h1:Cr/gJEa9NAS7CDAjbnB7tHYb3aLZI2gVggfmSAasDac=
10-
github.com/aws/aws-sdk-go-v2/config v1.27.23/go.mod h1:WMMYHqLCFu5LH05mFOF5tsq1PGEMfKbu083VKqLCd0o=
11-
github.com/aws/aws-sdk-go-v2/credentials v1.17.23 h1:G1CfmLVoO2TdQ8z9dW+JBc/r8+MqyPQhXCafNZcXVZo=
12-
github.com/aws/aws-sdk-go-v2/credentials v1.17.23/go.mod h1:V/DvSURn6kKgcuKEk4qwSwb/fZ2d++FFARtWSbXnLqY=
13-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.9 h1:Aznqksmd6Rfv2HQN9cpqIV/lQRMaIpJkLLaJ1ZI76no=
14-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.9/go.mod h1:WQr3MY7AxGNxaqAtsDWn+fBxmd4XvLkzeqQ8P1VM0/w=
15-
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.3 h1:J2mHCzCeDQNfBOas73ARi4/CsLm0wYpQ3Itll8dPDBQ=
16-
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.3/go.mod h1:6rYGWnaLHD+WRF4E709VW+HEEJPKZbNdjHgq9osFXuE=
17-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13 h1:5SAoZ4jYpGH4721ZNoS1znQrhOfZinOhc4XuTXx/nVc=
18-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13/go.mod h1:+rdA6ZLpaSeM7tSg/B0IEDinCIBJGmW8rKDFkYpP04g=
19-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13 h1:WIijqeaAO7TYFLbhsZmi2rgLEAtWOC1LhxCAVTJlSKw=
20-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13/go.mod h1:i+kbfa76PQbWw/ULoWnp51EYVWH4ENln76fLQE3lXT8=
9+
github.com/aws/aws-sdk-go-v2/config v1.27.27 h1:HdqgGt1OAP0HkEDDShEl0oSYa9ZZBSOmKpdpsDMdO90=
10+
github.com/aws/aws-sdk-go-v2/config v1.27.27/go.mod h1:MVYamCg76dFNINkZFu4n4RjDixhVr51HLj4ErWzrVwg=
11+
github.com/aws/aws-sdk-go-v2/credentials v1.17.27 h1:2raNba6gr2IfA0eqqiP2XiQ0UVOpGPgDSi0I9iAP+UI=
12+
github.com/aws/aws-sdk-go-v2/credentials v1.17.27/go.mod h1:gniiwbGahQByxan6YjQUMcW4Aov6bLC3m+evgcoN4r4=
13+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 h1:KreluoV8FZDEtI6Co2xuNk/UqI9iwMrOx/87PBNIKqw=
14+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11/go.mod h1:SeSUYBLsMYFoRvHE0Tjvn7kbxaUhl75CJi1sbfhMxkU=
15+
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.10 h1:zeN9UtUlA6FTx0vFSayxSX32HDw73Yb6Hh2izDSFxXY=
16+
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.10/go.mod h1:3HKuexPDcwLWPaqpW2UR/9n8N/u/3CKcGAzSs8p8u8g=
17+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 h1:SoNJ4RlFEQEbtDcCEt+QG56MY4fm4W8rYirAmq+/DdU=
18+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15/go.mod h1:U9ke74k1n2bf+RIgoX1SXFed1HLs51OgUSs+Ph0KJP8=
19+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 h1:C6WHdGnTDIYETAm5iErQUiVNsclNx9qbJVPIt03B6bI=
20+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15/go.mod h1:ZQLZqhcu+JhSrA9/NXRm8SkDvsycE+JkV3WGY41e+IM=
2121
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=
2222
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=
23-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.13 h1:THZJJ6TU/FOiM7DZFnisYV9d49oxXWUzsVIMTuf3VNU=
24-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.13/go.mod h1:VISUTg6n+uBaYIWPBaIG0jk7mbBxm7DUqBtU2cUDDWI=
23+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.15 h1:Z5r7SycxmSllHYmaAZPpmN8GviDrSGhMS6bldqtXZPw=
24+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.15/go.mod h1:CetW7bDE00QoGEmPUoZuRog07SGVAUVW6LFpNP0YfIg=
2525
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8=
2626
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI=
27-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.15 h1:2jyRZ9rVIMisyQRnhSS/SqlckveoxXneIumECVFP91Y=
28-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.15/go.mod h1:bDRG3m382v1KJBk1cKz7wIajg87/61EiiymEyfLvAe0=
29-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15 h1:I9zMeF107l0rJrpnHpjEiiTSCKYAIw8mALiXcPsGBiA=
30-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15/go.mod h1:9xWJ3Q/S6Ojusz1UIkfycgD1mGirJfLLKqq3LPT7WN8=
31-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13 h1:Eq2THzHt6P41mpjS2sUzz/3dJYFRqdWZ+vQaEMm98EM=
32-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13/go.mod h1:FgwTca6puegxgCInYwGjmd4tB9195Dd6LCuA+8MjpWw=
33-
github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1 h1:aHPtNY87GZ214N4rShgIo+5JQz7ICrJ50i17JbueUTw=
34-
github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1/go.mod h1:hdV0NTYd0RwV4FvNKhKUNbPLZoq9CTr/lke+3I7aCAI=
35-
github.com/aws/aws-sdk-go-v2/service/sso v1.22.1 h1:p1GahKIjyMDZtiKoIn0/jAj/TkMzfzndDv5+zi2Mhgc=
36-
github.com/aws/aws-sdk-go-v2/service/sso v1.22.1/go.mod h1:/vWdhoIoYA5hYoPZ6fm7Sv4d8701PiG5VKe8/pPJL60=
37-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.1 h1:lCEv9f8f+zJ8kcFeAjRZsekLd/x5SAm96Cva+VbUdo8=
38-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.1/go.mod h1:xyFHA4zGxgYkdD73VeezHt3vSKEG9EmFnGwoKlP00u4=
39-
github.com/aws/aws-sdk-go-v2/service/sts v1.30.1 h1:+woJ607dllHJQtsnJLi52ycuqHMwlW+Wqm2Ppsfp4nQ=
40-
github.com/aws/aws-sdk-go-v2/service/sts v1.30.1/go.mod h1:jiNR3JqT15Dm+QWq2SRgh0x0bCNSRP2L25+CqPNpJlQ=
27+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17 h1:YPYe6ZmvUfDDDELqEKtAd6bo8zxhkm+XEFEzQisqUIE=
28+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17/go.mod h1:oBtcnYua/CgzCWYN7NZ5j7PotFDaFSUjCYVTtfyn7vw=
29+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE=
30+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII=
31+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15 h1:246A4lSTXWJw/rmlQI+TT2OcqeDMKBdyjEQrafMaQdA=
32+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15/go.mod h1:haVfg3761/WF7YPuJOER2MP0k4UAXyHaLclKXB6usDg=
33+
github.com/aws/aws-sdk-go-v2/service/s3 v1.58.3 h1:hT8ZAZRIfqBqHbzKTII+CIiY8G2oC9OpLedkZ51DWl8=
34+
github.com/aws/aws-sdk-go-v2/service/s3 v1.58.3/go.mod h1:Lcxzg5rojyVPU/0eFwLtcyTaek/6Mtic5B1gJo7e/zE=
35+
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 h1:BXx0ZIxvrJdSgSvKTZ+yRBeSqqgPM89VPlulEcl37tM=
36+
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4/go.mod h1:ooyCOXjvJEsUw7x+ZDHeISPMhtwI3ZCB7ggFMcFfWLU=
37+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 h1:yiwVzJW2ZxZTurVbYWA7QOrAaCYQR72t0wrSBfoesUE=
38+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4/go.mod h1:0oxfLkpz3rQ/CHlx5hB7H69YUpFiI1tql6Q6Ne+1bCw=
39+
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 h1:ZsDKRLXGWHk8WdtyYMoGNO7bTudrvuKpDKgMVRlepGE=
40+
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3/go.mod h1:zwySh8fpFyXp9yOr/KVzxOl8SRqgf/IDw5aUt9UKFcQ=
4141
github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE=
4242
github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E=
43-
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4443
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
4544
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4645
github.com/deploymenttheory/go-api-http-client v0.2.11 h1:hEVxXX60cUxRqKkJBHADC/S91+iCPYdBIwkT6stexTY=
@@ -52,15 +51,10 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4er
5251
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
5352
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
5453
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
55-
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
56-
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
57-
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
58-
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
5954
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
6055
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
6156
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
6257
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
63-
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
6458
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
6559
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
6660
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
@@ -102,8 +96,6 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
10296
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
10397
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
10498
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg=
105-
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
106-
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
10799
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
108100
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
109101
howett.net/plist v1.0.1 h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM=

recipes/computer_history/GetAllComputerHistories/GetAllComputerHistories.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/xml"
55
"fmt"
66
"log"
7+
"strconv"
78

89
"github.com/deploymenttheory/go-api-sdk-jamfpro/sdk/jamfpro"
910
)
@@ -27,7 +28,7 @@ func main() {
2728
// Iterate through each computer to fetch its history
2829
for _, computer := range computers.Results {
2930
// Fetch computer history by ID
30-
computerHistory, err := client.GetComputerHistoryByComputerID(computer.ID)
31+
computerHistory, err := client.GetComputerHistoryByComputerID(strconv.Itoa(computer.ID))
3132
if err != nil {
3233
log.Printf("Error fetching computer history for ID %d: %v", computer.ID, err)
3334
continue

recipes/computer_history/GetAllComputersWithFailedCommands/GetAllComputersWithFailedCommands.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/xml"
55
"fmt"
66
"log"
7+
"strconv"
78

89
"github.com/deploymenttheory/go-api-sdk-jamfpro/sdk/jamfpro"
910
)
@@ -29,7 +30,7 @@ func main() {
2930
// Iterate through each computer to fetch its history
3031
for _, computer := range computers.Results {
3132
// Fetch computer history by ID
32-
computerHistory, err := client.GetComputerHistoryByComputerID(computer.ID)
33+
computerHistory, err := client.GetComputerHistoryByComputerID(strconv.Itoa(computer.ID))
3334
if err != nil {
3435
log.Printf("Error fetching computer history for ID %d: %v", computer.ID, err)
3536
continue

0 commit comments

Comments
 (0)