macadmins / macadmins/jamf-pro-sdk-python
[Feature Request] Pass a model to the Classic and Pro API request methods as the return type.
Open
@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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.