list method

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

Lists active, unexpired enrollment tokens for a given enterprise.

The list items contain only a partial view of EnrollmentToken: all the fields but name and expiration_timestamp are empty. This method is meant to help manage active enrollment tokens lifecycle. For security reasons, it's recommended to delete active enrollment tokens as soon as they're not intended to be used anymore.

Request parameters:

parent - Required. The name of the enterprise in the form enterprises/{enterpriseId}. Value must have pattern ^enterprises/\[^/\]+$.

pageSize - The requested page size. The service may return fewer than this value. If unspecified, at most 10 items will be returned. The maximum value is 100; values above 100 will be coerced to 100.

pageToken - A token identifying a page of results returned by the server.

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

Completes with a ListEnrollmentTokensResponse.

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

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

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