get method

Future<InsertionOrder> get(
  1. String advertiserId,
  2. String insertionOrderId, {
  3. String? $fields,
})

Gets an insertion order.

Returns error code NOT_FOUND if the insertion order does not exist.

Request parameters:

advertiserId - Required. The ID of the advertiser this insertion order belongs to. Value must have pattern ^\[^/\]+$.

insertionOrderId - Required. The ID of the insertion order to fetch. Value must have pattern ^\[^/\]+$.

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

Completes with a InsertionOrder.

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<InsertionOrder> get(
  core.String advertiserId,
  core.String insertionOrderId, {
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v2/advertisers/' +
      core.Uri.encodeFull('$advertiserId') +
      '/insertionOrders/' +
      core.Uri.encodeFull('$insertionOrderId');

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