Created
December 20, 2013 02:12
-
-
Save wendelicious/8049480 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Contact createContact(){ | |
Model.Builder<Contact> contactBuilder = new Model.Builder<Contact>() | |
.setFieldValue(Contact.Field.FirstName, "first name") | |
.setCustomFieldValue("FavoriteDessert", "lemon cake") | |
.setFieldValue(Contact.Field.LastName, "last name"); | |
return contactBuilder.build(); | |
} | |
public void addContact(YailClient client, Contact contact) throws InfusionsoftXmlRpcException, InfusionsoftParameterValidationException { | |
ContactServiceAddOperation addContact = new ContactServiceAddOperation(contact); | |
client.call(addContact); | |
} | |
public void updateContact(YailClient client, Contact contact) throws InfusionsoftXmlRpcException, InfusionsoftParameterValidationException { | |
final Integer id = contact.getFieldValue(Contact.Field.Id); | |
DataServiceUpdateOperation updateContact = new DataServiceUpdateOperation(id, contact); | |
client.call(updateContact); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment