get method

Future<InventorySource> get(
  1. String inventorySourceId, {
  2. String? advertiserId,
  3. String? partnerId,
  4. String? $fields,
})

Gets an inventory source.

Request parameters:

inventorySourceId - Required. The ID of the inventory source to fetch. Value must have pattern ^\[^/\]+$.

advertiserId - Optional. The ID of the DV360 advertiser to which the fetched inventory source is permissioned. If the user only has access to the advertiser and not the parent partner, use this field to specify the relevant advertiser.

partnerId - Required. The ID of the DV360 partner to which the fetched inventory source is permissioned.

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

Completes with a InventorySource.

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

  final url_ =
      'v3/inventorySources/' + core.Uri.encodeFull('$inventorySourceId');

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