com.createsend
Class People

java.lang.Object
  extended by com.createsend.CreateSendBase
      extended by com.createsend.People

public class People
extends CreateSendBase


Field Summary
 
Fields inherited from class com.createsend.CreateSendBase
jerseyClient, urlEncodingScheme
 
Constructor Summary
People(AuthenticationDetails auth, java.lang.String clientID)
          Constructor.
 
Method Summary
 java.lang.String add(PersonToAdd person)
          Adds a person to the client.
 void delete(java.lang.String emailAddress)
          Deletes the person with the specified email address from the client
 Person details(java.lang.String emailAddress)
          Gets the details for the person with the given email address
 java.lang.String getClientID()
           
 void setClientID(java.lang.String clientID)
           
 void update(java.lang.String originalEmailAddress, Person newDetails)
          Updates the details for an existing person
 
Methods inherited from class com.createsend.CreateSendBase
refreshToken
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

People

public People(AuthenticationDetails auth,
              java.lang.String clientID)
Constructor.

Parameters:
auth - The authentication details to use when making API calls. May be either an OAuthAuthenticationDetails or ApiKeyAuthenticationDetails instance.
clientID - The Client ID to use when making API calls.
Method Detail

getClientID

public java.lang.String getClientID()

setClientID

public void setClientID(java.lang.String clientID)

add

public java.lang.String add(PersonToAdd person)
                     throws CreateSendException
Adds a person to the client. If a password is not supplied, an email invitation will be sent to the person. Otherwise the person will be added with the specified password and immediately activated

Parameters:
person - The person to add to the client
Returns:
The email address of the newly added person
Throws:
CreateSendException - Thrown when the API responds with HTTP Status >= 400
See Also:
Adding a person

details

public Person details(java.lang.String emailAddress)
               throws CreateSendException
Gets the details for the person with the given email address

Parameters:
emailAddress - The email address to get the person details for
Returns:
The details of the person
Throws:
CreateSendException - Thrown when the API responds with HTTP Status >= 400
See Also:
Getting person details

delete

public void delete(java.lang.String emailAddress)
            throws CreateSendException
Deletes the person with the specified email address from the client

Parameters:
emailAddress - The email address of the person to delete
Throws:
CreateSendException - Thrown when the API responds with HTTP Status >= 400
See Also:
Deleting a person

update

public void update(java.lang.String originalEmailAddress,
                   Person newDetails)
            throws CreateSendException
Updates the details for an existing person

Parameters:
originalEmailAddress - The current email address of the existing person
newDetails - The new details for the person.
Throws:
CreateSendException - Thrown when the API responds with HTTP Status >= 400
See Also:
Updating a person