Jamf Client#

pydantic model JamfClient[source]#

Represents a Jamf client configuration.

This class is responsible for holding the configuration necessary to interact with the Jamf API, including client credentials, server information, and SSL settings.

Parameters:
  • client_id (str) – The client ID used for authentication with the Jamf API.

  • client_secret (str) – The client secret used for authentication with the Jamf API.

  • server (str) – The server URL for the Jamf API.

  • token (Optional[AccessToken]) – The access token used for authenticating API requests. Defaults to None.

field client_id: str [Required]#
field client_secret: str [Required]#
field server: str [Required]#
field token: AccessToken | None = None#
classmethod not_empty(value)[source]#

Wrap a classmethod, staticmethod, property or unbound function and act as a descriptor that allows us to detect decorated items from the class’ attributes.

This class’ __get__ returns the wrapped item’s __get__ result, which makes it transparent for classmethods and staticmethods.

Attributes:

wrapped: The decorator that has to be wrapped. decorator_info: The decorator info. shim: A wrapper function to wrap V1 style function.

static valid_url(url: str) str[source]#

Validates and formats a URL to ensure it has the correct scheme and structure.

This method checks if the provided URL has a scheme (e.g., ‘https’) and a network location (netloc). If the scheme is missing, ‘https’ is assumed. The method returns the validated and correctly formatted URL.

Parameters:

url (str) – The URL to validate and format.

Returns:

The validated and formatted URL.

Return type:

str

classmethod validate_url(v)[source]#

Wrap a classmethod, staticmethod, property or unbound function and act as a descriptor that allows us to detect decorated items from the class’ attributes.

This class’ __get__ returns the wrapped item’s __get__ result, which makes it transparent for classmethods and staticmethods.

Attributes:

wrapped: The decorator that has to be wrapped. decorator_info: The decorator info. shim: A wrapper function to wrap V1 style function.

property base_url#

Gets the base URL of the Jamf server.

Returns:

The base URL of the Jamf server.

Return type:

str

property headers#
pydantic model ApiRoleModel[source]#

Represents an API role with specific privileges required for Patcher to operate.

The ApiRole class encapsulates the role’s name and the list of privileges associated with that role. This is necessary for managing access control and permissions within the Jamf API.

Variables:
  • display_name – The name of the API role.

  • privileges – A list of privileges assigned to the API role. These privileges determine the actions that the role can perform.

field display_name: str = 'Patcher-Role'#
field privileges: List[str] = ['Read Patch Management Software Titles', 'Read Patch Policies', 'Read Mobile Devices', 'Read Mobile Device Inventory Collection', 'Read Mobile Device Applications', 'Read Patch Management Settings', 'Create API Integrations', 'Create API Roles', 'Read API Integrations', 'Read API Roles', 'Update API Integrations', 'Update API Roles']#
pydantic model ApiClientModel[source]#

Represents an API client with specific authentication scopes and settings required for Patcher.

The ApiClient class defines the configuration for an API client, including its authentication scopes, display name, whether it is enabled, and the token lifetime.

Variables:
  • auth_scopes – A list of authentication scopes assigned to the API client. These scopes define the level of access the client has.

  • display_name – The name of the API client.

  • enabled – Indicates whether the API client is currently enabled or disabled.

  • token_lifetime – The lifetime of the access token in seconds. This value determines how long the token remains valid.

field auth_scopes: List[str] = ['Patcher-Role']#
field display_name: str = 'Patcher-Client'#
field enabled: bool = True#
field token_lifetime: int = 1800#