Package example17

Examples of example17.Company


    // 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 company on the server.
    Company[] companies = companyService.updateCompanies(new Company[] {company});

    for (Company updatedCompany : companies) {
View Full Code Here


    // 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 company on the server.
    Company[] companies = companyService.updateCompanies(new Company[] {company});

    for (Company updatedCompany : companies) {
View Full Code Here

    // Get the CompanyService.
    CompanyServiceInterface companyService =
        dfpServices.get(session, CompanyServiceInterface.class);

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

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

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

    for (Company createdCompany : companies) {
View Full Code Here

    // Get the CompanyService.
    CompanyServiceInterface companyService =
        dfpServices.get(session, CompanyServiceInterface.class);

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

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

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

    for (Company createdCompany : companies) {
View Full Code Here

    // 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 company on the server.
    Company[] companies = companyService.updateCompanies(new Company[] {company});

    for (Company updatedCompany : companies) {
View Full Code Here

        .withNetworkCode("TEST_NETWORK_CODE")
        .build();

    CompanyServiceInterface companyService =
        new DfpServices().get(session, CompanyServiceInterface.class);
    List<Company> companies = companyService.createCompanies(Lists.newArrayList(new Company()));

    assertEquals(1234L, companies.get(0).getId().longValue());
    assertEquals(SoapRequestXmlProvider.getClientLoginSoapRequest(API_VERSION),
        testHttpServer.getLastRequestBody());
  }
View Full Code Here

        .withNetworkCode("TEST_NETWORK_CODE")
        .build();

    CompanyServiceInterface companyService =
        new DfpServices().get(session, CompanyServiceInterface.class);
    List<Company> companies = companyService.createCompanies(Lists.newArrayList(new Company()));

    assertEquals(1234L, companies.get(0).getId().longValue());
    assertEquals(SoapRequestXmlProvider.getOAuth2SoapRequest(API_VERSION),
        testHttpServer.getLastRequestBody());
    assertEquals("Bearer TEST_ACCESS_TOKEN", testHttpServer.getLastAuthorizationHttpHeader());
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

      // 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

TOP

Related Classes of example17.Company

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.