Search in sources :

Example 1 with Carrier

use of com.google.api.ads.adwords.axis.v201809.cm.Carrier in project googleads-java-lib by googleads.

the class GetTargetableLanguagesAndCarriers method runExample.

/**
 * Runs the example.
 *
 * @param adWordsServices the services factory.
 * @param session the session.
 * @throws ApiException if the API request failed with one or more service errors.
 * @throws RemoteException if the API request failed due to other errors.
 */
public static void runExample(AdWordsServicesInterface adWordsServices, AdWordsSession session) throws RemoteException {
    // Get the ConstantDataService.
    ConstantDataServiceInterface constantDataService = adWordsServices.get(session, ConstantDataServiceInterface.class);
    // Get all carriers.
    Carrier[] carriers = constantDataService.getCarrierCriterion();
    // Display results.
    for (Carrier carrier : carriers) {
        System.out.printf("Carrier with name '%s', ID %d, and country code '%s' was found.%n", carrier.getName(), carrier.getId(), carrier.getCountryCode());
    }
    // Get all languages.
    Language[] languages = constantDataService.getLanguageCriterion();
    // Display results.
    for (Language language : languages) {
        System.out.printf("Language with name '%s' and ID %d was found.%n", language.getName(), language.getId());
    }
}
Also used : Language(com.google.api.ads.adwords.axis.v201809.cm.Language) Carrier(com.google.api.ads.adwords.axis.v201809.cm.Carrier) ConstantDataServiceInterface(com.google.api.ads.adwords.axis.v201809.cm.ConstantDataServiceInterface)

Aggregations

Carrier (com.google.api.ads.adwords.axis.v201809.cm.Carrier)1 ConstantDataServiceInterface (com.google.api.ads.adwords.axis.v201809.cm.ConstantDataServiceInterface)1 Language (com.google.api.ads.adwords.axis.v201809.cm.Language)1