list method

Future<GoogleAppsCloudidentityDevicesV1ListDevicesResponse> list({
  1. String? customer,
  2. String? filter,
  3. String? orderBy,
  4. int? pageSize,
  5. String? pageToken,
  6. String? view,
  7. String? $fields,
})

Lists/Searches devices.

Request parameters:

customer - Optional. Resource name of the customer in the format: customers/{customer}, where customer is the customer to whom the device belongs. If you're using this API for your own organization, use customers/my_customer. If you're using this API to manage another organization, use customers/{customer}, where customer is the customer to whom the device belongs.

filter - Optional. Additional restrictions when fetching list of devices. For a list of search fields, refer to Mobile device search fields. Multiple search fields are separated by the space character.

orderBy - Optional. Order specification for devices in the response. Only one of the following field names may be used to specify the order: create_time, last_sync_time, model, os_version, device_type and serial_number. desc may be specified optionally at the end to specify results to be sorted in descending order. Default order is ascending.

pageSize - Optional. The maximum number of Devices to return. If unspecified, at most 20 Devices will be returned. The maximum value is 100; values above 100 will be coerced to 100.

pageToken - Optional. A page token, received from a previous ListDevices call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListDevices must match the call that provided the page token.

view - Optional. The view to use for the List request. Possible string values are:

  • "VIEW_UNSPECIFIED" : Default value. The value is unused.
  • "COMPANY_INVENTORY" : This view contains all devices imported by the company admin. Each device in the response contains all information specified by the company admin when importing the device (i.e. asset tags). This includes devices that may be unaassigned or assigned to users.
  • "USER_ASSIGNED_DEVICES" : This view contains all devices with at least one user registered on the device. Each device in the response contains all device information, except for asset tags.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GoogleAppsCloudidentityDevicesV1ListDevicesResponse.

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<GoogleAppsCloudidentityDevicesV1ListDevicesResponse> list({
  core.String? customer,
  core.String? filter,
  core.String? orderBy,
  core.int? pageSize,
  core.String? pageToken,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (customer != null) 'customer': [customer],
    if (filter != null) 'filter': [filter],
    if (orderBy != null) 'orderBy': [orderBy],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v1/devices';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return GoogleAppsCloudidentityDevicesV1ListDevicesResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}