list method

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

Lists all the clients for the current sponsor buyer.

Request parameters:

accountId - Unique numerical account ID of the sponsor buyer to list the clients for.

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 ListClientsResponse.nextPageToken returned from the previous call to the accounts.clients.list method.

partnerClientId - Optional unique identifier (from the standpoint of an Ad Exchange sponsor buyer partner) of the client to return. If specified, at most one client will be returned in the response.

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

Completes with a ListClientsResponse.

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

  final _url =
      'v2beta1/accounts/' + commons.escapeVariable('$accountId') + '/clients';

  final _response = await _requester.request(
    _url,
    'GET',
    queryParams: _queryParams,
  );
  return ListClientsResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}