class Devices extends Resource (View source)

The "devices" collection of methods.

Typical usage is:

 $androidenterpriseService = new Google\Service\AndroidEnterprise(...);
 $devices = $androidenterpriseService->devices;

Methods

forceReportUpload(string $enterpriseId, string $userId, string $deviceId, array $optParams = [])

Uploads a report containing any changes in app states on the device since the last report was generated. You can call this method up to 3 times every 24 hours for a given device. If you exceed the quota, then the Google Play EMM API returns HTTP 429 Too Many Requests. (devices.forceReportUpload)

get(string $enterpriseId, string $userId, string $deviceId, array $optParams = [])

Retrieves the details of a device. (devices.get)

getState(string $enterpriseId, string $userId, string $deviceId, array $optParams = [])

Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. (devices.getState)

listDevices(string $enterpriseId, string $userId, array $optParams = [])

Retrieves the IDs of all of a user's devices. (devices.listDevices)

setState(string $enterpriseId, string $userId, string $deviceId, DeviceState $postBody, array $optParams = [])

Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. (devices.setState)

update(string $enterpriseId, string $userId, string $deviceId, Device $postBody, array $optParams = [])

Updates the device policy. To ensure the policy is properly enforced, you need to prevent unmanaged accounts from accessing Google Play by setting the allowed_accounts in the managed configuration for the Google Play package.

Details

forceReportUpload(string $enterpriseId, string $userId, string $deviceId, array $optParams = [])

Uploads a report containing any changes in app states on the device since the last report was generated. You can call this method up to 3 times every 24 hours for a given device. If you exceed the quota, then the Google Play EMM API returns HTTP 429 Too Many Requests. (devices.forceReportUpload)

Parameters

string $enterpriseId

The ID of the enterprise.

string $userId

The ID of the user.

string $deviceId

The ID of the device.

array $optParams

Optional parameters.

Exceptions

Exception

Device get(string $enterpriseId, string $userId, string $deviceId, array $optParams = [])

Retrieves the details of a device. (devices.get)

Parameters

string $enterpriseId

The ID of the enterprise.

string $userId

The ID of the user.

string $deviceId

The ID of the device.

array $optParams

Optional parameters.

Return Value

Device

Exceptions

Exception

DeviceState getState(string $enterpriseId, string $userId, string $deviceId, array $optParams = [])

Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. (devices.getState)

Parameters

string $enterpriseId

The ID of the enterprise.

string $userId

The ID of the user.

string $deviceId

The ID of the device.

array $optParams

Optional parameters.

Return Value

DeviceState

Exceptions

Exception

DevicesListResponse listDevices(string $enterpriseId, string $userId, array $optParams = [])

Retrieves the IDs of all of a user's devices. (devices.listDevices)

Parameters

string $enterpriseId

The ID of the enterprise.

string $userId

The ID of the user.

array $optParams

Optional parameters.

Return Value

DevicesListResponse

Exceptions

Exception

DeviceState setState(string $enterpriseId, string $userId, string $deviceId, DeviceState $postBody, array $optParams = [])

Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. (devices.setState)

Parameters

string $enterpriseId

The ID of the enterprise.

string $userId

The ID of the user.

string $deviceId

The ID of the device.

DeviceState $postBody
array $optParams

Optional parameters.

Return Value

DeviceState

Exceptions

Exception

Device update(string $enterpriseId, string $userId, string $deviceId, Device $postBody, array $optParams = [])

Updates the device policy. To ensure the policy is properly enforced, you need to prevent unmanaged accounts from accessing Google Play by setting the allowed_accounts in the managed configuration for the Google Play package.

See restrict accounts in Google Play. When provisioning a new device, you should set the device policy using this method before adding the managed Google Play Account to the device, otherwise the policy will not be applied for a short period of time after adding the account to the device. (devices.update)

Parameters

string $enterpriseId

The ID of the enterprise.

string $userId

The ID of the user.

string $deviceId

The ID of the device.

Device $postBody
array $optParams

Optional parameters.

Return Value

Device

Exceptions

Exception