macadmins / jamf-pro-sdk-python

A client library for the Jamf Pro APIs and webhooks.
https://macadmins.github.io/jamf-pro-sdk-python/
MIT License
50 stars 10 forks source link

Add Packages to Pro API, and a few Typing Enhancements #54

Closed macserv closed 1 week ago

macserv commented 2 weeks ago

Pro Package API

Typing Enhancements

brysontyrrell commented 2 weeks ago

Can you discuss the inclusion of overloads? I'm not seeing the value they're bringing to the two interfaces you've implemented them with.

macserv commented 2 weeks ago

Sure! It allows the type checker to infer what will be returned by the method, based on whether or not pagination is being used. This doesn't do much within the API itself, but it improves the ergonomics of code that consumes the SDK.

brysontyrrell commented 2 weeks ago

Sure! It allows the type checker to infer what will be returned by the method, based on whether or not pagination is being used. This doesn't do much within the API itself, but it improves the ergonomics of code that consumes the SDK.

Not two minutes after I sent that did it click that it made the return type deterministic.

...I am not against this. I'd want to get it added to the remaining Pro API methods though and included in the dev docs as a part of the style guide.

brysontyrrell commented 2 weeks ago

This is an overall very solid PR with good enhancements. 🎉

macserv commented 2 weeks ago

I'd want to get [overloads] added to the remaining Pro API methods…

Overloads added to other Pro API methods.

macserv commented 2 weeks ago

I'd want to get [overloads] … included in the dev docs as a part of the style guide.

Updated contributors/index.rst to specify that @overload interfaces should be provided for methods with dynamic return types. Also added recommendation to use Optional[] for types where value can be None.