public void Run(AdWordsUser user)
{
// Get the ConstantDataService.
ConstantDataService constantDataService = (ConstantDataService) user.GetService(
AdWordsService.v201306.ConstantDataService);
try {
// Get all carriers.
Carrier[] carriers = constantDataService.getCarrierCriterion();
// Display the results.
if (carriers != null) {
foreach (Carrier carrier in carriers) {
Console.WriteLine("Carrier name is '{0}', ID is {1} and country code is '{2}'.",
carrier.name, carrier.id, carrier.countryCode);
}
} else {
Console.WriteLine("No carriers were retrieved.");
}
// Get all languages.
Language[] languages = constantDataService.getLanguageCriterion();
// Display the results.
if (languages != null) {
foreach (Language language in languages) {
Console.WriteLine("Language name is '{0}', ID is {1} and code is '{2}'.",
language.name, language.id, language.code);
}
} else {
Console.WriteLine("No languages were found.");
}
} catch (Exception ex) {
throw new System.ApplicationException("Failed to get targetable carriers and languages.",
ex);
}
}