Skip to content

feat: support MDM migration deadline and cancellation flows - #43

Merged
kainzhou merged 1 commit into
mainfrom
migration-deadline
Sep 2, 2026
Merged

kainzhou merged 1 commit into
mainfrom
migration-deadline

Conversation

@kainzhou

@kainzhou kainzhou commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Models:

  • Type OrgDeviceActivityType as the Apple Literal (assign, unassign, assign-with-deadline, update-deadline, cancel, release) instead of a loose str.
  • Add ActivityTypeMetadata (mdmMigrationDeadlineDateTime) and make the mdmServer relationship optional on the create-request model.
  • Add mdmMigrationStatus / deadline / isMdmMigrationCapable fields to OrgDevice and the MdmMigrationStatus alias.

Request layer:

  • assign_unassign_device_to_mdm_server now accepts an optional server_id and mdm_migration_deadline_date_time, builds the matching payload per activity type, and validates required fields (server for assign flows, deadline for migration flows).
  • Serialize with exclude_none=True so optional/absent fields are omitted instead of sent as null (Apple rejects "mdmServer": null).

CLI:

  • Add --deadline to assign-device for assign-with-migration-deadline.
  • Add update-mdm-migration-deadline and cancel-mdm-migration commands.
  • Share activity output/report logic via _run_device_activity, which waits 10s before downloading the report to avoid API rate limiting.
  • Timestamp parser accepts YYYY-MM-DD and ISO 8601 with a trailing Z.

Docs:

  • Regenerate docs/cli.md to document the new migration-deadline and cancellation commands.

Models:
- Type OrgDeviceActivityType as the Apple Literal (assign, unassign,
  assign-with-deadline, update-deadline, cancel, release) instead of a
  loose str.
- Add ActivityTypeMetadata (mdmMigrationDeadlineDateTime) and make the
  mdmServer relationship optional on the create-request model.
- Add mdmMigrationStatus / deadline / isMdmMigrationCapable fields to
  OrgDevice and the MdmMigrationStatus alias.

Request layer:
- assign_unassign_device_to_mdm_server now accepts an optional server_id
  and mdm_migration_deadline_date_time, builds the matching payload per
  activity type, and validates required fields (server for assign flows,
  deadline for migration flows).
- Serialize with exclude_none=True so optional/absent fields are omitted
  instead of sent as null (Apple rejects "mdmServer": null).

CLI:
- Add --deadline to assign-device for assign-with-migration-deadline.
- Add update-mdm-migration-deadline and cancel-mdm-migration commands.
- Share activity output/report logic via _run_device_activity, which waits
  10s before downloading the report to avoid API rate limiting.
- Timestamp parser accepts YYYY-MM-DD and ISO 8601 with a trailing Z.

Docs:
- Regenerate docs/cli.md to document the new migration-deadline and
  cancellation commands.
@kainzhou
kainzhou merged commit 4cb4b87 into main Sep 2, 2026
1 check passed
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