googleads / google-ads-java

Google Ads API Client Library for Java
Apache License 2.0
171 stars 177 forks source link

FieldMasks.allSetFieldsOf() doesnt work correct for subpaths #104

Closed NF13 closed 5 years ago

NF13 commented 5 years ago

I have a problem with all FieldMasks.allSetFieldsOf() for objects with sub objects for example AdGroupCriterion

KeywordInfo keywordInfo = KeywordInfo.newBuilder().setText(StringValue.of("test")).build();
AdGroupCriterion criterion = AdGroupCriterion.newBuilder().setResourceName(ResourceNames.adGroupCriterion(Long.parseLong(order.getGoogleCustomerId()), adGroup.getGoogleId(), keyword.getGoogleId()))
    .setStatus(AdGroupCriterionStatus.ENABLED)
    .setKeyword(keywordInfo).build();
System.out.println(FieldMasks.allSetFieldsOf(criterion));

Response:

paths: "resource_name"
paths: "status"
paths: "keyword.text"
paths: "keyword.match_type"

Why match_type I didn't set the keyword.match_type so my update for the keyword doesnt work because I can not update the match_type so I have do build the FieldMask by myself.

NF13 commented 5 years ago

You cannot modify the keyword or ads you have to delete it and create it