[Feedback] src/jamf_pro_sdk/clients/pro_api/__init__.py may get unwieldy
Opened this issue · 1 comments
Honestpuck commented
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
Honestpuck commented
My second thought would be to make ProApi
a derived class and make a base class for each of the endpoints in its own file. Then the calling style would stay the same.