public class TemplateDraft extends AbstractRequest
Modifier and Type | Field and Description |
---|---|
static String |
TEMPLATE_DRAFT_ID |
static String |
TEMPLATE_DRAFT_KEY |
static String |
TEMPLATE_EDIT_URL |
static String |
TEMPLATE_EXPIRES_AT |
REQUEST_HIDE_TEXT_TAGS, REQUEST_MESSAGE, REQUEST_METADATA, REQUEST_REDIRECT_URL, REQUEST_SUBJECT, REQUEST_TEST_MODE, REQUEST_TITLE, REQUEST_USE_PREEXISTING_FIELDS, REQUEST_USE_TEXT_TAGS
dataObj, warnings
Constructor and Description |
---|
TemplateDraft() |
TemplateDraft(org.json.JSONObject json) |
Modifier and Type | Method and Description |
---|---|
void |
addCCRole(String ccRole)
Adds a named role for a CC recipient that must be specified
when the template is used.
|
void |
addMergeField(String name,
FieldType type)
Add merge fields to the template draft.
|
void |
addSignerRole(String signerRole)
Adds the signer role to the template draft.
|
void |
addSignerRole(String role,
int order)
Adds the signer role with the given order to the list of signers for
this request.
|
void |
clearMergeFields()
Clears the current merge field map.
|
List<String> |
getCCRoles()
Returns the CC roles for this request.
|
String |
getEditUrl()
Returns the edit URL for creating an embedded template draft.
|
String |
getExpiresAt()
Returns the expiration time for the edit URL of this template.
|
String |
getId()
Returns the ID for this request.
|
Map<String,FieldType> |
getMergeFields()
Returns the current map of merge field names->types.
|
Map<String,Serializable> |
getPostFields()
Internal method used to retrieve the necessary POST fields.
|
List<String> |
getSignerRoles()
Returns the signer roles specified for this template draft.
|
boolean |
hasEditUrl()
Utility method to detect whether the "edit_url" parameter is set on this
template object.
|
boolean |
hasExpiresAt()
Utility method to detect whether the "expires_at" parameter is set on this
template object.
|
boolean |
hasId()
Returns true if this request has an ID.
|
boolean |
removeSignerRole(String signerRole)
Removes the signer role.
|
void |
setSignerRoles(List<String> signerRoles)
Overwrites the current list of signer roles.
|
addDocument, addDocument, addFile, addFile, addFileUrl, addMetadata, clearDocuments, getDocuments, getFileUrls, getMessage, getMetadata, getMetadata, getOrderMatters, getRedirectUrl, getSubject, getTitle, hasHideTextTags, hasMessage, hasRedirectUrl, hasSubject, hasTitle, hasUsePreexistingFields, hasUseTextTags, isHidingTextTags, isTestMode, isUsingPreexistingFields, isUsingTextTags, setDocuments, setFileUrls, setHideTextTags, setMessage, setOrderMatters, setRedirectUrl, setSubject, setTestMode, setTitle, setUsePreexistingFields, setUseTextTags
add, addToList, clearList, get, getBoolean, getConstructor, getDate, getInteger, getJSONObject, getList, getList, getLong, getString, getWarnings, has, hasString, set, toString
public static final String TEMPLATE_DRAFT_KEY
public static final String TEMPLATE_DRAFT_ID
public static final String TEMPLATE_EDIT_URL
public static final String TEMPLATE_EXPIRES_AT
public TemplateDraft()
public TemplateDraft(org.json.JSONObject json) throws HelloSignException
HelloSignException
public String getId()
getId
in class AbstractRequest
public boolean hasId()
public void addCCRole(String ccRole)
ccRole
- Stringpublic void addSignerRole(String signerRole)
signerRole
- StringHelloSignException
public List<String> getSignerRoles()
public void addSignerRole(String role, int order) throws HelloSignException
role
- Stringorder
- intHelloSignException
public void setSignerRoles(List<String> signerRoles)
signerRoles
- Listpublic boolean removeSignerRole(String signerRole) throws HelloSignException
signerRole
- StringHelloSignException
public void addMergeField(String name, FieldType type) throws HelloSignException
name
- String name of the merge field that will be displayed to
the user and used to key off the custom field when populating the value.type
- FieldType (currently only "text" and "checkbox" are allowed)HelloSignException
public Map<String,FieldType> getMergeFields()
public void clearMergeFields()
public boolean hasEditUrl()
public String getEditUrl()
public boolean hasExpiresAt()
public String getExpiresAt()
public Map<String,Serializable> getPostFields() throws HelloSignException
getPostFields
in class AbstractRequest
HelloSignException
Copyright © 2015 HelloSign. All rights reserved.