list method

Future<CatalogListDevicesResponse> list(
  1. String parent, {
  2. String? filter,
  3. int? pageSize,
  4. String? pageToken,
  5. String? $fields,
})

Lists all devices.

Request parameters:

parent - Required. The parent of the collection of devices. Format: projects/{project}/locations/global. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

filter - Optional. An AIP-160 (https://google.aip.dev/160) filter expression restricting which devices are returned. An empty filter returns all devices. Filtering is supported over the Device fields, including nested fields via dot-path. Enum and string values must be double-quoted. Examples: * platform = "ANDROID" * platform = "ANDROID" AND os_version = "34" * hardware_type = "PHYSICAL" AND form_factor = "PHONE" * android_details.build_type = "userdebug" * availability.capacity = "HIGH"

pageSize - Optional. The maximum number of devices to return. The server may return fewer items than this value.

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

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

Completes with a CatalogListDevicesResponse.

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

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/devices';

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