list method

Future<MobileDevices> list(
  1. String customerId, {
  2. int? maxResults,
  3. String? orderBy,
  4. String? pageToken,
  5. String? projection,
  6. String? query,
  7. String? sortOrder,
  8. String? $fields,
})

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](/admin-sdk/directory/v1/reference/users).

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/admin-sdk/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>>{
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (orderBy != null) 'orderBy': [orderBy],
    if (pageToken != null) 'pageToken': [pageToken],
    if (projection != null) 'projection': [projection],
    if (query != null) 'query': [query],
    if (sortOrder != null) 'sortOrder': [sortOrder],
    if ($fields != null) 'fields': [$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>);
}