We currently do not have a direct code sample for this. However, I can suggest you on how to implement this. You could setup the partition tree with the
NegativeAdGroupCriterion where you can set the 'Everything else' partition to exclude the base node, which is a UNIT type. The
NegativeAdGroupCriterion indicates that you do not wish to bid for this particular leaf in the AdGroup.
Thanks,
Bharani, AdWords API Team.