list method
List printers configs.
Request parameters:
parent
- Required. The name of the customer who owns this collection of
printers. Format: customers/{customer_id}
Value must have pattern ^customers/\[^/\]+$
.
filter
- Search query. Search syntax is shared between this api and
Admin Console printers pages.
orderBy
- The order to sort results by. Must be one of display_name,
description, make_and_model, or create_time. Default order is ascending,
but descending order can be returned by appending "desc" to the order_by
field. For instance, "description desc" will return the printers sorted by
description in descending order.
orgUnitId
- Organization Unit that we want to list the printers for.
When org_unit is not present in the request then all printers of the
customer are returned (or filtered). When org_unit is present in the
request then only printers available to this OU will be returned (owned or
inherited). You may see if printer is owned or inherited for this OU by
looking at Printer.org_unit_id.
pageSize
- The maximum number of objects to return. The service may
return fewer than this value.
pageToken
- A page token, received from a previous call.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListPrintersResponse.
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<ListPrintersResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.String? orgUnitId,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (filter != null) 'filter': [filter],
if (orderBy != null) 'orderBy': [orderBy],
if (orgUnitId != null) 'orgUnitId': [orgUnitId],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'admin/directory/v1/' +
core.Uri.encodeFull('$parent') +
'/chrome/printers';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListPrintersResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}