From e4012e7a2a0774c9c462976c0fe5ec9279ff967e Mon Sep 17 00:00:00 2001 From: Neil Martin Date: Mon, 18 May 2026 09:19:38 +0100 Subject: [PATCH] feat(classic): add advanced mobile device searches commands Adds classic-advanced-mobile-device-searches (list, get, create, update, delete, apply) via the classic spec generator. Mirrors the existing classic-advanced-computer-searches pattern. Co-Authored-By: Claude Sonnet 4.6 --- internal/commands/groups.go | 13 +- .../commands/pro/generated/backup_registry.go | 245 ++++----- ...classic_advanced_mobile_device_searches.go | 503 ++++++++++++++++++ .../pro/generated/classic_registry.go | 1 + internal/commands/pro/generated/provenance.go | 2 +- .../commands/pro/generated/smoke_registry.go | 2 + specs/classic/resources.yaml | 6 + 7 files changed, 643 insertions(+), 129 deletions(-) create mode 100644 internal/commands/pro/generated/classic_advanced_mobile_device_searches.go diff --git a/internal/commands/groups.go b/internal/commands/groups.go index b4b50fb..0ae1e6a 100644 --- a/internal/commands/groups.go +++ b/internal/commands/groups.go @@ -421,12 +421,13 @@ var proGroupMap = map[string]string{ "classic-advanced-computer-searches": groupClassicComputers, // Classic - Mobile Devices - "classic-mobile-devices": groupClassicMobile, - "classic-mobile-commands": groupClassicMobile, - "classic-mobile-config-profiles": groupClassicMobile, - "classic-mobile-provisioning-profiles": groupClassicMobile, - "classic-mobile-history": groupClassicMobile, - "classic-mobile-invitations": groupClassicMobile, + "classic-advanced-mobile-device-searches": groupClassicMobile, + "classic-mobile-devices": groupClassicMobile, + "classic-mobile-commands": groupClassicMobile, + "classic-mobile-config-profiles": groupClassicMobile, + "classic-mobile-provisioning-profiles": groupClassicMobile, + "classic-mobile-history": groupClassicMobile, + "classic-mobile-invitations": groupClassicMobile, // Classic - Configuration "classic-packages": groupClassicConfig, diff --git a/internal/commands/pro/generated/backup_registry.go b/internal/commands/pro/generated/backup_registry.go index c6b22ca..543ec82 100644 --- a/internal/commands/pro/generated/backup_registry.go +++ b/internal/commands/pro/generated/backup_registry.go @@ -39,126 +39,127 @@ type BackupEndpoint struct { // to its list+get endpoint pair. Populated at generation time from the OpenAPI // specs and Classic API manifest. var BackupEndpoints = map[string]BackupEndpoint{ - "access-managements": {ListPath: "/v4/enrollment/access-management", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "account-groups": {ListPath: "/v1/account-groups", GetPath: "/v1/account-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "account-preferences": {ListPath: "/v3/account-preferences", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "advanced-mobile-device-searches": {ListPath: "/v1/advanced-mobile-device-searches", GetPath: "/v1/advanced-mobile-device-searches/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "advanced-user-content-searches": {ListPath: "/v1/advanced-user-content-searches", GetPath: "/v1/advanced-user-content-searches/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "api-integrations": {ListPath: "/v1/api-integrations", GetPath: "/v1/api-integrations/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "api-roles": {ListPath: "/v1/api-roles", GetPath: "/v1/api-roles/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "app-installer-deployments": {ListPath: "/v1/app-installers/deployments", GetPath: "/v1/app-installers/deployments/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "app-installer-titles": {ListPath: "/v1/app-installers/titles", GetPath: "/v1/app-installers/titles/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "titleName", IDField: ""}, - "app-requests": {ListPath: "/v1/app-request/form-input-fields", GetPath: "/v1/app-request/form-input-fields/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "authentications": {ListPath: "/v1/auth", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "buildings": {ListPath: "/v1/buildings", GetPath: "/v1/buildings/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "categories": {ListPath: "/v1/categories", GetPath: "/v1/categories/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "classic-account-groups": {ListPath: "/JSSResource/accounts", GetPath: "/JSSResource/accounts/groupid/{id}", IsClassic: true, WrapperKey: "account-groups", SingularKey: "account_group", ListSubset: "groups", NameField: "", IDField: ""}, - "classic-account-users": {ListPath: "/JSSResource/accounts", GetPath: "/JSSResource/accounts/userid/{id}", IsClassic: true, WrapperKey: "account-users", SingularKey: "account_user", ListSubset: "users", NameField: "", IDField: ""}, - "classic-advanced-computer-searches": {ListPath: "/JSSResource/advancedcomputersearches", GetPath: "/JSSResource/advancedcomputersearches/id/{id}", IsClassic: true, WrapperKey: "advancedcomputersearches", SingularKey: "advanced_computer_search", ListSubset: "", NameField: "", IDField: ""}, - "classic-allowed-file-extensions": {ListPath: "/JSSResource/allowedfileextensions", GetPath: "/JSSResource/allowedfileextensions/id/{id}", IsClassic: true, WrapperKey: "allowedfileextensions", SingularKey: "allowed_file_extension", ListSubset: "", NameField: "", IDField: ""}, - "classic-classes": {ListPath: "/JSSResource/classes", GetPath: "/JSSResource/classes/id/{id}", IsClassic: true, WrapperKey: "classes", SingularKey: "class", ListSubset: "", NameField: "", IDField: ""}, - "classic-computer-configs": {ListPath: "/JSSResource/computerconfigurations", GetPath: "/JSSResource/computerconfigurations/id/{id}", IsClassic: true, WrapperKey: "computerconfigurations", SingularKey: "computer_configuration", ListSubset: "", NameField: "", IDField: ""}, - "classic-computer-ext-attrs": {ListPath: "/JSSResource/computerextensionattributes", GetPath: "/JSSResource/computerextensionattributes/id/{id}", IsClassic: true, WrapperKey: "computerextensionattributes", SingularKey: "computer_extension_attribute", ListSubset: "", NameField: "", IDField: ""}, - "classic-computer-invitations": {ListPath: "/JSSResource/computerinvitations", GetPath: "/JSSResource/computerinvitations/id/{id}", IsClassic: true, WrapperKey: "computerinvitations", SingularKey: "computer_invitation", ListSubset: "", NameField: "", IDField: ""}, - "classic-directory-bindings": {ListPath: "/JSSResource/directorybindings", GetPath: "/JSSResource/directorybindings/id/{id}", IsClassic: true, WrapperKey: "directorybindings", SingularKey: "directory_binding", ListSubset: "", NameField: "", IDField: ""}, - "classic-disk-encryption-configs": {ListPath: "/JSSResource/diskencryptionconfigurations", GetPath: "/JSSResource/diskencryptionconfigurations/id/{id}", IsClassic: true, WrapperKey: "diskencryptionconfigurations", SingularKey: "disk_encryption_configuration", ListSubset: "", NameField: "", IDField: ""}, - "classic-distribution-points": {ListPath: "/JSSResource/distributionpoints", GetPath: "/JSSResource/distributionpoints/id/{id}", IsClassic: true, WrapperKey: "distributionpoints", SingularKey: "distribution_point", ListSubset: "", NameField: "", IDField: ""}, - "classic-dock-items": {ListPath: "/JSSResource/dockitems", GetPath: "/JSSResource/dockitems/id/{id}", IsClassic: true, WrapperKey: "dockitems", SingularKey: "dock_item", ListSubset: "", NameField: "", IDField: ""}, - "classic-ebooks": {ListPath: "/JSSResource/ebooks", GetPath: "/JSSResource/ebooks/id/{id}", IsClassic: true, WrapperKey: "ebooks", SingularKey: "ebook", ListSubset: "", NameField: "", IDField: ""}, - "classic-ibeacons": {ListPath: "/JSSResource/ibeacons", GetPath: "/JSSResource/ibeacons/id/{id}", IsClassic: true, WrapperKey: "ibeacons", SingularKey: "ibeacon", ListSubset: "", NameField: "", IDField: ""}, - "classic-jwt-configs": {ListPath: "/JSSResource/jsonwebtokenconfigurations", GetPath: "/JSSResource/jsonwebtokenconfigurations/id/{id}", IsClassic: true, WrapperKey: "jsonwebtokenconfigurations", SingularKey: "json_web_token_configuration", ListSubset: "", NameField: "", IDField: ""}, - "classic-licensed-software": {ListPath: "/JSSResource/licensedsoftware", GetPath: "/JSSResource/licensedsoftware/id/{id}", IsClassic: true, WrapperKey: "licensedsoftware", SingularKey: "licensed_software", ListSubset: "", NameField: "", IDField: ""}, - "classic-mac-apps": {ListPath: "/JSSResource/macapplications", GetPath: "/JSSResource/macapplications/id/{id}", IsClassic: true, WrapperKey: "macapplications", SingularKey: "mac_application", ListSubset: "", NameField: "", IDField: ""}, - "classic-macos-config-profiles": {ListPath: "/JSSResource/osxconfigurationprofiles", GetPath: "/JSSResource/osxconfigurationprofiles/id/{id}", IsClassic: true, WrapperKey: "osxconfigurationprofiles", SingularKey: "os_x_configuration_profile", ListSubset: "", NameField: "", IDField: ""}, - "classic-mobile-apps": {ListPath: "/JSSResource/mobiledeviceapplications", GetPath: "/JSSResource/mobiledeviceapplications/id/{id}", IsClassic: true, WrapperKey: "mobiledeviceapplications", SingularKey: "mobile_device_application", ListSubset: "", NameField: "", IDField: ""}, - "classic-mobile-config-profiles": {ListPath: "/JSSResource/mobiledeviceconfigurationprofiles", GetPath: "/JSSResource/mobiledeviceconfigurationprofiles/id/{id}", IsClassic: true, WrapperKey: "mobiledeviceconfigurationprofiles", SingularKey: "configuration_profile", ListSubset: "", NameField: "", IDField: ""}, - "classic-mobile-devices": {ListPath: "/JSSResource/mobiledevices", GetPath: "/JSSResource/mobiledevices/id/{id}", IsClassic: true, WrapperKey: "mobiledevices", SingularKey: "mobile_device", ListSubset: "", NameField: "", IDField: ""}, - "classic-mobile-invitations": {ListPath: "/JSSResource/mobiledeviceinvitations", GetPath: "/JSSResource/mobiledeviceinvitations/id/{id}", IsClassic: true, WrapperKey: "mobiledeviceinvitations", SingularKey: "mobile_device_invitation", ListSubset: "", NameField: "", IDField: ""}, - "classic-mobile-provisioning-profiles": {ListPath: "/JSSResource/mobiledeviceprovisioningprofiles", GetPath: "/JSSResource/mobiledeviceprovisioningprofiles/id/{id}", IsClassic: true, WrapperKey: "mobiledeviceprovisioningprofiles", SingularKey: "mobile_device_provisioning_profile", ListSubset: "", NameField: "", IDField: ""}, - "classic-network-segments": {ListPath: "/JSSResource/networksegments", GetPath: "/JSSResource/networksegments/id/{id}", IsClassic: true, WrapperKey: "networksegments", SingularKey: "network_segment", ListSubset: "", NameField: "", IDField: ""}, - "classic-packages": {ListPath: "/JSSResource/packages", GetPath: "/JSSResource/packages/id/{id}", IsClassic: true, WrapperKey: "packages", SingularKey: "package", ListSubset: "", NameField: "", IDField: ""}, - "classic-patch-external-sources": {ListPath: "/JSSResource/patchexternalsources", GetPath: "/JSSResource/patchexternalsources/id/{id}", IsClassic: true, WrapperKey: "patchexternalsources", SingularKey: "patch_external_source", ListSubset: "", NameField: "", IDField: ""}, - "classic-patch-internal-sources": {ListPath: "/JSSResource/patchinternalsources", GetPath: "/JSSResource/patchinternalsources/id/{id}", IsClassic: true, WrapperKey: "patchinternalsources", SingularKey: "patch_internal_source", ListSubset: "", NameField: "", IDField: ""}, - "classic-patch-policies": {ListPath: "/JSSResource/patchpolicies", GetPath: "/JSSResource/patchpolicies/id/{id}", IsClassic: true, WrapperKey: "patchpolicies", SingularKey: "patch_policy", ListSubset: "", NameField: "", IDField: ""}, - "classic-patch-titles": {ListPath: "/JSSResource/patchsoftwaretitles", GetPath: "/JSSResource/patchsoftwaretitles/id/{id}", IsClassic: true, WrapperKey: "patchsoftwaretitles", SingularKey: "patch_software_title", ListSubset: "", NameField: "", IDField: ""}, - "classic-policies": {ListPath: "/JSSResource/policies", GetPath: "/JSSResource/policies/id/{id}", IsClassic: true, WrapperKey: "policies", SingularKey: "policy", ListSubset: "", NameField: "", IDField: ""}, - "classic-printers": {ListPath: "/JSSResource/printers", GetPath: "/JSSResource/printers/id/{id}", IsClassic: true, WrapperKey: "printers", SingularKey: "printer", ListSubset: "", NameField: "", IDField: ""}, - "classic-removable-mac-addresses": {ListPath: "/JSSResource/removablemacaddresses", GetPath: "/JSSResource/removablemacaddresses/id/{id}", IsClassic: true, WrapperKey: "removablemacaddresses", SingularKey: "removable_mac_address", ListSubset: "", NameField: "", IDField: ""}, - "classic-restricted-software": {ListPath: "/JSSResource/restrictedsoftware", GetPath: "/JSSResource/restrictedsoftware/id/{id}", IsClassic: true, WrapperKey: "restrictedsoftware", SingularKey: "restricted_software", ListSubset: "", NameField: "", IDField: ""}, - "classic-software-update-servers": {ListPath: "/JSSResource/softwareupdateservers", GetPath: "/JSSResource/softwareupdateservers/id/{id}", IsClassic: true, WrapperKey: "softwareupdateservers", SingularKey: "software_update_server", ListSubset: "", NameField: "", IDField: ""}, - "classic-user-ext-attrs": {ListPath: "/JSSResource/userextensionattributes", GetPath: "/JSSResource/userextensionattributes/id/{id}", IsClassic: true, WrapperKey: "userextensionattributes", SingularKey: "user_extension_attribute", ListSubset: "", NameField: "", IDField: ""}, - "classic-user-groups": {ListPath: "/JSSResource/usergroups", GetPath: "/JSSResource/usergroups/id/{id}", IsClassic: true, WrapperKey: "usergroups", SingularKey: "user_group", ListSubset: "", NameField: "", IDField: ""}, - "classic-vpp-accounts": {ListPath: "/JSSResource/vppaccounts", GetPath: "/JSSResource/vppaccounts/id/{id}", IsClassic: true, WrapperKey: "vppaccounts", SingularKey: "vpp_account", ListSubset: "", NameField: "", IDField: ""}, - "classic-vpp-assignments": {ListPath: "/JSSResource/vppassignments", GetPath: "/JSSResource/vppassignments/id/{id}", IsClassic: true, WrapperKey: "vppassignments", SingularKey: "vpp_assignment", ListSubset: "", NameField: "", IDField: ""}, - "classic-vpp-invitations": {ListPath: "/JSSResource/vppinvitations", GetPath: "/JSSResource/vppinvitations/id/{id}", IsClassic: true, WrapperKey: "vppinvitations", SingularKey: "vpp_invitation", ListSubset: "", NameField: "", IDField: ""}, - "classic-webhooks": {ListPath: "/JSSResource/webhooks", GetPath: "/JSSResource/webhooks/id/{id}", IsClassic: true, WrapperKey: "webhooks", SingularKey: "webhook", ListSubset: "", NameField: "", IDField: ""}, - "cloud-id-p-configurations": {ListPath: "/v1/cloud-idp", GetPath: "/v1/cloud-idp/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "cloud-informations": {ListPath: "/v1/cloud-information", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "computer-extension-attributes": {ListPath: "/v1/computer-extension-attributes", GetPath: "/v1/computer-extension-attributes/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "computer-groups": {ListPath: "/v1/computer-groups", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "computer-inventory-collection-settings": {ListPath: "/v2/computer-inventory-collection-settings", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "computer-prestage-scopes": {ListPath: "/v2/computer-prestages/scope", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "computer-prestages": {ListPath: "/v3/computer-prestages", GetPath: "/v3/computer-prestages/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "computers": {ListPath: "/preview/computers", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "computers-inventory": {ListPath: "/v3/computers-inventory", GetPath: "/v3/computers-inventory/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "general.name", IDField: ""}, - "country-codes": {ListPath: "/v1/app-store-country-codes", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "dashboards": {ListPath: "/v1/dashboard", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "departments": {ListPath: "/v1/departments", GetPath: "/v1/departments/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "device-compliance-informations": {ListPath: "/v1/conditional-access/device-compliance/feature-toggle", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: "deviceId"}, - "device-enrollment-instance-sync-states": {ListPath: "/v1/device-enrollments/syncs", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "device-enrollment-instances": {ListPath: "/v1/device-enrollments", GetPath: "/v1/device-enrollments/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "distribution-points": {ListPath: "/v1/distribution-points", GetPath: "/v1/distribution-points/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "ebooks": {ListPath: "/v1/ebooks", GetPath: "/v1/ebooks/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "enrollment-customizations": {ListPath: "/v2/enrollment-customizations", GetPath: "/v2/enrollment-customizations/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "enrollment-languages": {ListPath: "/v3/enrollment/languages", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: "languageCode"}, - "enrollment-settings": {ListPath: "/v3/enrollment/access-groups", GetPath: "/v3/enrollment/access-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "groups": {ListPath: "/v1/groups", GetPath: "/v1/groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "groupName", IDField: "groupPlatformId"}, - "inventory-informations": {ListPath: "/v1/inventory-information", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "inventory-preloads": {ListPath: "/v2/inventory-preload/records", GetPath: "/v2/inventory-preload/records/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "serialNumber", IDField: ""}, - "jamf-connects": {ListPath: "/v1/jamf-connect/config-profiles", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "jamf-packages": {ListPath: "/v2/jamf-package", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "jamf-pro-informations": {ListPath: "/v2/jamf-pro-information", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "jamf-pro-versions": {ListPath: "/v1/jamf-pro-version", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "jamf-protect-plans": {ListPath: "/v1/jamf-protect/plans", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "jamf-remote-assist-session-histories": {ListPath: "/v2/jamf-remote-assist/session", GetPath: "/v2/jamf-remote-assist/session/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "jcds": {ListPath: "/v1/jcds/files", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: "fileName"}, - "last-logins": {ListPath: "/v1/last-login", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "locales": {ListPath: "/v1/locales", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "log-flushings": {ListPath: "/v1/log-flushing/task", GetPath: "/v1/log-flushing/task/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "mac-os-managed-software-updates": {ListPath: "/v1/macos-managed-software-updates/available-updates", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "managed-software-updates-plans": {ListPath: "/v1/managed-software-updates/plans", GetPath: "/v1/managed-software-updates/plans/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "mdm-commands": {ListPath: "/v2/mdm/commands", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "mobile-device-extension-attributes": {ListPath: "/v1/mobile-device-extension-attributes", GetPath: "/v1/mobile-device-extension-attributes/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "mobile-device-groups": {ListPath: "/v1/mobile-device-groups", GetPath: "/v1/mobile-device-groups/smart-group-membership/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "mobile-device-groups-smart-groups": {ListPath: "/v1/mobile-device-groups/smart-groups", GetPath: "/v1/mobile-device-groups/smart-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "groupName", IDField: "groupId"}, - "mobile-device-groups-static-groups": {ListPath: "/v1/mobile-device-groups/static-groups", GetPath: "/v1/mobile-device-groups/static-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "groupName", IDField: "groupId"}, - "mobile-device-inventory-details": {ListPath: "/v2/mobile-devices/detail", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "mobile-device-prestage-scopes": {ListPath: "/v2/mobile-device-prestages/scope", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "mobile-device-prestage-sync-states": {ListPath: "/v2/mobile-device-prestages/syncs", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "mobile-device-prestages": {ListPath: "/v3/mobile-device-prestages", GetPath: "/v3/mobile-device-prestages/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "mobile-devices": {ListPath: "/v2/mobile-devices/detail", GetPath: "/v2/mobile-devices/{id}/detail", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "notifications": {ListPath: "/v1/notifications", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "oauth-token-sessions": {ListPath: "/v1/oauth2/session-tokens", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "packages": {ListPath: "/v1/packages", GetPath: "/v1/packages/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "packageName", IDField: ""}, - "patch-policies": {ListPath: "/v2/patch-policies", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "patch-software-title-configurations": {ListPath: "/v2/patch-software-title-configurations", GetPath: "/v2/patch-software-title-configurations/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "remote-administration-configurations": {ListPath: "/preview/remote-administration-configurations", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "return-to-service-configurations": {ListPath: "/v1/return-to-service", GetPath: "/v1/return-to-service/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "schedulers": {ListPath: "/v1/scheduler/jobs", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "scripts": {ListPath: "/v1/scripts", GetPath: "/v1/scripts/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "self-service-branding-ios": {ListPath: "/v1/self-service/branding/ios", GetPath: "/v1/self-service/branding/ios/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "brandingName", IDField: ""}, - "self-service-branding-macos": {ListPath: "/v1/self-service/branding/macos", GetPath: "/v1/self-service/branding/macos/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "brandingName", IDField: ""}, - "sites": {ListPath: "/v1/sites", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "slasas": {ListPath: "/v1/slasa", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "smart-computer-groups": {ListPath: "/v2/computer-groups/smart-groups", GetPath: "/v2/computer-groups/smart-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "sso-failovers": {ListPath: "/v1/sso/failover", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "startup-status": {ListPath: "/startup-status", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "static-computer-groups": {ListPath: "/v2/computer-groups/static-groups", GetPath: "/v2/computer-groups/static-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "static-user-groups": {ListPath: "/v1/static-user-groups", GetPath: "/v1/static-user-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "supervision-identities": {ListPath: "/v1/supervision-identities", GetPath: "/v1/supervision-identities/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "time-zones": {ListPath: "/v1/time-zones", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, - "user-accounts": {ListPath: "/v1/accounts", GetPath: "/v1/accounts/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "username", IDField: ""}, - "users": {ListPath: "/v1/users", GetPath: "/v1/users/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "username", IDField: ""}, - "vpp-locations": {ListPath: "/v1/volume-purchasing-locations", GetPath: "/v1/volume-purchasing-locations/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, - "vpp-subscriptions": {ListPath: "/v1/volume-purchasing-subscriptions", GetPath: "/v1/volume-purchasing-subscriptions/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "access-managements": {ListPath: "/v4/enrollment/access-management", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "account-groups": {ListPath: "/v1/account-groups", GetPath: "/v1/account-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "account-preferences": {ListPath: "/v3/account-preferences", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "advanced-mobile-device-searches": {ListPath: "/v1/advanced-mobile-device-searches", GetPath: "/v1/advanced-mobile-device-searches/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "advanced-user-content-searches": {ListPath: "/v1/advanced-user-content-searches", GetPath: "/v1/advanced-user-content-searches/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "api-integrations": {ListPath: "/v1/api-integrations", GetPath: "/v1/api-integrations/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "api-roles": {ListPath: "/v1/api-roles", GetPath: "/v1/api-roles/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "app-installer-deployments": {ListPath: "/v1/app-installers/deployments", GetPath: "/v1/app-installers/deployments/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "app-installer-titles": {ListPath: "/v1/app-installers/titles", GetPath: "/v1/app-installers/titles/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "titleName", IDField: ""}, + "app-requests": {ListPath: "/v1/app-request/form-input-fields", GetPath: "/v1/app-request/form-input-fields/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "authentications": {ListPath: "/v1/auth", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "buildings": {ListPath: "/v1/buildings", GetPath: "/v1/buildings/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "categories": {ListPath: "/v1/categories", GetPath: "/v1/categories/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "classic-account-groups": {ListPath: "/JSSResource/accounts", GetPath: "/JSSResource/accounts/groupid/{id}", IsClassic: true, WrapperKey: "account-groups", SingularKey: "account_group", ListSubset: "groups", NameField: "", IDField: ""}, + "classic-account-users": {ListPath: "/JSSResource/accounts", GetPath: "/JSSResource/accounts/userid/{id}", IsClassic: true, WrapperKey: "account-users", SingularKey: "account_user", ListSubset: "users", NameField: "", IDField: ""}, + "classic-advanced-computer-searches": {ListPath: "/JSSResource/advancedcomputersearches", GetPath: "/JSSResource/advancedcomputersearches/id/{id}", IsClassic: true, WrapperKey: "advancedcomputersearches", SingularKey: "advanced_computer_search", ListSubset: "", NameField: "", IDField: ""}, + "classic-advanced-mobile-device-searches": {ListPath: "/JSSResource/advancedmobiledevicesearches", GetPath: "/JSSResource/advancedmobiledevicesearches/id/{id}", IsClassic: true, WrapperKey: "advancedmobiledevicesearches", SingularKey: "advanced_mobile_device_search", ListSubset: "", NameField: "", IDField: ""}, + "classic-allowed-file-extensions": {ListPath: "/JSSResource/allowedfileextensions", GetPath: "/JSSResource/allowedfileextensions/id/{id}", IsClassic: true, WrapperKey: "allowedfileextensions", SingularKey: "allowed_file_extension", ListSubset: "", NameField: "", IDField: ""}, + "classic-classes": {ListPath: "/JSSResource/classes", GetPath: "/JSSResource/classes/id/{id}", IsClassic: true, WrapperKey: "classes", SingularKey: "class", ListSubset: "", NameField: "", IDField: ""}, + "classic-computer-configs": {ListPath: "/JSSResource/computerconfigurations", GetPath: "/JSSResource/computerconfigurations/id/{id}", IsClassic: true, WrapperKey: "computerconfigurations", SingularKey: "computer_configuration", ListSubset: "", NameField: "", IDField: ""}, + "classic-computer-ext-attrs": {ListPath: "/JSSResource/computerextensionattributes", GetPath: "/JSSResource/computerextensionattributes/id/{id}", IsClassic: true, WrapperKey: "computerextensionattributes", SingularKey: "computer_extension_attribute", ListSubset: "", NameField: "", IDField: ""}, + "classic-computer-invitations": {ListPath: "/JSSResource/computerinvitations", GetPath: "/JSSResource/computerinvitations/id/{id}", IsClassic: true, WrapperKey: "computerinvitations", SingularKey: "computer_invitation", ListSubset: "", NameField: "", IDField: ""}, + "classic-directory-bindings": {ListPath: "/JSSResource/directorybindings", GetPath: "/JSSResource/directorybindings/id/{id}", IsClassic: true, WrapperKey: "directorybindings", SingularKey: "directory_binding", ListSubset: "", NameField: "", IDField: ""}, + "classic-disk-encryption-configs": {ListPath: "/JSSResource/diskencryptionconfigurations", GetPath: "/JSSResource/diskencryptionconfigurations/id/{id}", IsClassic: true, WrapperKey: "diskencryptionconfigurations", SingularKey: "disk_encryption_configuration", ListSubset: "", NameField: "", IDField: ""}, + "classic-distribution-points": {ListPath: "/JSSResource/distributionpoints", GetPath: "/JSSResource/distributionpoints/id/{id}", IsClassic: true, WrapperKey: "distributionpoints", SingularKey: "distribution_point", ListSubset: "", NameField: "", IDField: ""}, + "classic-dock-items": {ListPath: "/JSSResource/dockitems", GetPath: "/JSSResource/dockitems/id/{id}", IsClassic: true, WrapperKey: "dockitems", SingularKey: "dock_item", ListSubset: "", NameField: "", IDField: ""}, + "classic-ebooks": {ListPath: "/JSSResource/ebooks", GetPath: "/JSSResource/ebooks/id/{id}", IsClassic: true, WrapperKey: "ebooks", SingularKey: "ebook", ListSubset: "", NameField: "", IDField: ""}, + "classic-ibeacons": {ListPath: "/JSSResource/ibeacons", GetPath: "/JSSResource/ibeacons/id/{id}", IsClassic: true, WrapperKey: "ibeacons", SingularKey: "ibeacon", ListSubset: "", NameField: "", IDField: ""}, + "classic-jwt-configs": {ListPath: "/JSSResource/jsonwebtokenconfigurations", GetPath: "/JSSResource/jsonwebtokenconfigurations/id/{id}", IsClassic: true, WrapperKey: "jsonwebtokenconfigurations", SingularKey: "json_web_token_configuration", ListSubset: "", NameField: "", IDField: ""}, + "classic-licensed-software": {ListPath: "/JSSResource/licensedsoftware", GetPath: "/JSSResource/licensedsoftware/id/{id}", IsClassic: true, WrapperKey: "licensedsoftware", SingularKey: "licensed_software", ListSubset: "", NameField: "", IDField: ""}, + "classic-mac-apps": {ListPath: "/JSSResource/macapplications", GetPath: "/JSSResource/macapplications/id/{id}", IsClassic: true, WrapperKey: "macapplications", SingularKey: "mac_application", ListSubset: "", NameField: "", IDField: ""}, + "classic-macos-config-profiles": {ListPath: "/JSSResource/osxconfigurationprofiles", GetPath: "/JSSResource/osxconfigurationprofiles/id/{id}", IsClassic: true, WrapperKey: "osxconfigurationprofiles", SingularKey: "os_x_configuration_profile", ListSubset: "", NameField: "", IDField: ""}, + "classic-mobile-apps": {ListPath: "/JSSResource/mobiledeviceapplications", GetPath: "/JSSResource/mobiledeviceapplications/id/{id}", IsClassic: true, WrapperKey: "mobiledeviceapplications", SingularKey: "mobile_device_application", ListSubset: "", NameField: "", IDField: ""}, + "classic-mobile-config-profiles": {ListPath: "/JSSResource/mobiledeviceconfigurationprofiles", GetPath: "/JSSResource/mobiledeviceconfigurationprofiles/id/{id}", IsClassic: true, WrapperKey: "mobiledeviceconfigurationprofiles", SingularKey: "configuration_profile", ListSubset: "", NameField: "", IDField: ""}, + "classic-mobile-devices": {ListPath: "/JSSResource/mobiledevices", GetPath: "/JSSResource/mobiledevices/id/{id}", IsClassic: true, WrapperKey: "mobiledevices", SingularKey: "mobile_device", ListSubset: "", NameField: "", IDField: ""}, + "classic-mobile-invitations": {ListPath: "/JSSResource/mobiledeviceinvitations", GetPath: "/JSSResource/mobiledeviceinvitations/id/{id}", IsClassic: true, WrapperKey: "mobiledeviceinvitations", SingularKey: "mobile_device_invitation", ListSubset: "", NameField: "", IDField: ""}, + "classic-mobile-provisioning-profiles": {ListPath: "/JSSResource/mobiledeviceprovisioningprofiles", GetPath: "/JSSResource/mobiledeviceprovisioningprofiles/id/{id}", IsClassic: true, WrapperKey: "mobiledeviceprovisioningprofiles", SingularKey: "mobile_device_provisioning_profile", ListSubset: "", NameField: "", IDField: ""}, + "classic-network-segments": {ListPath: "/JSSResource/networksegments", GetPath: "/JSSResource/networksegments/id/{id}", IsClassic: true, WrapperKey: "networksegments", SingularKey: "network_segment", ListSubset: "", NameField: "", IDField: ""}, + "classic-packages": {ListPath: "/JSSResource/packages", GetPath: "/JSSResource/packages/id/{id}", IsClassic: true, WrapperKey: "packages", SingularKey: "package", ListSubset: "", NameField: "", IDField: ""}, + "classic-patch-external-sources": {ListPath: "/JSSResource/patchexternalsources", GetPath: "/JSSResource/patchexternalsources/id/{id}", IsClassic: true, WrapperKey: "patchexternalsources", SingularKey: "patch_external_source", ListSubset: "", NameField: "", IDField: ""}, + "classic-patch-internal-sources": {ListPath: "/JSSResource/patchinternalsources", GetPath: "/JSSResource/patchinternalsources/id/{id}", IsClassic: true, WrapperKey: "patchinternalsources", SingularKey: "patch_internal_source", ListSubset: "", NameField: "", IDField: ""}, + "classic-patch-policies": {ListPath: "/JSSResource/patchpolicies", GetPath: "/JSSResource/patchpolicies/id/{id}", IsClassic: true, WrapperKey: "patchpolicies", SingularKey: "patch_policy", ListSubset: "", NameField: "", IDField: ""}, + "classic-patch-titles": {ListPath: "/JSSResource/patchsoftwaretitles", GetPath: "/JSSResource/patchsoftwaretitles/id/{id}", IsClassic: true, WrapperKey: "patchsoftwaretitles", SingularKey: "patch_software_title", ListSubset: "", NameField: "", IDField: ""}, + "classic-policies": {ListPath: "/JSSResource/policies", GetPath: "/JSSResource/policies/id/{id}", IsClassic: true, WrapperKey: "policies", SingularKey: "policy", ListSubset: "", NameField: "", IDField: ""}, + "classic-printers": {ListPath: "/JSSResource/printers", GetPath: "/JSSResource/printers/id/{id}", IsClassic: true, WrapperKey: "printers", SingularKey: "printer", ListSubset: "", NameField: "", IDField: ""}, + "classic-removable-mac-addresses": {ListPath: "/JSSResource/removablemacaddresses", GetPath: "/JSSResource/removablemacaddresses/id/{id}", IsClassic: true, WrapperKey: "removablemacaddresses", SingularKey: "removable_mac_address", ListSubset: "", NameField: "", IDField: ""}, + "classic-restricted-software": {ListPath: "/JSSResource/restrictedsoftware", GetPath: "/JSSResource/restrictedsoftware/id/{id}", IsClassic: true, WrapperKey: "restrictedsoftware", SingularKey: "restricted_software", ListSubset: "", NameField: "", IDField: ""}, + "classic-software-update-servers": {ListPath: "/JSSResource/softwareupdateservers", GetPath: "/JSSResource/softwareupdateservers/id/{id}", IsClassic: true, WrapperKey: "softwareupdateservers", SingularKey: "software_update_server", ListSubset: "", NameField: "", IDField: ""}, + "classic-user-ext-attrs": {ListPath: "/JSSResource/userextensionattributes", GetPath: "/JSSResource/userextensionattributes/id/{id}", IsClassic: true, WrapperKey: "userextensionattributes", SingularKey: "user_extension_attribute", ListSubset: "", NameField: "", IDField: ""}, + "classic-user-groups": {ListPath: "/JSSResource/usergroups", GetPath: "/JSSResource/usergroups/id/{id}", IsClassic: true, WrapperKey: "usergroups", SingularKey: "user_group", ListSubset: "", NameField: "", IDField: ""}, + "classic-vpp-accounts": {ListPath: "/JSSResource/vppaccounts", GetPath: "/JSSResource/vppaccounts/id/{id}", IsClassic: true, WrapperKey: "vppaccounts", SingularKey: "vpp_account", ListSubset: "", NameField: "", IDField: ""}, + "classic-vpp-assignments": {ListPath: "/JSSResource/vppassignments", GetPath: "/JSSResource/vppassignments/id/{id}", IsClassic: true, WrapperKey: "vppassignments", SingularKey: "vpp_assignment", ListSubset: "", NameField: "", IDField: ""}, + "classic-vpp-invitations": {ListPath: "/JSSResource/vppinvitations", GetPath: "/JSSResource/vppinvitations/id/{id}", IsClassic: true, WrapperKey: "vppinvitations", SingularKey: "vpp_invitation", ListSubset: "", NameField: "", IDField: ""}, + "classic-webhooks": {ListPath: "/JSSResource/webhooks", GetPath: "/JSSResource/webhooks/id/{id}", IsClassic: true, WrapperKey: "webhooks", SingularKey: "webhook", ListSubset: "", NameField: "", IDField: ""}, + "cloud-id-p-configurations": {ListPath: "/v1/cloud-idp", GetPath: "/v1/cloud-idp/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "cloud-informations": {ListPath: "/v1/cloud-information", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "computer-extension-attributes": {ListPath: "/v1/computer-extension-attributes", GetPath: "/v1/computer-extension-attributes/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "computer-groups": {ListPath: "/v1/computer-groups", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "computer-inventory-collection-settings": {ListPath: "/v2/computer-inventory-collection-settings", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "computer-prestage-scopes": {ListPath: "/v2/computer-prestages/scope", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "computer-prestages": {ListPath: "/v3/computer-prestages", GetPath: "/v3/computer-prestages/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "computers": {ListPath: "/preview/computers", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "computers-inventory": {ListPath: "/v3/computers-inventory", GetPath: "/v3/computers-inventory/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "general.name", IDField: ""}, + "country-codes": {ListPath: "/v1/app-store-country-codes", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "dashboards": {ListPath: "/v1/dashboard", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "departments": {ListPath: "/v1/departments", GetPath: "/v1/departments/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "device-compliance-informations": {ListPath: "/v1/conditional-access/device-compliance/feature-toggle", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: "deviceId"}, + "device-enrollment-instance-sync-states": {ListPath: "/v1/device-enrollments/syncs", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "device-enrollment-instances": {ListPath: "/v1/device-enrollments", GetPath: "/v1/device-enrollments/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "distribution-points": {ListPath: "/v1/distribution-points", GetPath: "/v1/distribution-points/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "ebooks": {ListPath: "/v1/ebooks", GetPath: "/v1/ebooks/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "enrollment-customizations": {ListPath: "/v2/enrollment-customizations", GetPath: "/v2/enrollment-customizations/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "enrollment-languages": {ListPath: "/v3/enrollment/languages", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: "languageCode"}, + "enrollment-settings": {ListPath: "/v3/enrollment/access-groups", GetPath: "/v3/enrollment/access-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "groups": {ListPath: "/v1/groups", GetPath: "/v1/groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "groupName", IDField: "groupPlatformId"}, + "inventory-informations": {ListPath: "/v1/inventory-information", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "inventory-preloads": {ListPath: "/v2/inventory-preload/records", GetPath: "/v2/inventory-preload/records/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "serialNumber", IDField: ""}, + "jamf-connects": {ListPath: "/v1/jamf-connect/config-profiles", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "jamf-packages": {ListPath: "/v2/jamf-package", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "jamf-pro-informations": {ListPath: "/v2/jamf-pro-information", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "jamf-pro-versions": {ListPath: "/v1/jamf-pro-version", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "jamf-protect-plans": {ListPath: "/v1/jamf-protect/plans", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "jamf-remote-assist-session-histories": {ListPath: "/v2/jamf-remote-assist/session", GetPath: "/v2/jamf-remote-assist/session/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "jcds": {ListPath: "/v1/jcds/files", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: "fileName"}, + "last-logins": {ListPath: "/v1/last-login", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "locales": {ListPath: "/v1/locales", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "log-flushings": {ListPath: "/v1/log-flushing/task", GetPath: "/v1/log-flushing/task/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "mac-os-managed-software-updates": {ListPath: "/v1/macos-managed-software-updates/available-updates", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "managed-software-updates-plans": {ListPath: "/v1/managed-software-updates/plans", GetPath: "/v1/managed-software-updates/plans/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "mdm-commands": {ListPath: "/v2/mdm/commands", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "mobile-device-extension-attributes": {ListPath: "/v1/mobile-device-extension-attributes", GetPath: "/v1/mobile-device-extension-attributes/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "mobile-device-groups": {ListPath: "/v1/mobile-device-groups", GetPath: "/v1/mobile-device-groups/smart-group-membership/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "mobile-device-groups-smart-groups": {ListPath: "/v1/mobile-device-groups/smart-groups", GetPath: "/v1/mobile-device-groups/smart-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "groupName", IDField: "groupId"}, + "mobile-device-groups-static-groups": {ListPath: "/v1/mobile-device-groups/static-groups", GetPath: "/v1/mobile-device-groups/static-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "groupName", IDField: "groupId"}, + "mobile-device-inventory-details": {ListPath: "/v2/mobile-devices/detail", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "mobile-device-prestage-scopes": {ListPath: "/v2/mobile-device-prestages/scope", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "mobile-device-prestage-sync-states": {ListPath: "/v2/mobile-device-prestages/syncs", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "mobile-device-prestages": {ListPath: "/v3/mobile-device-prestages", GetPath: "/v3/mobile-device-prestages/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "mobile-devices": {ListPath: "/v2/mobile-devices/detail", GetPath: "/v2/mobile-devices/{id}/detail", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "notifications": {ListPath: "/v1/notifications", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "oauth-token-sessions": {ListPath: "/v1/oauth2/session-tokens", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "packages": {ListPath: "/v1/packages", GetPath: "/v1/packages/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "packageName", IDField: ""}, + "patch-policies": {ListPath: "/v2/patch-policies", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "patch-software-title-configurations": {ListPath: "/v2/patch-software-title-configurations", GetPath: "/v2/patch-software-title-configurations/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "remote-administration-configurations": {ListPath: "/preview/remote-administration-configurations", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "return-to-service-configurations": {ListPath: "/v1/return-to-service", GetPath: "/v1/return-to-service/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "schedulers": {ListPath: "/v1/scheduler/jobs", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "scripts": {ListPath: "/v1/scripts", GetPath: "/v1/scripts/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "self-service-branding-ios": {ListPath: "/v1/self-service/branding/ios", GetPath: "/v1/self-service/branding/ios/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "brandingName", IDField: ""}, + "self-service-branding-macos": {ListPath: "/v1/self-service/branding/macos", GetPath: "/v1/self-service/branding/macos/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "brandingName", IDField: ""}, + "sites": {ListPath: "/v1/sites", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "slasas": {ListPath: "/v1/slasa", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "smart-computer-groups": {ListPath: "/v2/computer-groups/smart-groups", GetPath: "/v2/computer-groups/smart-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "sso-failovers": {ListPath: "/v1/sso/failover", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "startup-status": {ListPath: "/startup-status", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "static-computer-groups": {ListPath: "/v2/computer-groups/static-groups", GetPath: "/v2/computer-groups/static-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "static-user-groups": {ListPath: "/v1/static-user-groups", GetPath: "/v1/static-user-groups/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "supervision-identities": {ListPath: "/v1/supervision-identities", GetPath: "/v1/supervision-identities/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "time-zones": {ListPath: "/v1/time-zones", GetPath: "", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "displayName", IDField: ""}, + "user-accounts": {ListPath: "/v1/accounts", GetPath: "/v1/accounts/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "username", IDField: ""}, + "users": {ListPath: "/v1/users", GetPath: "/v1/users/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "username", IDField: ""}, + "vpp-locations": {ListPath: "/v1/volume-purchasing-locations", GetPath: "/v1/volume-purchasing-locations/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, + "vpp-subscriptions": {ListPath: "/v1/volume-purchasing-subscriptions", GetPath: "/v1/volume-purchasing-subscriptions/{id}", IsClassic: false, WrapperKey: "", SingularKey: "", ListSubset: "", NameField: "", IDField: ""}, } diff --git a/internal/commands/pro/generated/classic_advanced_mobile_device_searches.go b/internal/commands/pro/generated/classic_advanced_mobile_device_searches.go new file mode 100644 index 0000000..e0da37a --- /dev/null +++ b/internal/commands/pro/generated/classic_advanced_mobile_device_searches.go @@ -0,0 +1,503 @@ +// Copyright 2026, Jamf Software LLC +// Code generated by jamf-cli generator (classic). DO NOT EDIT. +package generated + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "os" + + "github.com/Jamf-Concepts/jamf-cli/internal/cooldown" + "github.com/Jamf-Concepts/jamf-cli/internal/registry" + "github.com/Jamf-Concepts/jamf-cli/internal/xmlconv" + "github.com/spf13/cobra" +) + +// NewClassicAdvancedMobileDeviceSearchesCmd creates the classic-advanced-mobile-device-searches command group +func NewClassicAdvancedMobileDeviceSearchesCmd(ctx *registry.CLIContext) *cobra.Command { + cmd := &cobra.Command{ + Use: "classic-advanced-mobile-device-searches", + Short: "Advanced mobile device searches (Classic API)", + Long: `Manage advanced mobile device searches via the Jamf Pro Classic API (/JSSResource/).`, + } + + cmd.AddCommand(newClassicAdvancedMobileDeviceSearchesListCmd(ctx)) + + cmd.AddCommand(newClassicAdvancedMobileDeviceSearchesGetCmd(ctx)) + + cmd.AddCommand(newClassicAdvancedMobileDeviceSearchesCreateCmd(ctx)) + + cmd.AddCommand(newClassicAdvancedMobileDeviceSearchesUpdateCmd(ctx)) + + cmd.AddCommand(newClassicAdvancedMobileDeviceSearchesDeleteCmd(ctx)) + + cmd.AddCommand(newClassicAdvancedMobileDeviceSearchesApplyCmd(ctx)) + + return cmd +} + +func newClassicAdvancedMobileDeviceSearchesListCmd(ctx *registry.CLIContext) *cobra.Command { + return &cobra.Command{ + Use: "list", + Short: "List all advancedmobiledevicesearches", + Example: ` # List all advancedmobiledevicesearches + jamf-cli pro classic-advanced-mobile-device-searches list + + # List advancedmobiledevicesearches and extract IDs + jamf-cli pro classic-advanced-mobile-device-searches list --field id`, + RunE: func(cmd *cobra.Command, args []string) error { + reqCtx := cmd.Context() + resp, err := ctx.Client.Do(reqCtx, "GET", "/JSSResource/advancedmobiledevicesearches", nil) + if err != nil { + return err + } + defer resp.Body.Close() + + // Classic API returns XML list responses. + body, err := io.ReadAll(resp.Body) + if err != nil { + return err + } + // Default to pretty-printed XML; use -o json/yaml/table/csv for structured output. + // -o xml = pretty-printed XML, -o raw = exact wire bytes. + if (!cmd.Flags().Changed("output") && !cmd.Flags().Changed("field") && ctx.Output.Format() == "json") || ctx.Output.Format() == "xml" || ctx.Output.Format() == "raw" { + return ctx.Output.PrintBytes(body) + } + if xmlconv.IsXML(body) { + items, err := xmlconv.ExtractListItems(body) + if err == nil { + jsonItems, err := json.Marshal(items) + if err == nil { + return ctx.Output.PrintRaw(jsonItems) + } + } + return ctx.Output.PrintRaw(body) + } + // JSON fallback + var wrapper map[string]json.RawMessage + if err := json.Unmarshal(body, &wrapper); err == nil { + if inner, ok := wrapper["advancedmobiledevicesearches"]; ok { + return ctx.Output.PrintRaw(inner) + } + } + return ctx.Output.PrintRaw(body) + }, + } +} + +func newClassicAdvancedMobileDeviceSearchesGetCmd(ctx *registry.CLIContext) *cobra.Command { + var ( + flagName string + ) + + cmd := &cobra.Command{ + Use: "get []", + Short: "Get a advanced_mobile_device_search by ID", + Example: ` # Get a advanced_mobile_device_search by ID + jamf-cli pro classic-advanced-mobile-device-searches get 1 + + # Get a advanced_mobile_device_search by name + jamf-cli pro classic-advanced-mobile-device-searches get --name "Example" + + # Get a advanced_mobile_device_search and output as YAML + jamf-cli pro classic-advanced-mobile-device-searches get 1 -o yaml`, + Args: cobra.MaximumNArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + reqCtx := cmd.Context() + + // Resolve lookup: check flags first, then positional ID + var path string + if flagName != "" { + path = fmt.Sprintf("/JSSResource/advancedmobiledevicesearches/name/%s", url.PathEscape(flagName)) + } else if len(args) > 0 { + path = fmt.Sprintf("/JSSResource/advancedmobiledevicesearches/id/%s", url.PathEscape(args[0])) + } else { + return fmt.Errorf("provide an argument, --name") + } + + resp, err := ctx.Client.Do(reqCtx, "GET", path, nil) + if err != nil { + return err + } + defer resp.Body.Close() + + // Classic API returns XML; pass through by default. + body, err := io.ReadAll(resp.Body) + if err != nil { + return err + } + // Default to pretty-printed XML; use -o json/yaml/table/csv for structured output. + // -o xml = pretty-printed XML, -o raw = exact wire bytes. + if (!cmd.Flags().Changed("output") && !cmd.Flags().Changed("field") && ctx.Output.Format() == "json") || ctx.Output.Format() == "xml" || ctx.Output.Format() == "raw" { + return ctx.Output.PrintBytes(body) + } + if xmlconv.IsXML(body) { + if jsonBody, err := xmlconv.ToJSON(body); err == nil { + body = jsonBody + } + } + var wrapper map[string]json.RawMessage + if err := json.Unmarshal(body, &wrapper); err == nil { + if inner, ok := wrapper["advanced_mobile_device_search"]; ok { + return ctx.Output.PrintRaw(inner) + } + } + return ctx.Output.PrintRaw(body) + }, + } + + cmd.Flags().StringVar(&flagName, "name", "", "Look up advanced_mobile_device_search by name") + + return cmd +} + +func newClassicAdvancedMobileDeviceSearchesCreateCmd(ctx *registry.CLIContext) *cobra.Command { + cmd := &cobra.Command{ + Use: "create", + Short: "Create a advanced_mobile_device_search", + Long: "Create a new advanced_mobile_device_search. Reads XML body from stdin.", + Example: ` # Create a advanced_mobile_device_search from XML + cat advanced_mobile_device_search.xml | jamf-cli pro classic-advanced-mobile-device-searches create`, + RunE: func(cmd *cobra.Command, args []string) error { + reqCtx := cmd.Context() + + var body io.Reader + stat, _ := os.Stdin.Stat() + if (stat.Mode() & os.ModeCharDevice) == 0 { + body = os.Stdin + } else { + return fmt.Errorf("request body required on stdin (pipe XML input)") + } + + resp, err := ctx.Client.Do(reqCtx, "POST", "/JSSResource/advancedmobiledevicesearches/id/0", body) + + if err != nil { + return err + } + defer resp.Body.Close() + + return ctx.Output.PrintResponse(resp) + }, + } + return cmd +} + +func newClassicAdvancedMobileDeviceSearchesUpdateCmd(ctx *registry.CLIContext) *cobra.Command { + var flagName string + + cmd := &cobra.Command{ + Use: "update []", + Short: "Update a advanced_mobile_device_search", + Long: "Update an existing advanced_mobile_device_search by ID. Reads XML body from stdin.", + Example: ` # Update a advanced_mobile_device_search from XML + cat advanced_mobile_device_search.xml | jamf-cli pro classic-advanced-mobile-device-searches update 1`, + Args: cobra.MaximumNArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + reqCtx := cmd.Context() + + var body io.Reader + stat, _ := os.Stdin.Stat() + if (stat.Mode() & os.ModeCharDevice) == 0 { + body = os.Stdin + } else { + return fmt.Errorf("request body required on stdin (pipe XML input)") + } + + var path string + if flagName != "" { + path = fmt.Sprintf("/JSSResource/advancedmobiledevicesearches/name/%s", url.PathEscape(flagName)) + } else if len(args) > 0 { + path = fmt.Sprintf("/JSSResource/advancedmobiledevicesearches/id/%s", url.PathEscape(args[0])) + } else { + return fmt.Errorf("provide an argument or --name") + } + + resp, err := ctx.Client.Do(reqCtx, "PUT", path, body) + if err != nil { + return err + } + defer resp.Body.Close() + + return ctx.Output.PrintResponse(resp) + }, + } + + cmd.Flags().StringVar(&flagName, "name", "", "Look up advanced_mobile_device_search by name") + + return cmd +} + +func newClassicAdvancedMobileDeviceSearchesDeleteCmd(ctx *registry.CLIContext) *cobra.Command { + var ( + flagYes bool + flagDryRun bool + flagName string + fromFile string + ) + + cmd := &cobra.Command{ + Use: "delete []", + Short: "Delete a advanced_mobile_device_search", + Example: ` # Delete a advanced_mobile_device_search (with confirmation) + jamf-cli pro classic-advanced-mobile-device-searches delete 1 + + # Delete by name + jamf-cli pro classic-advanced-mobile-device-searches delete --name "Example" --yes + + # Delete without confirmation prompt + jamf-cli pro classic-advanced-mobile-device-searches delete 1 --yes`, + Annotations: map[string]string{"jamf:destructive": "true"}, + Args: cobra.MaximumNArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + reqCtx := cmd.Context() + + // --from-file: bulk delete from a file of IDs or names + if fromFile != "" { + entries, err := readDeleteFile(fromFile) + if err != nil { + return fmt.Errorf("reading --from-file: %w", err) + } + if len(entries) == 0 { + return fmt.Errorf("--from-file %q: no entries found", fromFile) + } + type bulkEntry struct{ id, label string } + bulk := make([]bulkEntry, 0, len(entries)) + noInputBulk, _ := cmd.Flags().GetBool("no-input") + for _, entry := range entries { + if isNumericID(entry) { + if entry == "0" { + return fmt.Errorf("--from-file: ID 0 is not valid (Jamf Pro uses 0 as a sentinel value)") + } + bulk = append(bulk, bulkEntry{id: entry, label: entry}) + } else { + var resolvedID string + if resolvedID == "" { + id, err := resolveClassicNameToIDForApply(reqCtx, ctx.Client, "advancedmobiledevicesearches", "advancedmobiledevicesearches", entry, noInputBulk) + if err != nil { + return fmt.Errorf("resolving %q: %w", entry, err) + } + resolvedID = id + } + if resolvedID == "" { + return fmt.Errorf("no advanced_mobile_device_search found matching %q", entry) + } + bulk = append(bulk, bulkEntry{id: resolvedID, label: entry}) + } + } + // Deduplicate resolved IDs to avoid double-delete errors. + { + seen := make(map[string]bool, len(bulk)) + deduped := bulk[:0] + for _, e := range bulk { + if !seen[e.id] { + seen[e.id] = true + deduped = append(deduped, e) + } + } + bulk = deduped + } + if flagDryRun { + for _, e := range bulk { + fmt.Fprintf(os.Stderr, "[dry-run] Would delete advanced_mobile_device_search %q (id: %s)\n", e.label, e.id) + } + return nil + } + if !flagYes { + if noInputBulk { + return fmt.Errorf("destructive operation requires --yes when --no-input is set") + } + fmt.Fprintf(os.Stderr, "⚠️ This will delete %d advancedmobiledevicesearches. Type 'yes' to confirm: ", len(bulk)) + var confirm string + fmt.Scanln(&confirm) + if confirm != "yes" { + return fmt.Errorf("aborted") + } + } + if err := cooldown.Enforce(ctx.ProfileName, noInputBulk, ctx.DestructiveCooldown); err != nil { + return err + } + for _, e := range bulk { + delPath := fmt.Sprintf("/JSSResource/advancedmobiledevicesearches/id/%s", url.PathEscape(e.id)) + resp, err := ctx.Client.Do(reqCtx, "DELETE", delPath, nil) + if err != nil { + return fmt.Errorf("deleting %q (id: %s): %w", e.label, e.id, err) + } + resp.Body.Close() + if resp.StatusCode == http.StatusNoContent || resp.StatusCode == http.StatusOK { + fmt.Fprintf(os.Stderr, "Deleted advanced_mobile_device_search %q (id: %s)\n", e.label, e.id) + } else { + return fmt.Errorf("delete %q (id: %s): HTTP %d", e.label, e.id, resp.StatusCode) + } + } + cooldown.Record(ctx.ProfileName) + return nil + } + + // Resolve ID from --name or positional arg + var resolvedID string + noInput, _ := cmd.Flags().GetBool("no-input") + if flagName != "" { + id, err := resolveClassicNameToIDForApply(reqCtx, ctx.Client, "advancedmobiledevicesearches", "advancedmobiledevicesearches", flagName, noInput) + if err != nil { + return err + } + if id == "" { + return fmt.Errorf("no advanced_mobile_device_search found with name %q", flagName) + } + resolvedID = id + } else if len(args) > 0 { + resolvedID = args[0] + } else { + return fmt.Errorf("provide an argument or --name") + } + + if flagDryRun { + fmt.Fprintf(os.Stderr, "[dry-run] Would delete advanced_mobile_device_search %s\n", resolvedID) + return nil + } + if !flagYes { + if noInput { + return fmt.Errorf("destructive operation requires --yes when --no-input is set") + } + fmt.Fprintf(os.Stderr, "This will delete advanced_mobile_device_search %s. Type 'yes' to confirm: ", resolvedID) + var confirm string + fmt.Scanln(&confirm) + if confirm != "yes" { + return fmt.Errorf("aborted") + } + } + + if err := cooldown.Enforce(ctx.ProfileName, noInput, ctx.DestructiveCooldown); err != nil { + return err + } + path := fmt.Sprintf("/JSSResource/advancedmobiledevicesearches/id/%s", url.PathEscape(resolvedID)) + + resp, err := ctx.Client.Do(reqCtx, "DELETE", path, nil) + if err != nil { + return err + } + defer resp.Body.Close() + + if resp.StatusCode == http.StatusNoContent || resp.StatusCode == http.StatusOK { + cooldown.Record(ctx.ProfileName) + fmt.Fprintln(os.Stderr, "Deleted successfully") + return nil + } + + return ctx.Output.PrintResponse(resp) + }, + } + + cmd.Flags().BoolVar(&flagYes, "yes", false, "Skip confirmation prompt") + cmd.Flags().BoolVarP(&flagDryRun, "dry-run", "n", false, "Preview without executing") + cmd.Flags().StringVar(&flagName, "name", "", "Look up advanced_mobile_device_search by name") + cmd.Flags().StringVar(&fromFile, "from-file", "", "Path to file listing IDs or names to delete (one per line, # comments ignored)") + cmd.MarkFlagsMutuallyExclusive("from-file", "name") + + return cmd +} + +func newClassicAdvancedMobileDeviceSearchesApplyCmd(ctx *registry.CLIContext) *cobra.Command { + var ( + fromFile string + flagYes bool + flagDryRun bool + ) + + cmd := &cobra.Command{ + Use: "apply", + Short: "Create or replace a advanced_mobile_device_search by name", + Long: `Create or replace a advanced_mobile_device_search. Reads XML from --from-file or stdin. + +The name field in the input XML is used to check if the resource already +exists. If it does, the resource is replaced (with confirmation). +If not, a new resource is created.`, + Example: ` # Apply a advanced_mobile_device_search from an XML file + jamf-cli pro classic-advanced-mobile-device-searches apply --from-file advanced_mobile_device_search.xml + + # Apply from stdin + cat advanced_mobile_device_search.xml | jamf-cli pro classic-advanced-mobile-device-searches apply + + # Apply without replacement confirmation + jamf-cli pro classic-advanced-mobile-device-searches apply --from-file advanced_mobile_device_search.xml --yes`, + RunE: func(cmd *cobra.Command, _ []string) error { + reqCtx := cmd.Context() + + // Read input + data, err := readApplyInput(fromFile) + + if err != nil { + return err + } + + // Extract name: for fetch-merge-put resources, --name is the primary + // input (body typically empty); fall back to XML name if flag absent. + var name string + + name, err = extractClassicName(data, "advanced_mobile_device_search") + if err != nil { + return err + } + + // Check if resource exists by name (read-only, runs even in dry-run) + noInput, _ := cmd.Flags().GetBool("no-input") + id, err := resolveClassicNameToIDForApply(reqCtx, ctx.Client, "advancedmobiledevicesearches", "advancedmobiledevicesearches", name, noInput) + if err != nil { + return err + } + + if id == "" { + // Not found — create (not allowed for fetch-merge-put resources) + + if flagDryRun { + fmt.Fprintf(os.Stderr, "[dry-run] Would create advanced_mobile_device_search %q\n", name) + return nil + } + resp, err := ctx.Client.Do(reqCtx, "POST", "/JSSResource/advancedmobiledevicesearches/id/0", bytes.NewReader(data)) + if err != nil { + return err + } + defer resp.Body.Close() + fmt.Fprintf(os.Stderr, "Created advanced_mobile_device_search %q\n", name) + return ctx.Output.PrintResponse(resp) + + } + + // Found — replace + if flagDryRun { + fmt.Fprintf(os.Stderr, "[dry-run] Would replace advanced_mobile_device_search %q (id: %s)\n", name, id) + return nil + } + if !flagYes { + if noInput { + return fmt.Errorf("advanced_mobile_device_search %q already exists (id: %s); use --yes to replace when --no-input is set", name, id) + } + fmt.Fprintf(os.Stderr, "advanced_mobile_device_search %q already exists (id: %s) and will be replaced. Type 'yes' to confirm: ", name, id) + var confirm string + fmt.Scanln(&confirm) + if confirm != "yes" { + return fmt.Errorf("aborted") + } + } + + updatePath := fmt.Sprintf("/JSSResource/advancedmobiledevicesearches/id/%s", url.PathEscape(id)) + resp, err := ctx.Client.Do(reqCtx, "PUT", updatePath, bytes.NewReader(data)) + if err != nil { + return err + } + defer resp.Body.Close() + fmt.Fprintf(os.Stderr, "Replaced advanced_mobile_device_search %q (id: %s)\n", name, id) + return ctx.Output.PrintResponse(resp) + }, + } + + cmd.Flags().StringVar(&fromFile, "from-file", "", "Path to XML input file (or pipe XML to stdin)") + cmd.Flags().BoolVar(&flagYes, "yes", false, "Skip confirmation prompt when replacing") + cmd.Flags().BoolVarP(&flagDryRun, "dry-run", "n", false, "Preview without executing") + + return cmd +} diff --git a/internal/commands/pro/generated/classic_registry.go b/internal/commands/pro/generated/classic_registry.go index 7864184..3591fa2 100644 --- a/internal/commands/pro/generated/classic_registry.go +++ b/internal/commands/pro/generated/classic_registry.go @@ -30,6 +30,7 @@ func RegisterClassicCommands(root *cobra.Command, ctx *registry.CLIContext) { root.AddCommand(NewClassicAccountUsersCmd(ctx)) root.AddCommand(NewClassicAccountsCmd(ctx)) root.AddCommand(NewClassicAdvancedComputerSearchesCmd(ctx)) + root.AddCommand(NewClassicAdvancedMobileDeviceSearchesCmd(ctx)) root.AddCommand(NewClassicAllowedFileExtensionsCmd(ctx)) root.AddCommand(NewClassicClassesCmd(ctx)) root.AddCommand(NewClassicComputerAppsCmd(ctx)) diff --git a/internal/commands/pro/generated/provenance.go b/internal/commands/pro/generated/provenance.go index 4973b92..d61a986 100644 --- a/internal/commands/pro/generated/provenance.go +++ b/internal/commands/pro/generated/provenance.go @@ -173,5 +173,5 @@ var Sources = []SpecSource{ {File: "specs/VppLocations.yaml", SHA256: "d9b41c79c0cdba81706b16c8e6d0b86b8048d40d6d55ec66618af0ac00c533d0"}, {File: "specs/VppSubscriptions.yaml", SHA256: "184b834aeb0d21cf190050294f7869d57b482bbe1834ad5a1bd79dcfdeef7a55"}, {File: "specs/_MonolithLibrary.yaml", SHA256: "9d777dc71e1909d20db05b31451246a805565c856d7b2fc50d38ccb33269a89a"}, - {File: "specs/classic/resources.yaml", SHA256: "95d378ff42e37d98eecdd780702fac7c332b8de2aa0b5b20ce3795e009d93e73"}, + {File: "specs/classic/resources.yaml", SHA256: "33ea6d51f008c918755eba219ee3fcd92b9560bb799a7dabd74b8772f33f87de"}, } diff --git a/internal/commands/pro/generated/smoke_registry.go b/internal/commands/pro/generated/smoke_registry.go index b0a15e2..655e05e 100644 --- a/internal/commands/pro/generated/smoke_registry.go +++ b/internal/commands/pro/generated/smoke_registry.go @@ -70,6 +70,8 @@ func AllSmokeEndpoints() []SmokeEndpoint { {Resource: "classic-accounts", Operation: "list", Method: "GET", Path: "/JSSResource/accounts", IsList: true, HasPathParams: false, IsClassic: true, WrapperKey: "accounts", SingularKey: ""}, {Resource: "classic-advanced-computer-searches", Operation: "get", Method: "GET", Path: "/JSSResource/advancedcomputersearches/id/{id}", IsList: false, HasPathParams: true, IsClassic: true, WrapperKey: "", SingularKey: "advanced_computer_search"}, {Resource: "classic-advanced-computer-searches", Operation: "list", Method: "GET", Path: "/JSSResource/advancedcomputersearches", IsList: true, HasPathParams: false, IsClassic: true, WrapperKey: "advancedcomputersearches", SingularKey: ""}, + {Resource: "classic-advanced-mobile-device-searches", Operation: "get", Method: "GET", Path: "/JSSResource/advancedmobiledevicesearches/id/{id}", IsList: false, HasPathParams: true, IsClassic: true, WrapperKey: "", SingularKey: "advanced_mobile_device_search"}, + {Resource: "classic-advanced-mobile-device-searches", Operation: "list", Method: "GET", Path: "/JSSResource/advancedmobiledevicesearches", IsList: true, HasPathParams: false, IsClassic: true, WrapperKey: "advancedmobiledevicesearches", SingularKey: ""}, {Resource: "classic-allowed-file-extensions", Operation: "get", Method: "GET", Path: "/JSSResource/allowedfileextensions/id/{id}", IsList: false, HasPathParams: true, IsClassic: true, WrapperKey: "", SingularKey: "allowed_file_extension"}, {Resource: "classic-allowed-file-extensions", Operation: "list", Method: "GET", Path: "/JSSResource/allowedfileextensions", IsList: true, HasPathParams: false, IsClassic: true, WrapperKey: "allowedfileextensions", SingularKey: ""}, {Resource: "classic-classes", Operation: "get", Method: "GET", Path: "/JSSResource/classes/id/{id}", IsList: false, HasPathParams: true, IsClassic: true, WrapperKey: "", SingularKey: "class"}, diff --git a/specs/classic/resources.yaml b/specs/classic/resources.yaml index f4b04d6..1db2359 100644 --- a/specs/classic/resources.yaml +++ b/specs/classic/resources.yaml @@ -90,6 +90,12 @@ resources: cli_name: classic-advanced-computer-searches singular: advanced_computer_search + - name: advancedmobiledevicesearches + path: advancedmobiledevicesearches + description: Advanced mobile device searches + cli_name: classic-advanced-mobile-device-searches + singular: advanced_mobile_device_search + # ── Mobile Devices ──────────────────────────────────────────────── - name: mobiledevices path: mobiledevices