Package com.google.api.ads.dfp.axis.v201211

Examples of com.google.api.ads.dfp.axis.v201211.Date


    // Default for total result set size.
    int totalResultSetSize = 0;

    do {
      // Get companies by statement.
      CompanyPage page = companyService.getCompaniesByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (Company company : page.getResults()) {
          System.out.printf(
              "%s) Company with ID \"%d\", name \"%s\", and type \"%s\" was found.\n", i,
              company.getId(), company.getName(), company.getType());
          i++;
        }
View Full Code Here


*/
public class CreateCompanies {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the CompanyService.
    CompanyServiceInterface companyService =
        dfpServices.get(session, CompanyServiceInterface.class);

    // Create an advertiser.
    Company company1 = new Company();
    company1.setName("Advertiser #" + new Random().nextLong());
    company1.setType(CompanyType.ADVERTISER);

    // Create an agency.
    Company company2 = new Company();
    company2.setName("Agency #" + new Random().nextLong());
    company2.setType(CompanyType.AGENCY);

    // Create the companies on the server.
    Company[] companies = companyService.createCompanies(new Company[] {company1, company2});

    for (Company company : companies) {
      System.out.printf("A company with ID \"%d\", name \"%s\", and type \"%s\" was created.\n",
          company.getId(), company.getName(), company.getType());
    }
View Full Code Here

*/
public class GetAdvertisers {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the CompanyService.
    CompanyServiceInterface companyService =
        dfpServices.get(session, CompanyServiceInterface.class);

    // Create a statement to only select companies that are advertisers.
    StatementBuilder statementBuilder = new StatementBuilder()
        .where("type = :type")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("type", CompanyType.ADVERTISER.toString());

    // Default for total result set size.
    int totalResultSetSize = 0;

    do {
      // Get companies by statement.
      CompanyPage page = companyService.getCompaniesByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (Company company : page.getResults()) {
View Full Code Here

*/
public class GetAllCompanies {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the CompanyService.
    CompanyServiceInterface companyService =
        dfpServices.get(session, CompanyServiceInterface.class);

    // Create a statement to get all companies.
    StatementBuilder statementBuilder = new StatementBuilder()
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

    // Default for total result set size.
    int totalResultSetSize = 0;

    do {
      // Get companies by statement.
      CompanyPage page = companyService.getCompaniesByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (Company company : page.getResults()) {
View Full Code Here

  static final String COMPANY_ID = "INSERT_COMPANY_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session, Long companyId)
      throws Exception {
    // Get the CompanyService.
    CompanyServiceInterface companyService =
        dfpServices.get(session, CompanyServiceInterface.class);

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

    // Update the comment.
    company.setComment(company.getComment() + " Updated.");

    // Update the companies on the server.
    Company[] companies = companyService.updateCompanies(new Company[] {company});

    for (Company updatedCompany : companies) {
      System.out.printf(
          "Company with ID \"%d\", name \"%s\", and comment \"%s\" was updated.\n",
          updatedCompany.getId(), updatedCompany.getName(), updatedCompany.getComment());
View Full Code Here

    // Get the CreativeWrapperService.
    CreativeWrapperServiceInterface creativeWrapperService =
        dfpServices.get(session, CreativeWrapperServiceInterface.class);

    // Get the creative wrapper.
    CreativeWrapper creativeWrapper = creativeWrapperService.getCreativeWrapper(creativeWrapperId);

    creativeWrapper.setOrdering(CreativeWrapperOrdering.OUTER);
   
    // Update the creative wrappers on the server.
    CreativeWrapper[] creativeWrappers =
        creativeWrapperService.updateCreativeWrappers(new CreativeWrapper[] {creativeWrapper});
View Full Code Here

    // Get the CreativeWrapperService.
    CreativeWrapperServiceInterface creativeWrapperService =
        dfpServices.get(session, CreativeWrapperServiceInterface.class);

    // Create a creative wrapper.
    CreativeWrapper innerCreativeWrapper = new CreativeWrapper();
    // A label can only be associated with one creative wrapper.
    innerCreativeWrapper.setLabelId(labelId);
    innerCreativeWrapper.setOrdering(CreativeWrapperOrdering.INNER);
    innerCreativeWrapper.setHeader(
        new CreativeWrapperHtmlSnippet("<b>My creative wrapper header</b>"));
    innerCreativeWrapper.setFooter(
        new CreativeWrapperHtmlSnippet("<b>My creative wrapper footer</b>"));

    // Create the creative wrappers on the server.
    CreativeWrapper[] creativeWrappers =
        creativeWrapperService.createCreativeWrappers(new CreativeWrapper[] {innerCreativeWrapper});
View Full Code Here

    CreativeWrapper innerCreativeWrapper = new CreativeWrapper();
    // A label can only be associated with one creative wrapper.
    innerCreativeWrapper.setLabelId(labelId);
    innerCreativeWrapper.setOrdering(CreativeWrapperOrdering.INNER);
    innerCreativeWrapper.setHeader(
        new CreativeWrapperHtmlSnippet("<b>My creative wrapper header</b>"));
    innerCreativeWrapper.setFooter(
        new CreativeWrapperHtmlSnippet("<b>My creative wrapper footer</b>"));

    // Create the creative wrappers on the server.
    CreativeWrapper[] creativeWrappers =
        creativeWrapperService.createCreativeWrappers(new CreativeWrapper[] {innerCreativeWrapper});
View Full Code Here

    // Default for total result set size.
    int totalResultSetSize = 0;

    do {
      // Get creative wrappers by statement.
      CreativeWrapperPage page =
          creativeWrapperService.getCreativeWrappersByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (CreativeWrapper creativeWrapper : page.getResults()) {
          System.out.printf(
              "%d) Creative wrapper with ID \"%d\" applying to label \"%s\" was found.\n", i++,
              creativeWrapper.getId(), creativeWrapper.getLabelId());         
        }
      }
View Full Code Here

    int totalResultSetSize = 0;
    List<Long> creativeWrapperIds = new ArrayList<Long>();

    do {
      // Get creative wrappers by statement.
      CreativeWrapperPage page =
          creativeWrapperService.getCreativeWrappersByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (CreativeWrapper creativeWrapper : page.getResults()) {
          System.out.printf("%d) Creative wrapper with ID \"%d\" applying to label"
              + " \"%s\" will be deactivated.\n", i++, creativeWrapper.getId(),
              creativeWrapper.getLabelId());
          creativeWrapperIds.add(creativeWrapper.getId());
        }
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.axis.v201211.Date

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.