The value is on the subclasses, so you have to determine the type and cast 
to that class in order to get the value, something like this:

if (part.getCaseValue() instanceof ProductBrand) { 
    ProductBrand pb = (ProductBrand) part.getCaseValue();
    String value = pb.getValue();
} else if (part.getCaseValue() instanceof ProductCanonicalCondition) {
.....
}


HTH -
mm

On Tuesday, August 26, 2014 7:25:46 AM UTC-5, Ads Developer wrote:
>
> Hi Ray,
>
> Any update on this.
>
> On Friday, August 22, 2014 10:18:00 AM UTC+5:30, Ads Developer wrote:
>>
>> Hi Ray,
>>
>> This is the sample code that I am using to get the above output mentioned.
>>
>> AdGroupCriterionServiceInterface criterionService =  
>>                                   
>> adWordsServices.get(session,AdGroupCriterionServiceInterface.class);
>>      Selector selector = new Selector();
>>      selector.setFields(new String[]{"PartitionType", 
>> "Id","ParentCriterionId","CaseValue"});
>>      Predicate adgrpIdPredicate = new 
>> Predicate("AdGroupId",PredicateOperator.EQUALS,a);
>>      Predicate crTypePredicate = new 
>> Predicate("CriteriaType",PredicateOperator.EQUALS,b);
>>      selector.setPredicates(new 
>> Predicate[]{adgrpIdPredicate,crTypePredicate});
>>      AdGroupCriterionPage get = criterionService.get(selector);
>>      AdGroupCriterion[] entries = get.getEntries();
>>      for(int i=0;i<entries.length;i++){    
>>           
>> System.out.println("ADCRITERIA:"+entries[i].getAdGroupCriterionType());
>>           System.out.println("AdgrpID:"+entries[i].getAdGroupId());
>>           System.out.println("USE:"+entries[i].getCriterionUse());        
>>         }
>>     
>>  
>> if(entries[i].getCriterion().getType().toString().equalsIgnoreCase("PRODUCT_PARTITION")){
>>      ProductPartition part=(ProductPartition) entries[i].getCriterion();
>>      System.out.println("getPartitionType:"+part.getPartitionType());
>>      if(part.getCaseValue()!=null){
>>           
>>  
>> System.out.println("getProductDimensionType:"+part.getCaseValue().getProductDimensionType());
>>            System.out.println("getCaseValue:"+part.getCaseValue());
>>      }
>>     
>>  System.out.println("getParentCriterionId:"+part.getParentCriterionId());
>>      System.out.println("getID:"+part.getId());
>>      System.out.println("getType:"+part.getType());
>>      }
>>
>>
>>  Output contains getCaseValue as 
>> com.google.api.ads.adwords.axis.v201402.cm.ProductCustomAttribute@adf58588
>>  But there is no value attribute.
>>  
>>  And how to match this output with Shopping Performance Report as the 
>> Shopping Performance Report does not have any criteria ID.
>>
>>
>>
>> On Thursday, August 21, 2014 9:39:35 PM UTC+5:30, Ray Tsang (AdWords API 
>> Team) wrote:
>>>
>>> Hi,
>>>
>>> Was the "value" attribute not being returned?
>>>
>>> Thanks!
>>>
>>> Ray
>>>
>>> On Thursday, August 21, 2014 1:39:04 AM UTC-4, Ads Developer wrote:
>>>>
>>>> Hi Team,
>>>>
>>>> I am using AdGroupCriterionServiceInterface to fetch the data related 
>>>> to Product Partition.
>>>>
>>>> I was able to retrieve the following information 
>>>> getPartitionType: UNIT
>>>> getProductDimensionType: ProductCustomAttribute
>>>>
>>>> getCaseValue:com.google.api.ads.adwords.axis.v201402.cm.ProductCustomAttribute@adf58588
>>>> getParentCriterionId:*******
>>>> getID:************
>>>> getType:PRODUCT_PARTITION
>>>>
>>>> And I was able to link the nodes but I was not able to retrieve the 
>>>> display value of the partition type.
>>>> I tried using ConstantDataServiceInterface to get the detailsbut i was 
>>>> not able to get information using the above ids.
>>>>
>>>> Please let me know what is the correct procedure to get the complete 
>>>> product partition tree structure with display names and budget allocated 
>>>> as 
>>>> it is shown in Adwords interface.
>>>>
>>>>
>>>> Thanks in advance 
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/eaf8486d-463c-4d7a-a7eb-beb0c9e9477f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to