create method

Future<FilterSet> create(
  1. FilterSet request,
  2. String ownerName, {
  3. bool? isTransient,
  4. String? $fields,
})

Creates the specified filter set for the account with the given account ID.

request - The metadata request object.

Request parameters:

ownerName - Name of the owner (bidder or account) of the filter set to be created. For example: - For a bidder-level filter set for bidder 123: bidders/123 - For an account-level filter set for the buyer account representing bidder 123: bidders/123/accounts/123 - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: bidders/123/accounts/456 Value must have pattern ^bidders/\[^/\]+$.

isTransient - Whether the filter set is transient, or should be persisted indefinitely. By default, filter sets are not transient. If transient, it will be available for at least 1 hour after creation.

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

Completes with a FilterSet.

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<FilterSet> create(
  FilterSet request,
  core.String ownerName, {
  core.bool? isTransient,
  core.String? $fields,
}) async {
  final _body = convert.json.encode(request);
  final _queryParams = <core.String, core.List<core.String>>{
    if (isTransient != null) 'isTransient': ['${isTransient}'],
    if ($fields != null) 'fields': [$fields],
  };

  final _url = 'v2beta1/' + core.Uri.encodeFull('$ownerName') + '/filterSets';

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