sendRfp method

Future<Proposal> sendRfp(
  1. SendRfpRequest request,
  2. String buyer, {
  3. String? $fields,
})

Sends a request for proposal (RFP) to a publisher to initiate the negotiation regarding certain inventory.

In the RFP, buyers can specify the deal type, deal terms, start and end dates, targeting, and a message to the publisher. Once the RFP is sent, a proposal in SELLER_REVIEW_REQUESTED state will be created and returned in the response. The publisher may review your request and respond with detailed deals in the proposal.

request - The metadata request object.

Request parameters:

buyer - Required. The current buyer who is sending the RFP in the format: buyers/{accountId}. Value must have pattern ^buyers/\[^/\]+$.

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

Completes with a Proposal.

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<Proposal> sendRfp(
  SendRfpRequest request,
  core.String buyer, {
  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('$buyer') + '/proposals:sendRfp';

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