list method
Retrieves a paginated list of all user-owned mobile devices for an account.
To retrieve a list that includes company-owned devices, use the Cloud Identity Devices API instead. This method times out after 60 minutes. For more information, see Troubleshoot error codes.
Request parameters:
customerId - The unique ID for the customer's Google Workspace account.
As an account administrator, you can also use the my_customer alias to
represent your account's customerId. The customerId is also returned
as part of the
Users resource.
maxResults - Maximum number of results to return. Max allowed value is
100.
Value must be between "1" and "100".
orderBy - Device property to use for sorting results.
Possible string values are:
- "deviceId" : The serial number for a Google Sync mobile device. For Android devices, this is a software generated unique identifier.
- "email" : The device owner's email address.
- "lastSync" : Last policy settings sync date time of the device.
- "model" : The mobile device's model.
- "name" : The device owner's user name.
- "os" : The device's operating system.
- "status" : The device status.
- "type" : Type of the device.
pageToken - Token to specify next page in the list
projection - Restrict information returned to a set of selected fields.
Possible string values are:
- "BASIC" : Includes only the basic metadata fields (e.g., deviceId, model, status, type, and status)
- "FULL" : Includes all metadata fields
query - Search string in the format given at
https://developers.google.com/workspace/admin/directory/v1/search-operators
sortOrder - Whether to return results in ascending or descending order.
Must be used with the orderBy parameter.
Possible string values are:
- "ASCENDING" : Ascending order.
- "DESCENDING" : Descending order.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a MobileDevices.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<MobileDevices> list(
core.String customerId, {
core.int? maxResults,
core.String? orderBy,
core.String? pageToken,
core.String? projection,
core.String? query,
core.String? sortOrder,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageToken': ?pageToken == null ? null : [pageToken],
'projection': ?projection == null ? null : [projection],
'query': ?query == null ? null : [query],
'sortOrder': ?sortOrder == null ? null : [sortOrder],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'admin/directory/v1/customer/' +
commons.escapeVariable('$customerId') +
'/devices/mobile';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return MobileDevices.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}