Package com.hellosign.sdk.resource
Class TemplateSignatureRequest
- java.lang.Object
-
- com.hellosign.sdk.resource.AbstractResource
-
- com.hellosign.sdk.resource.AbstractRequest
-
- com.hellosign.sdk.resource.TemplateSignatureRequest
-
public class TemplateSignatureRequest extends AbstractRequest
Represents a HelloSign signature request based on one or more Templates. Unlike the SignatureRequest, this object is only used to submit the request. A successfully submitted TemplateSignatureRequest will return a SignatureRequest object from the server.
-
-
Field Summary
-
Fields inherited from class com.hellosign.sdk.resource.AbstractRequest
REQUEST_ALLOW_DECLINE, REQUEST_ALLOW_REASSIGN, REQUEST_CLIENT_ID, REQUEST_CUSTOM_FIELDS, 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, REQUEST_UX_VERSION, UX_VERSION_1, UX_VERSION_2
-
Fields inherited from class com.hellosign.sdk.resource.AbstractResource
dataObj, warnings
-
-
Constructor Summary
Constructors Constructor Description TemplateSignatureRequest()TemplateSignatureRequest(Template template)Convenience constructor that accepts a single Template.TemplateSignatureRequest(java.util.List<Template> templates)Convenience constructor that accepts a list of Templates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTemplateId(java.lang.String id)Adds the template ID to be used in this request.voidaddTemplateId(java.lang.String id, java.lang.Integer index)Add the template ID to be used at the specified index.voidclearCCs()Clears the list of current CC email addresses.java.util.Map<java.lang.String,java.lang.String>getCCs()Returns a reference to the map of current roles to CC email addresses.java.lang.StringgetId()java.util.Map<java.lang.String,java.io.Serializable>getPostFields()Internal method used to retrieve the necessary POST fields to submit the signature request.java.util.Map<java.lang.String,Signer>getSigners()Returns a reference to the signers list.java.lang.StringgetTemplateId()Get the template ID that will be used with this request.java.util.List<java.lang.String>getTemplateIds()Get the list of template IDs that are used for this request.booleanhasHideTextTags()Not implemented for templates.booleanhasUseTextTags()Not implemented for templates.java.lang.BooleanisHidingTextTags()Not implemented for templates.java.lang.BooleanisUsingTextTags()Not implemented for templates.voidremoveSignerByEmail(java.lang.String email)Removes signer(s) from this request by email address.voidsetCC(java.lang.String role, java.lang.String email)Sets the CC email address for the provided role.voidsetCCs(java.util.Map<java.lang.String,java.lang.String> newCCs)Overwrites the map of roles to CC email addresses.voidsetHideTextTags(boolean hideTextTags)Not implemented for templates.voidsetSigner(java.lang.String role, java.lang.String email, java.lang.String name)Adds the signer to the list of signers for this request.voidsetSigners(java.util.Map<java.lang.String,Signer> signers)Overwrites the current list of signers for this request with the given list.voidsetTemplateId(java.lang.String id)Set the template ID of the template that should be used with this request.voidsetUseTextTags(boolean useTextTags)Not implemented for templates.-
Methods inherited from class com.hellosign.sdk.resource.AbstractRequest
addCustomField, addDocument, addDocument, addFile, addFile, addFileUrl, addMetadata, clearCustomFields, clearDocuments, getClientId, getCustomFields, getCustomFieldsList, getCustomFieldsMap, getDocuments, getFileUrls, getIsDeclinable, getMessage, getMetadata, getMetadata, getOrderMatters, getRedirectUrl, getSubject, getTitle, getUxVersion, hasAllowReassign, hasMessage, hasRedirectUrl, hasSubject, hasTitle, hasUsePreexistingFields, isAllowReassign, isTestMode, isUsingPreexistingFields, setAllowReassign, setClientId, setCustomFields, setCustomFieldValue, setDocuments, setFileUrls, setIsDeclinable, setMessage, setOrderMatters, setRedirectUrl, setSubject, setTestMode, setTitle, setUsePreexistingFields, setUxVersion
-
Methods inherited from class com.hellosign.sdk.resource.AbstractResource
add, addToList, clearList, get, getBoolean, getConstructor, getDate, getInteger, getJSONObject, getList, getList, getLong, getString, getWarnings, has, hasString, set, toString, toString
-
-
-
-
Constructor Detail
-
TemplateSignatureRequest
public TemplateSignatureRequest()
-
TemplateSignatureRequest
public TemplateSignatureRequest(Template template) throws HelloSignException
Convenience constructor that accepts a single Template.- Parameters:
template- Template- Throws:
HelloSignException- thrown if there is a problem adding the template ID.
-
TemplateSignatureRequest
public TemplateSignatureRequest(java.util.List<Template> templates) throws HelloSignException
Convenience constructor that accepts a list of Templates.- Parameters:
templates- List- Throws:
HelloSignException- thrown if there is a problem adding the template ID.
-
-
Method Detail
-
getCCs
public java.util.Map<java.lang.String,java.lang.String> getCCs()
Returns a reference to the map of current roles to CC email addresses.- Returns:
- Map
-
setCCs
public void setCCs(java.util.Map<java.lang.String,java.lang.String> newCCs)
Overwrites the map of roles to CC email addresses.- Parameters:
newCCs- Map
-
setCC
public void setCC(java.lang.String role, java.lang.String email)Sets the CC email address for the provided role.- Parameters:
role- Stringemail- String
-
clearCCs
public void clearCCs()
Clears the list of current CC email addresses.
-
setSigner
public void setSigner(java.lang.String role, java.lang.String email, java.lang.String name) throws HelloSignExceptionAdds the signer to the list of signers for this request.- Parameters:
role- Stringemail- Stringname- String- Throws:
HelloSignException- thrown if there is a problem setting the signer.
-
getSigners
public java.util.Map<java.lang.String,Signer> getSigners()
Returns a reference to the signers list. This can be modified and re-added to the request using setSigners(). Useful for more explicit modification.- Returns:
- List
-
setSigners
public void setSigners(java.util.Map<java.lang.String,Signer> signers)
Overwrites the current list of signers for this request with the given list.- Parameters:
signers- List
-
removeSignerByEmail
public void removeSignerByEmail(java.lang.String email)
Removes signer(s) from this request by email address. If more than one signer is listed by the given email, it will remove all instances of that signer. If no user is listed by the given email, nothing will happen.- Parameters:
email- String
-
getTemplateId
public java.lang.String getTemplateId()
Get the template ID that will be used with this request.- Returns:
- String
-
setTemplateId
public void setTemplateId(java.lang.String id) throws HelloSignExceptionSet the template ID of the template that should be used with this request.- Parameters:
id- String- Throws:
HelloSignException- thrown if the template ID cannot be added.
-
addTemplateId
public void addTemplateId(java.lang.String id) throws HelloSignExceptionAdds the template ID to be used in this request.- Parameters:
id- String- Throws:
HelloSignException- thrown if there is a problem parsing the backing JSON object.
-
addTemplateId
public void addTemplateId(java.lang.String id, java.lang.Integer index) throws HelloSignExceptionAdd the template ID to be used at the specified index.- Parameters:
id- Stringindex- Integer- Throws:
HelloSignException- thrown if therer is a problem adding the given template ID.
-
getTemplateIds
public java.util.List<java.lang.String> getTemplateIds()
Get the list of template IDs that are used for this request.- Returns:
- List
-
getPostFields
public java.util.Map<java.lang.String,java.io.Serializable> getPostFields() throws HelloSignExceptionInternal method used to retrieve the necessary POST fields to submit the signature request.- Overrides:
getPostFieldsin classAbstractRequest- Returns:
- Map
- Throws:
HelloSignException- thrown if there is a problem parsing the POST fields.
-
getId
public java.lang.String getId()
- Specified by:
getIdin classAbstractRequest
-
hasUseTextTags
public boolean hasUseTextTags()
Not implemented for templates.- Overrides:
hasUseTextTagsin classAbstractRequest
-
isUsingTextTags
public java.lang.Boolean isUsingTextTags()
Not implemented for templates.- Overrides:
isUsingTextTagsin classAbstractRequest
-
setUseTextTags
public void setUseTextTags(boolean useTextTags)
Not implemented for templates.- Overrides:
setUseTextTagsin classAbstractRequest
-
hasHideTextTags
public boolean hasHideTextTags()
Not implemented for templates.- Overrides:
hasHideTextTagsin classAbstractRequest
-
isHidingTextTags
public java.lang.Boolean isHidingTextTags()
Not implemented for templates.- Overrides:
isHidingTextTagsin classAbstractRequest
-
setHideTextTags
public void setHideTextTags(boolean hideTextTags)
Not implemented for templates.- Overrides:
setHideTextTagsin classAbstractRequest
-
-