Package com.google.api.ads.dfp.v201306

Examples of com.google.api.ads.dfp.v201306.DropDownCustomField


      // Get the custom field.
      CustomField customField = customFieldService.getCustomField(customFieldId);

      // Get the drop-down custom field.
      DropDownCustomField dropDownCustomField =
          (DropDownCustomField) customFieldService.getCustomField(dropDownCustomFieldId);

      // Get the line item.
      LineItem lineItem = lineItemService.getLineItem(lineItemId);
View Full Code Here


        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (CustomField customField : page.getResults()) {
            if (customField instanceof DropDownCustomField) {
              List<String> dropDownCustomFieldStrings = new ArrayList<String>();
              DropDownCustomField dropDownCustomField = (DropDownCustomField) customField;
              if (dropDownCustomField.getOptions() != null) {
                for (CustomFieldOption customFieldOption : dropDownCustomField.getOptions()) {
                  dropDownCustomFieldStrings.add(customFieldOption.getDisplayName());
                }
              }
              System.out.println(i + ") Drop-down custom field with ID \"" + customField.getId()
                  + "\", name \"" + customField.getName() + "\", and options {"
View Full Code Here

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (CustomField customField : page.getResults()) {
            if (customField instanceof DropDownCustomField) {
              List<String> dropDownCustomFieldStrings = new ArrayList<String>();
              DropDownCustomField dropDownCustomField = (DropDownCustomField) customField;
              if (dropDownCustomField.getOptions() != null) {
                for (CustomFieldOption customFieldOption : dropDownCustomField.getOptions()) {
                  dropDownCustomFieldStrings.add(customFieldOption.getDisplayName());
                }
              }
              System.out.println(i + ") Drop-down custom field with ID \"" + customField.getId()
                  + "\", name \"" + customField.getName() + "\", and options {"
View Full Code Here

      // Get the custom field.
      CustomField customField = customFieldService.getCustomField(customFieldId);

      // Get the drop-down custom field.
      DropDownCustomField dropDownCustomField =
          (DropDownCustomField) customFieldService.getCustomField(dropDownCustomFieldId);

      // Get the line item.
      LineItem lineItem = lineItemService.getLineItem(lineItemId);
View Full Code Here

      // Get the custom field.
      CustomField customField = customFieldService.getCustomField(customFieldId);

      // Get the drop-down custom field.
      DropDownCustomField dropDownCustomField =
          (DropDownCustomField) customFieldService.getCustomField(dropDownCustomFieldId);

      // Get the line item.
      LineItem lineItem = lineItemService.getLineItem(lineItemId);
View Full Code Here

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (CustomField customField : page.getResults()) {
            if (customField instanceof DropDownCustomField) {
              List<String> dropDownCustomFieldStrings = new ArrayList<String>();
              DropDownCustomField dropDownCustomField = (DropDownCustomField) customField;
              if (dropDownCustomField.getOptions() != null) {
                for (CustomFieldOption customFieldOption : dropDownCustomField.getOptions()) {
                  dropDownCustomFieldStrings.add(customFieldOption.getDisplayName());
                }
              }
              System.out.println(i + ") Drop-down custom field with ID \"" + customField.getId()
                  + "\", name \"" + customField.getName() + "\", and options {"
View Full Code Here

      return (Value) value;
    } else if (value == null) {
      return new TextValue(null, null);
    } else {
      if (value instanceof Boolean) {
        return new BooleanValue(null, (Boolean) value);
      } else if (value instanceof Double) {
        return new NumberValue(null, value.toString());
      } else if (value instanceof String) {
        return new TextValue(null, (String) value);
      } else if (value instanceof Long) {
View Full Code Here

      // Set the ID of the company to get.
      Long companyId = Long.parseLong("INSERT_COMPANY_ID_HERE");

      // Get the company.
      Company company = companyService.getCompany(companyId);

      if (company != null) {
        System.out.println("Company with ID \"" + company.getId()
            + "\", name \"" + company.getName()
            + "\", and type \"" + company.getType() + "\" was found.");
      } else {
        System.out.println("No company found for this ID.");
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

      // Create an array to store local company objects.
      Company[] companies = new Company[5];

      for (int i = 0; i < 5; i++) {
        Company company = new Company();
        company.setName("Advertiser #" + i);
        company.setType(CompanyType.ADVERTISER);
        companies[i] = company;
      }

      // Create the companies on the server.
      companies = companyService.createCompanies(companies);

      if (companies != null) {
        for (Company company : companies) {
          System.out.println("A company with ID \"" + company.getId()
              + "\", name \"" + company.getName()
              + "\", and type \"" + company.getType() + "\" was created.");
        }
      } else {
        System.out.println("No companies created.");
      }
    } catch (Exception e) {
View Full Code Here

      // Get the CompanyService.
      CompanyServiceInterface companyService =
          user.getService(DfpService.V201306.COMPANY_SERVICE);

      // Set defaults for page and filterStatement.
      CompanyPage page = new CompanyPage();
      Statement filterStatement = new Statement();
      int offset = 0;

      do {
        // Create a statement to get all companies.
        filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

        // Get companies by statement.
        page = companyService.getCompaniesByStatement(filterStatement);

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (Company company : page.getResults()) {
            System.out.println(i + ") Company with ID \"" + company.getId()
                + "\", name \"" + company.getName()
                + "\", and type \"" + company.getType() + "\" was found.");
            i++;
          }
        }

        offset += 500;
      } while (offset < page.getTotalResultSetSize());

      System.out.println("Number of results found: " + page.getTotalResultSetSize());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.v201306.DropDownCustomField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.