countChromeOsDevices method

Future<CountChromeOsDevicesResponse> countChromeOsDevices(
  1. String customerId, {
  2. String? filter,
  3. bool? includeChildOrgunits,
  4. String? orgUnitPath,
  5. String? $fields,
})

Counts ChromeOS devices matching the request.

Request parameters:

customerId - Required. Immutable ID of the Google Workspace account.

filter - Optional. Search string in the format given at List query operators.

includeChildOrgunits - Optional. Return devices from all child orgunits, as well as the specified org unit. If this is set to true, 'orgUnitPath' must be provided.

orgUnitPath - Optional. The full path of the organizational unit (minus the leading /) or its unique ID.

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

Completes with a CountChromeOsDevicesResponse.

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<CountChromeOsDevicesResponse> countChromeOsDevices(
  core.String customerId, {
  core.String? filter,
  core.bool? includeChildOrgunits,
  core.String? orgUnitPath,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'filter': ?filter == null ? null : [filter],
    'includeChildOrgunits': ?includeChildOrgunits == null
        ? null
        : ['${includeChildOrgunits}'],
    'orgUnitPath': ?orgUnitPath == null ? null : [orgUnitPath],
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ =
      'admin/directory/v1/customer/' +
      commons.escapeVariable('$customerId') +
      '/devices/chromeos:countChromeOsDevices';

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