list method

Future<ListClientUsersResponse> list(
  1. String accountId,
  2. String clientAccountId, {
  3. int? pageSize,
  4. String? pageToken,
  5. String? $fields,
})

Lists all the known client users for a specified sponsor buyer account ID.

Request parameters:

accountId - Numerical account ID of the sponsor buyer of the client to list users for. (required)

clientAccountId - The account ID of the client buyer to list users for. (required) You must specify either a string representation of a numerical account identifier or the - character to list all the client users for all the clients of a given sponsor buyer.

pageSize - Requested page size. The server may return fewer clients than requested. If unspecified, the server will pick an appropriate default.

pageToken - A token identifying a page of results the server should return. Typically, this is the value of ListClientUsersResponse.nextPageToken returned from the previous call to the accounts.clients.users.list method.

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

Completes with a ListClientUsersResponse.

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<ListClientUsersResponse> list(
  core.String accountId,
  core.String clientAccountId, {
  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_ = 'v2beta1/accounts/' +
      commons.escapeVariable('$accountId') +
      '/clients/' +
      commons.escapeVariable('$clientAccountId') +
      '/users';

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