retrievePlannableProducts method

Future<RetrievePlannableProductsResponse> retrievePlannableProducts(
  1. String advertiserId, {
  2. String? plannableLocationId,
  3. String? $fields,
})

Retrieves the list of products that can be planned for a location.

API support for generating reach forecasts and retrieving related metadata is in beta. This method is only available to allowlisted users.

Request parameters:

advertiserId - Required. The ID of the advertiser to list plannable products for. Value must have pattern ^\[^/\]+$.

plannableLocationId - Required. The ID of the plannable location.

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

Completes with a RetrievePlannableProductsResponse.

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<RetrievePlannableProductsResponse> retrievePlannableProducts(
  core.String advertiserId, {
  core.String? plannableLocationId,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'plannableLocationId': ?plannableLocationId == null
        ? null
        : [plannableLocationId],
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ =
      'v4/advertisers/' +
      core.Uri.encodeFull('$advertiserId') +
      '/reachForecast:retrievePlannableProducts';

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