google-ads-ruby icon indicating copy to clipboard operation
google-ads-ruby copied to clipboard

Google::Ads::GoogleAds::GoogleAdsClient#service.feed_item.mutate_feed_items returns error for unused field FIELD_CANNOT_BE_CLEARED

Open sugilog opened this issue 5 years ago • 0 comments

Hi,

Now I try to rewrite my API call to feed and feed_item operation from Adwords API to Google Ads API. I have a problem when I call mutate_feed_items for DYNAMIC_CUSTOM feed, and it seems to be a bug.

My code like the following, ...

# client = Google::Ads::Googleds::GoogleAdsClient instance
# original_feed_item = generate via client.resource.feed_item, attributes from API query result.

operations = []

operation = client.operation.update_resource.feed_item(original_feed_item) do |modify_feed_item|
  ...
  # set values to update
end

if !opearation.update_mask.empty?
  operations << operation
end

if !operations.empty?
  client.service.feed_item.mutate_feed_items(MY_CUSTOMER_ID, operations)
end

then it raise error Google::Gax::InvalidArgumentError, and logged.

I, [2019-08-07T14:47:16.960735 #76554]  INFO -- : Incoming response (errors):
Error 1: {"errorCode":{"fieldError":"FIELD_CANNOT_BE_CLEARED"},"message":"The field cannot be cleared.","location":{"fieldPathElements":[{"fieldName":"operations","index":},{"fieldName":"update"},{"fieldName":"attribute_values"},{"fieldName":"boolean_value"}]}}
...

feed_item for DYNAMIC_CUSTOM has no field of type boolean, so it seems to be a bug.

sugilog avatar Aug 07 '19 05:08 sugilog