Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pro scripts passes lint and test #23

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
start of script functions
Honestpuck committed Nov 1, 2023
commit b11f63ecd93a274f92be7951e6fa11beb209cb1f
52 changes: 52 additions & 0 deletions src/jamf_pro_sdk/clients/pro_api/__init__.py
Original file line number Diff line number Diff line change
@@ -20,6 +20,8 @@
SetRecoveryLockCommand,
ShutDownDeviceCommand,
)
from ...models.pro.scripts import *
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use wildcard imports.


from .pagination import Paginator

if TYPE_CHECKING:
@@ -325,3 +327,53 @@ def get_mdm_commands_v2(
)

return paginator(return_generator=return_generator)

def get_scripts(
self,
start_page: int = 0,
end_page: int = None,
page_size: int = 100,
sort_expression: SortExpression = None,
filter_expression: FilterExpression = None,
return_generator: bool = False,
) -> Union[List[Script], Iterator[Page]]:
"""Returns a list of script records.

:param start_page: (optional) The page to begin returning results from. See
:class:`Paginator` for more information.
:type start_page: int

:param end_page: (optional) The page to end returning results at. See :class:`Paginator` for
more information.
:type start_page: int

:param page_size: (optional) The number of results to include in each requested page. See
:class:`Paginator` for more information.
:type page_size: int

:param sort_expression: (optional) The sort fields to apply to the request. See the
documentation for :ref:`Pro API Sorting` for more information.

Allowed sort fields:

.. autoapioptions:: jamf_pro_sdk.models.pro.api_options.get_scripts_v1_allowed_sort_criteria

:type sort_expression: SortExpression

:param filter_expression: (optional) The filter expression to apply to the request. See the
documentation for :ref:`Pro API Filtering` for more information.

Allowed filter fields:

.. autoapioptions:: jamf_pro_sdk.models.pro.api_options.get_scripts_inventory_v1_allowed_filter_criteriascripts

:type filter_expression: FilterExpression

:param return_generator: If ``True`` a generator is returned to iterate over pages. By
default, the results for all pages will be returned in a single response.
:type return_generator: bool

:return: List of scripts OR a paginator generator.
:rtype: List[~jamf_pro_sdk.models.pro.script.Script] | Iterator[Page]
"""