diff --git a/README.md b/README.md index 382cc1f..9d90de3 100644 --- a/README.md +++ b/README.md @@ -260,10 +260,10 @@ class Devices(SimpleMDMpy.SimpleMDM.Connection) | get_custom_attribute(self, device_id, custom_attribute_name) | get a devices custom attributes | - | get_device(self, device_id='all', search=None, include_awaiting_enrollment=False) + | get_device(self, device_id='all', search=None, include_awaiting_enrollment=False, include_secret_custom_attributes=False) | Returns a device specified by id. If no ID or search is | specified all devices will be returned. Default does not include devices - | waiting for enrollment + | waiting for enrollment and does not include all custom attributes | | list_installed_apps(self, device_id) | Returns a listing of the apps installed on a device. diff --git a/SimpleMDMpy/Devices.py b/SimpleMDMpy/Devices.py index 0239ca5..4d26966 100644 --- a/SimpleMDMpy/Devices.py +++ b/SimpleMDMpy/Devices.py @@ -11,11 +11,17 @@ def __init__(self, api_key): SimpleMDMpy.SimpleMDM.Connection.__init__(self, api_key) self.url = self._url("/devices") - def get_device(self, device_id="all", search=None, include_awaiting_enrollment=False): + def get_device( + self, + device_id="all", + search=None, + include_awaiting_enrollment=False, + include_secret_custom_attributes=False + ): """ Returns a device specified by id. If no ID or search is specified all devices will be returned. - + Args: device_id (str, optional): Returns a dictionary of the specified device id. By default, it returns a list of all devices. If a @@ -24,13 +30,18 @@ def get_device(self, device_id="all", search=None, include_awaiting_enrollment=F search criteria. Defaults to None. Ignored if device_id is set. include_awaiting_enrollment (bool, optional): Returns a list of all devices including devices in the "awaiting_enrollment" state. - + include_secret_custom_attributes (bool, optional): Returns all + custom attribute values including those marked as secret. + Returns: dict: A single dictionary object with device information. array: An array of dictionary objects with device information. """ url = self.url - params = {'include_awaiting_enrollment': include_awaiting_enrollment} + params = { + 'include_awaiting_enrollment': include_awaiting_enrollment, + 'include_secret_custom_attributes': include_secret_custom_attributes + } # if a device ID is specified, then ignore any searches if device_id != 'all': url = url + "/" + str(device_id)