{
    // A map of deprecated geo targets to the line items targeting them.
    $lineItemsToUpdate = array();
    foreach ($geoTargetToLineItemsMap as $geoTargetId => $lineItemIds) {
        if (in_array($geoTargetId, $untargetableLocationIds)) {
            $lineItemsToUpdate[$geoTargetId] = $lineItemIds;
        }
    }
    return $lineItemsToUpdate;
}
try {
    // Get DfpUser from credentials in "../auth.ini"
    // relative to the DfpUser.php file's directory.
    $user = new DfpUser();
    // Log SOAP XML request and response.
    $user->LogAll();
    // Find all untargetable locations.
    $untargetableLocationIds = getAllUntargetableLocations($user);
    printf("Found %d untargetable locations.\n", count($untargetableLocationIds));
    // Build a map of geo targets to the line items targeting them.
    $geoTargetToLineItemsMap = buildGeoTargetToLineItemsMap($user);
    // Find all the deprecated geo targets from that map.
    $lineItemsToUpdate = findLineItemsToUpdate($geoTargetToLineItemsMap, $untargetableLocationIds);
    $i = 0;
    // Print the line items that need to be updated.
    foreach ($lineItemsToUpdate as $geoTargetId => $lineItemIds) {
        printf("%d) The following line items are targeting deprecated location %d" . " and need to be updated: %s\n", $i, $geoTargetId, implode(', ', $lineItemIds));
        $i++;
    }
} catch (OAuth2Exception $e) {
    ExampleUtils::CheckForOAuth2Errors($e);