list method

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

Lists the customers that are enrolled to the reseller identified by the partnerId argument.

This list includes customers that the reseller created and customers that enrolled themselves using the portal.

Request parameters:

partnerId - Required. The ID of the reseller partner. Value must have pattern ^\[^/\]+$.

pageSize - The maximum number of results to be returned. If not specified or 0, all the records are returned.

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 ListCustomersResponse.

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<ListCustomersResponse> list(
  core.String partnerId, {
  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/partners/' + core.Uri.encodeFull('$partnerId') + '/customers';

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