While I am successfully able to query any other AdWords service for existing entities, I seem to have hit a wall retrieving entities from the AdGroupExtensionSettingService (v201607). Here is my function.
public function _getAdGroupExtensionSettings(\AdGroupExtensionSettingService $adGroupExtensionSettingService, $adgroup_id)
{
$adGroupExtensionSettings = array();
$selector = new \Selector();
$selector->fields = array('AdGroupId','ExtensionType','Extensions');
$selector->predicates[] = new \Predicate('AdGroupId', 'EQUALS', (string) $adgroup_id);
$selector->predicates[] = new \Predicate('ExtensionType', 'EQUALS', 'PRICE');
// Create paging controls.
$selector->paging = new \Paging(0, \AdWordsConstants::RECOMMENDED_PAGE_SIZE);
$i = 0;
do {
// Make the get request.
$page = $adGroupExtensionSettingService->get($selector);
// Get results.
if (isset($page->entries)) {
foreach($page->entries as $setting) {
$adGroupExtensionSettings[] = $setting;
}
}
// Advance the paging index.
$selector->paging->startIndex += \AdWordsConstants::RECOMMENDED_PAGE_SIZE;
} while ($page->totalNumEntries > $selector->paging->startIndex);
return $adGroupExtensionSettings;
}
Judging from the documentation, it should be straightforward to query this service the same way as any other:
https://developers.google.com/adwords/api/docs/reference/v201607/AdGroupExtensionSettingService#get
I have triple checked to ensure the adgroup_id I am passing corresponds with an adgroup in this account which does have price extensions. I have also tried, for debugging purposes, to remove the AdGroupId predicate and/or the ExtensionType predicate, all to no avail.