Hi all,
I am having some trouble getting the fields of an AdGroupCritrerion object that I have obtain thought a call to AdGroupCriterionService.
In the selector builder I add several fields and if I inspect the object with the debugger there they are indeed but I am unable to get them as they seem to be private attributes and there are no get method to retrieve them.
This is the code
SelectorBuilder builder = new SelectorBuilder();
Selector selector = builder
.fields(
AdGroupCriterionField.Id,
AdGroupCriterionField.FinalUrls,
AdGroupCriterionField.Status,
AdGroupCriterionField.KeywordText)
.in(AdGroupCriterionField.CriteriaType, "KEYWORD")
.equals(AdGroupCriterionField.Status, "ENABLED")
.build();
AdGroupCriterionPage page = keywordService.get(selector);
for(AdGroupCriterion keyword: page.getEntries()){
System.out.println(keyword.getCriterion().getId());
System.out.println(((Keyword) keyword.getCriterion()).getText());
System.out.println(keyword.getFinalUrls() //What I expected
}
I am confident that there is a way to retrieve those fields, maybe casting to another class like with the getText() line or through another object but I haven't been able to find the way.
I hope I was clear and thank you.