setReadyToServe method
- SetReadyToServeRequest request,
- String deal, {
- String? $fields,
Sets the given finalized deal as ready to serve.
By default, deals are set as ready to serve as soon as they're finalized.
If you want to opt out of the default behavior, and manually indicate that
deals are ready to serve, ask your Technical Account Manager to add you to
the allowlist. If you choose to use this method, finalized deals belonging
to the bidder and its child seats don't start serving until after you call
setReadyToServe
, and after the deals become active. For example, you can
use this method to delay receiving bid requests until your creative is
ready. This method only applies to programmatic guaranteed deals.
request
- The metadata request object.
Request parameters:
deal
- Required. Format: buyers/{accountId}/finalizedDeals/{dealId}
Value must have pattern ^buyers/\[^/\]+/finalizedDeals/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a FinalizedDeal.
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<FinalizedDeal> setReadyToServe(
SetReadyToServeRequest request,
core.String deal, {
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('$deal') + ':setReadyToServe';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return FinalizedDeal.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}