list method
Retrieves a paginated list of Chrome OS devices within an account.
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.
includeChildOrgunits - Return devices from all child orgunits, as well
as the specified org unit. If this is set to true, 'orgUnitPath' must be
provided.
maxResults - Maximum number of results to return. Value should not
exceed 300.
orderBy - Device property to use for sorting results.
Possible string values are:
- "annotatedLocation" : Chrome device location as annotated by the administrator.
- "annotatedUser" : Chromebook user as annotated by administrator.
- "lastSync" : The date and time the Chrome device was last synchronized with the policy settings in the Admin console.
- "notes" : Chrome device notes as annotated by the administrator.
- "serialNumber" : The Chrome device serial number entered when the device was enabled.
- "status" : Chrome device status. For more information, see the <a chromeosdevices.
orgUnitPath - The full path of the organizational unit (minus the
leading /) or its unique ID.
pageToken - The pageToken query parameter is used to request the next
page of query results. The follow-on request's pageToken query parameter
is the nextPageToken from your previous response.
projection - Determines whether the response contains the full list of
properties or only a subset.
Possible string values are:
- "BASIC" : Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)
- "FULL" : Includes all metadata fields
query - Search string in the format given at
https://developers.google.com/workspace/admin/directory/v1/list-query-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 ChromeOsDevices.
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<ChromeOsDevices> list(
core.String customerId, {
core.bool? includeChildOrgunits,
core.int? maxResults,
core.String? orderBy,
core.String? orgUnitPath,
core.String? pageToken,
core.String? projection,
core.String? query,
core.String? sortOrder,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'includeChildOrgunits': ?includeChildOrgunits == null
? null
: ['${includeChildOrgunits}'],
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'orderBy': ?orderBy == null ? null : [orderBy],
'orgUnitPath': ?orgUnitPath == null ? null : [orgUnitPath],
'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/chromeos';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ChromeOsDevices.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}