patch method

Future<InventorySourceGroup> patch(
  1. InventorySourceGroup request,
  2. String inventorySourceGroupId, {
  3. String? advertiserId,
  4. String? partnerId,
  5. String? updateMask,
  6. String? $fields,
})

Updates an inventory source group.

Returns the updated inventory source group if successful.

request - The metadata request object.

Request parameters:

inventorySourceGroupId - Output only. The unique ID of the inventory source group. Assigned by the system.

advertiserId - The ID of the advertiser that owns the inventory source group. The parent partner does not have access to this group.

partnerId - The ID of the partner that owns the inventory source group. Only this partner has write access to this group.

updateMask - Required. The mask to control which fields to update.

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

Completes with a InventorySourceGroup.

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<InventorySourceGroup> patch(
  InventorySourceGroup request,
  core.String inventorySourceGroupId, {
  core.String? advertiserId,
  core.String? partnerId,
  core.String? updateMask,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (advertiserId != null) 'advertiserId': [advertiserId],
    if (partnerId != null) 'partnerId': [partnerId],
    if (updateMask != null) 'updateMask': [updateMask],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v2/inventorySourceGroups/' +
      commons.escapeVariable('$inventorySourceGroupId');

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