Devices
AirwatchDevice Object
WIP
GetDevices
The GetDevices method is designed to fetch a list of all devices registered in Workspace One. If provided with a specific user's name, it will return only the devices associated with that user. The returned objects are instances of AirwatchDevice. If no devices are found (either for all users or a specific user), None is returned.
Parameters:
- user (optional, string, default=""): A string representing the username of the specific user whose devices are to be fetched. If not provided, it will fetch devices for all users.
Return value:
- An array of AirwatchDevice objects containing details of the devices if any devices are found.
- None if no devices are found (either for all users or a specific user).
Example usage:
SetDeviceUser
Description:
The SetDeviceUser method is utilized for setting or replacing the user associated with a specific AirwatchDevice. The provided AirwatchDevice instance and AirwatchUser instance will be used to identify the device and user, respectively. The command updates the association between the two instances using their unique IDs.
Parameters:
- device (required): An instance of AirwatchDevice representing the device whose user is being updated.
- airwatchUser (required): An instance of AirwatchUser that represents the new user to be associated with the device.
Return value:
- An HTTP status code indicating the success or failure of the operation. A successful operation typically returns a 200 status code, while an unsuccessful one may return a variety of error codes (e.g., 400 for Bad Request, 401 for Unauthorized, etc.).
Example usage: