Patch Title#

class PatchTitle(*, title: str, title_id: str, released: str, hosts_patched: int, missing_patch: int, latest_version: str, completion_percent: float = 0.0, total_hosts: int = 0, install_label: list[Label] | None = [])[source]#

Represents patch software title information retrieved via API calls.

Variables:
  • title – The name of the patch title.

  • title_id – The softwareTitleId of the patch title from Jamf API response.

  • released – The release date of the patch title.

  • hosts_patched – The number of hosts that have applied the patch.

  • missing_patch – The number of hosts missing the patch.

  • latest_version – The latest version available for the software title.

  • completion_percent – The percentage of hosts that have applied the patch.

  • total_hosts – The total number of hosts.

  • install_label – The corresponding Installomator label(s) if available.

Parameters:
  • title (str)

  • title_id (str)

  • released (str)

  • hosts_patched (int)

  • missing_patch (int)

  • latest_version (str)

  • completion_percent (float)

  • total_hosts (int)

  • install_label (list[Label] | None)

validator cast_as_string  »  title_id[source]#

Ensures the title_id property is always a string, regardless of type in API response payload.

Parameters:

value (int | str) – The value of the title_id field.

Returns:

The value cast as a string.

Return type:

str

validator calculate_completion_percent  »  all fields[source]#

Calculates the completion percentage and total hosts of a PatchTitle object based on hosts patched and missing patch.

See get_summaries()

Patch Device#

class PatchDevice(*, computerName: str, deviceId: str, username: str, operatingSystemVersion: str, lastContactTime: datetime, buildingName: str | None = None, departmentName: str | None = None, siteName: str | None = None, version: str)[source]#

Represents device information from Jamf Pro patch management data.

Variables:
  • computer_name – The name of the computer.

  • device_id – The unique device identifier from Jamf Pro.

  • username – The username associated with the device.

  • operating_system_version – The macOS version running on the device.

  • last_contact_time – The last time the device contacted Jamf Pro.

  • building_name – The building assignment for the device, if any.

  • department_name – The department assignment for the device, if any.

  • site_name – The site assignment for the device, if any.

  • version – The patch software version installed on the device.

Parameters:
  • computerName (str)

  • deviceId (str)

  • username (str)

  • operatingSystemVersion (str)

  • lastContactTime (datetime)

  • buildingName (str | None)

  • departmentName (str | None)

  • siteName (str | None)

  • version (str)

validator cast_as_string  »  device_id[source]#

Ensures the device_id property is always a string, regardless of type in API response payload.

Parameters:

value (int | str) – The value of the device_id field.

Returns:

The value cast as a string.

Return type:

str

validator empty_str_to_none  »  site_name, building_name, department_name[source]#

Converts empty strings to None for optional organizational fields.

Parameters:

value (str) – The value of the organizational field.

Returns:

None if empty string, otherwise the original value.

Return type:

str | None