Examples of ContactServiceInterface


Examples of com.google.api.ads.dfp.axis.v201302.ContactServiceInterface

  private static final String CONTACT_ID = "INSERT_CONTACT_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session, long contactId)
      throws Exception {
    // Get the ContactService.
    ContactServiceInterface contactService =
        dfpServices.get(session, ContactServiceInterface.class);

    // Get the contact.
    Contact contact = contactService.getContact(contactId);

    // Update the address of the contact.
    contact.setAddress("123 New Street, New York, NY, 10011");

    // Update the contact on the server.
    Contact[] contacts = contactService.updateContacts(new Contact[] {contact});

    for (Contact updatedContact : contacts) {
      System.out.printf(
          "Contact with ID \"%d\", name \"%s\", and address \"%s\" was updated.\n",
          updatedContact.getId(), updatedContact.getName(), updatedContact.getAddress());
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201302.ContactServiceInterface

*/
public class GetUninvitedContacts {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the ContactService.
    ContactServiceInterface contactService =
        dfpServices.get(session, ContactServiceInterface.class);

    // Create a statement to only select contacts that aren't invited yet.
    StatementBuilder statementBuilder = new StatementBuilder()
        .where("status = :status")
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("status", ContactStatus.UNINVITED.toString());

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

    do {
      // Get contacts by statement.
      ContactPage page = contactService.getContactsByStatement(statementBuilder.toStatement());

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

Examples of com.google.api.ads.dfp.axis.v201302.ContactServiceInterface

*/
public class GetAllContacts {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the ContactService.
    ContactServiceInterface contactService =
        dfpServices.get(session, ContactServiceInterface.class);

    // Create a statement to get all contacts.
    StatementBuilder statementBuilder = new StatementBuilder()
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

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

    do {
      // Get contacts by statement.
      ContactPage page = contactService.getContactsByStatement(statementBuilder.toStatement());

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

Examples of com.google.api.ads.dfp.axis.v201302.ContactServiceInterface

  private static final String AGENCY_ID = "INSERT_AGENCY_COMPANY_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session,
      long advertiserCompanyId, long agencyCompanyId) throws Exception {
    // Get the ContactService.
    ContactServiceInterface contactService =
        dfpServices.get(session, ContactServiceInterface.class);

    // Create an advertiser contact.
    Contact advertiserContact = new Contact();
    advertiserContact.setName("Mr. Advertiser #" + new Random().nextInt(Integer.MAX_VALUE));
    advertiserContact.setEmail("advertiser@advertising.com");
    advertiserContact.setCompanyId(advertiserCompanyId);

    // Create an agency contact.
    Contact agencyContact = new Contact();
    agencyContact.setName("Ms. Agency #" + new Random().nextInt(Integer.MAX_VALUE));
    agencyContact.setEmail("agency@agencies.com");
    agencyContact.setCompanyId(agencyCompanyId);

    // Create the contacts on the server.
    Contact[] contacts =
        contactService.createContacts(new Contact[] {advertiserContact, agencyContact});

    for (Contact createdContact : contacts) {
      System.out.printf("A contact with ID \"%d\" and name \"%s\" was created.\n",
          createdContact.getId(), createdContact.getName());
    }
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201306.ContactServiceInterface

  private static final String AGENCY_ID = "INSERT_AGENCY_COMPANY_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session,
      long advertiserCompanyId, long agencyCompanyId) throws Exception {
    // Get the ContactService.
    ContactServiceInterface contactService =
        dfpServices.get(session, ContactServiceInterface.class);

    // Create an advertiser contact.
    Contact advertiserContact = new Contact();
    advertiserContact.setName("Mr. Advertiser #" + new Random().nextInt(Integer.MAX_VALUE));
    advertiserContact.setEmail("advertiser@advertising.com");
    advertiserContact.setCompanyId(advertiserCompanyId);

    // Create an agency contact.
    Contact agencyContact = new Contact();
    agencyContact.setName("Ms. Agency #" + new Random().nextInt(Integer.MAX_VALUE));
    agencyContact.setEmail("agency@agencies.com");
    agencyContact.setCompanyId(agencyCompanyId);

    // Create the contacts on the server.
    Contact[] contacts =
        contactService.createContacts(new Contact[] {advertiserContact, agencyContact});

    for (Contact createdContact : contacts) {
      System.out.printf("A contact with ID \"%d\" and name \"%s\" was created.\n",
          createdContact.getId(), createdContact.getName());
    }
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201306.ContactServiceInterface

  private static final String CONTACT_ID = "INSERT_CONTACT_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session, long contactId)
      throws Exception {
    // Get the ContactService.
    ContactServiceInterface contactService =
        dfpServices.get(session, ContactServiceInterface.class);

    // Get the contact.
    Contact contact = contactService.getContact(contactId);

    // Update the address of the contact.
    contact.setAddress("123 New Street, New York, NY, 10011");

    // Update the contact on the server.
    Contact[] contacts = contactService.updateContacts(new Contact[] {contact});

    for (Contact updatedContact : contacts) {
      System.out.printf(
          "Contact with ID \"%d\", name \"%s\", and address \"%s\" was updated.\n",
          updatedContact.getId(), updatedContact.getName(), updatedContact.getAddress());
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201306.ContactServiceInterface

*/
public class GetUninvitedContacts {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the ContactService.
    ContactServiceInterface contactService =
        dfpServices.get(session, ContactServiceInterface.class);

    // Create a statement to only select contacts that aren't invited yet.
    StatementBuilder statementBuilder = new StatementBuilder()
        .where("status = :status")
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("status", ContactStatus.UNINVITED.toString());

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

    do {
      // Get contacts by statement.
      ContactPage page = contactService.getContactsByStatement(statementBuilder.toStatement());

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

Examples of com.google.api.ads.dfp.axis.v201306.ContactServiceInterface

*/
public class GetAllContacts {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the ContactService.
    ContactServiceInterface contactService =
        dfpServices.get(session, ContactServiceInterface.class);

    // Create a statement to get all contacts.
    StatementBuilder statementBuilder = new StatementBuilder()
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

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

    do {
      // Get contacts by statement.
      ContactPage page = contactService.getContactsByStatement(statementBuilder.toStatement());

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

Examples of com.google.api.ads.dfp.axis.v201308.ContactServiceInterface

  private static final String CONTACT_ID = "INSERT_CONTACT_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session, long contactId)
      throws Exception {
    // Get the ContactService.
    ContactServiceInterface contactService =
        dfpServices.get(session, ContactServiceInterface.class);

    // Get the contact.
    Contact contact = contactService.getContact(contactId);

    // Update the address of the contact.
    contact.setAddress("123 New Street, New York, NY, 10011");

    // Update the contact on the server.
    Contact[] contacts = contactService.updateContacts(new Contact[] {contact});

    for (Contact updatedContact : contacts) {
      System.out.printf(
          "Contact with ID \"%d\", name \"%s\", and address \"%s\" was updated.\n",
          updatedContact.getId(), updatedContact.getName(), updatedContact.getAddress());
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201308.ContactServiceInterface

*/
public class GetUninvitedContacts {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the ContactService.
    ContactServiceInterface contactService =
        dfpServices.get(session, ContactServiceInterface.class);

    // Create a statement to only select contacts that aren't invited yet.
    StatementBuilder statementBuilder = new StatementBuilder()
        .where("status = :status")
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("status", ContactStatus.UNINVITED.toString());

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

    do {
      // Get contacts by statement.
      ContactPage page = contactService.getContactsByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (Contact contact : page.getResults()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.