Skip to content

feat(classic): add ebooks, user-groups, vpp scope support#203

Open
neilmartin83 wants to merge 6 commits into
mainfrom
nm-classic-ebooks-2026-05-11
Open

feat(classic): add ebooks, user-groups, vpp scope support#203
neilmartin83 wants to merge 6 commits into
mainfrom
nm-classic-ebooks-2026-05-11

Conversation

@neilmartin83
Copy link
Copy Markdown
Member

@neilmartin83 neilmartin83 commented May 11, 2026

Summary

  • Adds ebooks to specs/classic/resources.yaml — full CRUD, id/name lookups, scope support; generates classic_ebooks.go
  • Adds usergroups to specs/classic/resources.yaml — full CRUD + apply; generates classic_user_groups.go
  • Adds scope support to vppassignments and vppinvitations (both require full-doc PUT — no /subset/Scope endpoint)
  • Fixes NamedItem.ID and classicResourceXML.General.ID typed as int — Classic API returns UUID strings for scope item IDs; changed both to string
  • Adds --user-group, --jss-user-group, --jss-user as valid scope target/exclusion flags, routing to jss_user_groups/jss_users in scope XML (VPP-style user-based targeting)
  • Adds ResolveByList to scope.Resource — resources without a /name/ endpoint list all records and match by name
  • Adds NoSubsetPut to scope.Resource — resources without a /subset/Scope PUT endpoint fetch the full document, splice in the updated scope at byte level, and PUT the whole document back
  • Wires both flags through YAML manifest → ClassicResource → generator template → generated scope.Resource literals

Test plan

  • make test passes
  • bin/jamf-cli pro classic-ebooks scope get "<name with colon>" returns scope without parse error
  • bin/jamf-cli pro classic-user-groups list returns JSS user group records
  • bin/jamf-cli pro classic-vpp-assignments scope get "<name>" resolves name via list, returns scope
  • bin/jamf-cli pro classic-vpp-assignments scope add "<name>" --user-group "<group>" adds to jss_user_groups target
  • bin/jamf-cli pro classic-vpp-assignments scope remove "<name>" --user-group "<group>" removes from jss_user_groups target
  • bin/jamf-cli pro classic-vpp-invitations scope get/add/remove all work (live-tested against platform-nmartin ✓)

🤖 Generated with Claude Code

Classic API resources (e.g. ebook scope user groups) can return
UUIDs instead of integers for scope item IDs. Typing NamedItem.ID
and classicResourceXML.General.ID as int caused xml.Unmarshal to
fail with strconv.ParseInt on any UUID value.

Change both ID fields to string — no behaviour change for integer
IDs, UUID IDs now round-trip correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@neilmartin83 neilmartin83 enabled auto-merge May 11, 2026 13:51
auto-merge was automatically disabled May 11, 2026 13:55

Pull Request is not mergeable

JSS user groups (/JSSResource/usergroups) were missing from the
Classic API manifest despite being referenced in scope limitations
on policies, ebooks, and other scoped resources.

Adds full CRUD + apply under classic-user-groups in the
Classic - Administration help group.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@neilmartin83 neilmartin83 changed the title feat(classic): add classic-ebooks command group feat(classic): add classic-ebooks and classic-user-groups command groups May 11, 2026
@neilmartin83 neilmartin83 enabled auto-merge May 11, 2026 14:14
neilmartin83 and others added 3 commits May 11, 2026 15:34
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ssignments

Three related fixes for Classic API scope on resources like vpp assignments:

- Add --user-group / --jss-user-group / --jss-user flags as valid target and
  exclusion items, routing to jss_user_groups / jss_users in scope XML.
  Previously only computer-group, mobile-device-group, building, department
  were accepted as target items.
- Add NoSubsetPut to scope.Resource: resources without a /subset/Scope
  endpoint (vppassignments) now fetch the full document, splice in the
  updated scope at the byte level, and PUT the whole document back.
- Fix flagToElemName for jss-user-group: child elements inside
  <jss_user_groups> are <user_group>, not <jss_user_group>.

Wire no_subset_put through YAML manifest → ClassicResource → generator
template → generated scope.Resource literal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@neilmartin83 neilmartin83 changed the title feat(classic): add classic-ebooks and classic-user-groups command groups feat(classic): add ebooks, user-groups, vpp scope support May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant