list method

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

Lists all the clients for the current buyer.

Request parameters:

parent - Required. The name of the buyer. Format: buyers/{accountId} Value must have pattern ^buyers/\[^/\]+$.

filter - Query string using the Filtering Syntax Supported fields for filtering are: * partnerClientId Use this field to filter the clients by the partnerClientId. For example, if the partnerClientId of the client is "1234", the value of this field should be partnerClientId = "1234", in order to get only the client whose partnerClientId is "1234" in the response.

pageSize - Requested page size. If left blank, a default page size of 500 will be applied.

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 list method.

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

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

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