Hi. Im trying to update product group with java api( product partition 
tree) so It creates 2 operations for one partition. For example, product 
'X' is excluded couple hours ago. Im setting this as 'biddable'.
Mutation returns  INVALID_PRODUCT_PARTITION_HIERARCHY error. I can't figure 
out  what's wrong

Code:

​ 
ProductPartitionNode rootNode = partitionTree.getRoot(); 
ProductPartitionNode productNode = rootNode.getChild(new ProductOfferId(null
, itemId));

/* if (productNode.isBiddableUnit())
productNode.setBid((long) (maxCPC * MICROS_PER_DOLLAR));
*/
Iterable<ProductPartitionNode> children = productNode.getChildren();
if (children.iterator().hasNext()) {
log.info("Product Node Type '" + itemId + "' cannot be changed because has 
child nodes.");
continue;
}

if(productNode.isSubdivision()){
log.info("Product Node Type '" + itemId + "' cannot be changed because its 
subdivision.");
continue;
}

switch (productGroupType) {
case EXCLUDED:
if (productNode.getParent() == null) {
log.info("Product Node Type '" + itemId + "' cannot be changed to excluded 
because has not parent node.");
break;
}
productNode.asExcludedUnit();
break;
case BIDDABLE:
productNode.asBiddableUnit();
productNode.setBid((long) (maxCPC * MICROS_PER_DOLLAR));
break out ;
}


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/84eed383-7358-4669-b541-bdbf6cb37456%40googlegroups.com.

Reply via email to