Skip to content

[Feedback] src/jamf_pro_sdk/clients/pro_api/__init__.py may get unwieldy #30

@Honestpuck

Description

@Honestpuck

Current

The current behaviour is to put all the functions for all the pro endpoints into the __init__.py file. I realise this allows calls like

ifrom jamf_pro_sdk import JamfProClient, BasicAuthProvider

client = JamfProClient(
    server="dummy.jamfcloud.com",
    credentials=BasicAuthProvider("username", "password")
)

all_computers = client.pro_api.get_computer_inventory_v1()

but when the number of endpoints gets high this file will grow to be difficult to deal with.

Proposed

I would propose that in the directory there could be a file computer_v1 which contains (among others) the function get_inventory then the call would be:

from jamf_pro_sdk import JamfProClient, BasicAuthProvider

client = JamfProClient(
    server="dummy.jamfcloud.com",
    credentials=BasicAuthProvider("username", "password")
)

all_computers = client.pro_api.computer_v1.get_inventory()

System Information

SDK version 4.0a

Metadata

Metadata

Assignees

No one assigned

    Labels

    feedbackPotential improvements or changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions