list method

Future<Accounts> list(
  1. List<String> filterAdClientId, {
  2. String? $fields,
})

List hosted accounts associated with this AdSense account by ad client id.

Request parameters:

filterAdClientId - Ad clients to list accounts for.

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

Completes with a Accounts.

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<Accounts> list(
  core.List<core.String> filterAdClientId, {
  core.String? $fields,
}) async {
  if (filterAdClientId.isEmpty) {
    throw core.ArgumentError('Parameter filterAdClientId cannot be empty.');
  }
  final queryParams_ = <core.String, core.List<core.String>>{
    'filterAdClientId': filterAdClientId,
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'accounts';

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