watch method

Future<WatchCreativesResponse> watch(
  1. WatchCreativesRequest request,
  2. String parent, {
  3. String? $fields,
})

Watches all creatives pertaining to a bidder.

It is sufficient to invoke this endpoint once per bidder. A Pub/Sub topic will be created and notifications will be pushed to the topic when any of the bidder's creatives change status. All of the bidder's service accounts will have access to read from the topic. Subsequent invocations of this method will return the existing Pub/Sub configuration.

request - The metadata request object.

Request parameters:

parent - Required. To watch all creatives pertaining to the bidder and all its child seat accounts, the bidder must follow the pattern bidders/{bidderAccountId}. Value must have pattern ^bidders/\[^/\]+$.

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

Completes with a WatchCreativesResponse.

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<WatchCreativesResponse> watch(
  WatchCreativesRequest request,
  core.String parent, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

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

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