Setup#

class SetupType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

class Setup(config: ConfigManager, ui_config: UIConfigManager)[source]#

Handles the initial setup process for the Patcher CLI tool.

This class guides users through configuring the necessary components to integrate with their Jamf environment. The setup includes creating API roles, clients, and configuring user interface settings for PDF reports.

Parameters:
  • config (ConfigManager) – Manages application configuration, including credential storage.

  • ui_config (UIConfigManager) – Handles UI-related configurations for the setup process.

property completed: bool[source]#

Indicates whether the setup process has been completed.

Returns:

True if setup has been completed, False otherwise.

Return type:

bool

async start(animator: Animation | None = None) None[source]#

Allows the user to choose between different setup methods (Standard or SSO).

An optional Animation object can be passed to update animation messages at runtime. Defaults to self.animator.

Options:

  • STANDARD prompts for basic credentials, obtains basic token, creates API integration, saves client credentials and obtains an AccessToken.

  • SSO prompts for existing API credentials, obtains AccessToken and saves credentials.

See also

For SSO users, reference our Handling SSO in Jamf Pro page for assistance creating an API integration.

Parameters:

animator (Optional [Animation]) – The animation instance to update messages. Defaults to self.animator.

Raises:

SetupError – If a token could not be fetched, credentials are missing or setup could not be marked complete.

Return type:

None

reset_setup() bool[source]#

Resets Setup configuration, removing Patcher’s property list file. This effectively marks Setup completion as False and will re-trigger the setup assistant.

If the file does not exist, a warning is logged but the function will return True.

Returns:

True if the property list file was successfully removed or if it does not exist.

Return type:

bool

Raises:

PatcherError – If the file exists but could not be removed due to an error.