Hello,
this is a carryover from the client library issue here:
Also, I've been testing out solutions found here:
But things just won't work out. So I'll try to phrase the problem as simply as possible:
how would you fabricate an UPDATE request that changes a promotion extension to use pecentOff instead of moneyAmountOff (which has been previously set)? And also, vice versa: how would you update a promotion extension to switch to moneyAmonutOff from percentOff?
Simply setting the fields won't work, requests like this:
update {
resource_name: "customers/
4238627020/extensionFeedItems/170048763759"
promotion_feed_item {
money_amount_off {
currency_code: "HUF"
amount_micros: 1850000000
}
promotion_target: "Wellis Huron El\305\221lap"
}
extension_type: PROMOTION
}
update_mask {
paths: "resource_name"
paths: "extension_type"
paths: "promotion_feed_item.promotion_target"
paths: "promotion_feed_item.final_urls"
paths: "promotion_feed_item.money_amount_off.currency_code"
paths: "promotion_feed_item.money_amount_off.amount_micros"
}
fail with an "invalid argument" error - as they most likely should, as in the example above, percent_off is already set, and so in this case, the operation fails with invalid argument for currency_code. But how can you "unset" percent_off to make currency_code legal? (And the other way around: how would you "unset" currency_code and amount_micros (and money_amount_off) to make percent_off legal?)
I've tried setting percent_off to "-1" for the example above, but that just results in a field has invalid value error. Do note however, that the client library, for some reason, removes money_amount_off from the update operation if percent_off is the last item set, and also the other way around. This means that I could most likely only hack this argument into the update operation to make things work.
Can you help me out?