macadmins / macadmins/jamf-pro-sdk-python

[Feature Request] Pass a model to the Classic and Pro API request methods as the return type.

Open
#52 1 comment 0 reactions 2 assignees View on GitHub

@liquidz00 is already working on this.

Since Jun 20, 2025.

enhancement
Dominant language
Python
Stars
69
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Proposal

When using the classic_api_request and pro_api_request methods on the client directly users have to take the response and cast it to an SDK model themselves.

resp = jamf_client.classic_api_request(
    method="get",
    resource_path=f"computergroups/name/{group_name}"
)
group = ClassicComputerGroup(**resp.json()["computer_group"])

Both methods should optionally accept an SDK model as an optional response type. When set, the requests response object is not returned, but the method attempts to instantiate the provided model from the data.

group = jamf_client.classic_api_request(
    method="get",
    resource_path=f"computergroups/name/{group_name}",
    return_model=ClassicComputerGroup
)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.