Package com.hellosign.sdk.resource
Class AbstractRequest
- java.lang.Object
-
- com.hellosign.sdk.resource.AbstractResource
-
- com.hellosign.sdk.resource.AbstractRequest
-
- Direct Known Subclasses:
EmbeddedRequest,SignatureRequest,TemplateDraft,TemplateSignatureRequest,UnclaimedDraft
public abstract class AbstractRequest extends AbstractResource
Requests to HelloSign will have common fields such as a request title, subject, and message. This class centralizes those fields.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringREQUEST_ALLOW_DECLINEstatic java.lang.StringREQUEST_ALLOW_REASSIGNstatic java.lang.StringREQUEST_CLIENT_IDstatic java.lang.StringREQUEST_CUSTOM_FIELDSstatic java.lang.StringREQUEST_HIDE_TEXT_TAGSstatic java.lang.StringREQUEST_MESSAGEstatic java.lang.StringREQUEST_METADATAstatic java.lang.StringREQUEST_REDIRECT_URLstatic java.lang.StringREQUEST_SUBJECTstatic java.lang.StringREQUEST_TEST_MODEstatic java.lang.StringREQUEST_TITLEstatic java.lang.StringREQUEST_USE_PREEXISTING_FIELDSstatic java.lang.StringREQUEST_USE_TEXT_TAGSstatic java.lang.StringREQUEST_UX_VERSIONstatic intUX_VERSION_1static intUX_VERSION_2-
Fields inherited from class com.hellosign.sdk.resource.AbstractResource
dataObj, warnings
-
-
Constructor Summary
Constructors Constructor Description AbstractRequest()AbstractRequest(org.json.JSONObject json, java.lang.String optionalKey)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCustomField(CustomField field)Add the custom field to this request.voidaddDocument(Document doc)Adds a Document to the signature request.voidaddDocument(Document doc, int order)Adds a Document to the signature request at the specific order.voidaddFile(java.io.File file)Adds the file to the request.voidaddFile(java.io.File file, java.lang.Integer order)Adds the file to the request in the given order.voidaddFileUrl(java.lang.String url)Add a file_url to this request.voidaddMetadata(java.lang.String key, java.lang.String value)voidclearCustomFields()Clears the current custom fields for this request.voidclearDocuments()Remove all documents from this request.java.lang.StringgetClientId()The API app client ID that has been associated with this signature request.java.util.List<CustomField>getCustomFields()Gets the custom fields associated with this request, set when sending the request.java.util.List<CustomField>getCustomFieldsList()Deprecated.UsegetCustomFields()instead.java.util.Map<java.lang.String,java.lang.String>getCustomFieldsMap()Returns the map of custom fields for the request.java.util.List<Document>getDocuments()Returns a reference to the list of documents for this request.java.util.List<java.lang.String>getFileUrls()Return the current file_url list.abstract java.lang.StringgetId()java.lang.BooleangetIsDeclinable()Retrieve the flag that designates whether this request is declinable by signers.java.lang.StringgetMessage()MetadatagetMetadata()java.lang.StringgetMetadata(java.lang.String key)booleangetOrderMatters()A flag that determines whether order of the signers list is enforced.java.util.Map<java.lang.String,java.io.Serializable>getPostFields()java.lang.StringgetRedirectUrl()java.lang.StringgetSubject()java.lang.StringgetTitle()intgetUxVersion()Return the UX version for this request.booleanhasAllowReassign()booleanhasHideTextTags()booleanhasMessage()booleanhasRedirectUrl()booleanhasSubject()booleanhasTitle()booleanhasUsePreexistingFields()booleanhasUseTextTags()booleanisAllowReassign()java.lang.BooleanisHidingTextTags()booleanisTestMode()java.lang.BooleanisUsingPreexistingFields()java.lang.BooleanisUsingTextTags()voidsetAllowReassign(boolean b)voidsetClientId(java.lang.String clientId)Associates this request with an API app.voidsetCustomFields(java.util.Map<java.lang.String,java.lang.String> fields)Overwrites the current map of custom fields to the provided map.voidsetCustomFieldValue(java.lang.String fieldNameOrApiId, java.lang.String value)Adds the value to fill in for a custom field with the given field name.voidsetDocuments(java.util.List<Document> docs)Overwrites this requests document list with the provided document list.voidsetFileUrls(java.util.List<java.lang.String> fileUrls)Overwrite the current file_url list.voidsetHideTextTags(boolean hideTextTags)voidsetIsDeclinable(java.lang.Boolean isDeclinable)Designate this request as declinable by signers.voidsetMessage(java.lang.String message)voidsetOrderMatters(boolean b)Determines whether the order of the signers list is to be enforced.voidsetRedirectUrl(java.lang.String url)voidsetSubject(java.lang.String subject)voidsetTestMode(boolean testMode)voidsetTitle(java.lang.String title)voidsetUsePreexistingFields(boolean usePreexistingFields)voidsetUseTextTags(boolean useTextTags)voidsetUxVersion(int uxVersion)Set the UX version for this request.-
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
-
-
-
-
Field Detail
-
REQUEST_TITLE
public static final java.lang.String REQUEST_TITLE
- See Also:
- Constant Field Values
-
REQUEST_SUBJECT
public static final java.lang.String REQUEST_SUBJECT
- See Also:
- Constant Field Values
-
REQUEST_MESSAGE
public static final java.lang.String REQUEST_MESSAGE
- See Also:
- Constant Field Values
-
REQUEST_REDIRECT_URL
public static final java.lang.String REQUEST_REDIRECT_URL
- See Also:
- Constant Field Values
-
REQUEST_TEST_MODE
public static final java.lang.String REQUEST_TEST_MODE
- See Also:
- Constant Field Values
-
REQUEST_USE_TEXT_TAGS
public static final java.lang.String REQUEST_USE_TEXT_TAGS
- See Also:
- Constant Field Values
-
REQUEST_USE_PREEXISTING_FIELDS
public static final java.lang.String REQUEST_USE_PREEXISTING_FIELDS
- See Also:
- Constant Field Values
-
REQUEST_HIDE_TEXT_TAGS
public static final java.lang.String REQUEST_HIDE_TEXT_TAGS
- See Also:
- Constant Field Values
-
REQUEST_METADATA
public static final java.lang.String REQUEST_METADATA
- See Also:
- Constant Field Values
-
REQUEST_UX_VERSION
public static final java.lang.String REQUEST_UX_VERSION
- See Also:
- Constant Field Values
-
REQUEST_CLIENT_ID
public static final java.lang.String REQUEST_CLIENT_ID
- See Also:
- Constant Field Values
-
REQUEST_ALLOW_DECLINE
public static final java.lang.String REQUEST_ALLOW_DECLINE
- See Also:
- Constant Field Values
-
REQUEST_ALLOW_REASSIGN
public static final java.lang.String REQUEST_ALLOW_REASSIGN
- See Also:
- Constant Field Values
-
REQUEST_CUSTOM_FIELDS
public static final java.lang.String REQUEST_CUSTOM_FIELDS
- See Also:
- Constant Field Values
-
UX_VERSION_1
public static final int UX_VERSION_1
- See Also:
- Constant Field Values
-
UX_VERSION_2
public static final int UX_VERSION_2
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractRequest
public AbstractRequest()
-
AbstractRequest
public AbstractRequest(org.json.JSONObject json, java.lang.String optionalKey) throws HelloSignException- Throws:
HelloSignException
-
-
Method Detail
-
getPostFields
public java.util.Map<java.lang.String,java.io.Serializable> getPostFields() throws HelloSignException- Throws:
HelloSignException
-
getId
public abstract java.lang.String getId()
-
getTitle
public java.lang.String getTitle()
-
setTitle
public void setTitle(java.lang.String title)
-
hasTitle
public boolean hasTitle()
-
getSubject
public java.lang.String getSubject()
-
setSubject
public void setSubject(java.lang.String subject)
-
hasSubject
public boolean hasSubject()
-
getMessage
public java.lang.String getMessage()
-
setMessage
public void setMessage(java.lang.String message)
-
hasMessage
public boolean hasMessage()
-
isTestMode
public boolean isTestMode()
-
setTestMode
public void setTestMode(boolean testMode)
-
getRedirectUrl
public java.lang.String getRedirectUrl()
-
setRedirectUrl
public void setRedirectUrl(java.lang.String url)
-
hasRedirectUrl
public boolean hasRedirectUrl()
-
hasUseTextTags
public boolean hasUseTextTags()
-
isUsingTextTags
public java.lang.Boolean isUsingTextTags()
-
setUseTextTags
public void setUseTextTags(boolean useTextTags)
-
hasHideTextTags
public boolean hasHideTextTags()
-
isHidingTextTags
public java.lang.Boolean isHidingTextTags()
-
setHideTextTags
public void setHideTextTags(boolean hideTextTags)
-
hasUsePreexistingFields
public boolean hasUsePreexistingFields()
-
isUsingPreexistingFields
public java.lang.Boolean isUsingPreexistingFields()
-
setUsePreexistingFields
public void setUsePreexistingFields(boolean usePreexistingFields)
-
getMetadata
public Metadata getMetadata()
-
addMetadata
public void addMetadata(java.lang.String key, java.lang.String value)
-
getMetadata
public java.lang.String getMetadata(java.lang.String key)
-
addFile
public void addFile(java.io.File file) throws HelloSignExceptionAdds the file to the request.- Parameters:
file- File- Throws:
HelloSignException- thrown if there is a problem attaching the File to this request.
-
addFile
public void addFile(java.io.File file, java.lang.Integer order) throws HelloSignExceptionAdds the file to the request in the given order. The order should be a 0-based index into the file list. Therefore, the first item of the file list is 0, and so forth. If order is null, the document is appended to the end of the file list.- Parameters:
file- Fileorder- Integer or null- Throws:
HelloSignException- thrown if there is a problem attaching the File to this request.
-
addDocument
public void addDocument(Document doc) throws HelloSignException
Adds a Document to the signature request.- Parameters:
doc- Document- Throws:
HelloSignException- thrown if null is provided
-
addDocument
public void addDocument(Document doc, int order) throws HelloSignException
Adds a Document to the signature request at the specific order.- Parameters:
doc- Documentorder- int- Throws:
HelloSignException- thrown if null is provided or there is a problem attaching the Document.
-
getDocuments
public java.util.List<Document> getDocuments()
Returns a reference to the list of documents for this request. Modifying this list will modify the list that will be sent with the request. Useful for more fine-grained modification.- Returns:
- List
-
setDocuments
public void setDocuments(java.util.List<Document> docs)
Overwrites this requests document list with the provided document list.- Parameters:
docs- List
-
clearDocuments
public void clearDocuments()
Remove all documents from this request.
-
getOrderMatters
public boolean getOrderMatters()
A flag that determines whether order of the signers list is enforced.- Returns:
- true if the order matters, false otherwise
-
setOrderMatters
public void setOrderMatters(boolean b)
Determines whether the order of the signers list is to be enforced.- Parameters:
b- true if the order matters, false otherwise
-
addFileUrl
public void addFileUrl(java.lang.String url)
Add a file_url to this request.- Parameters:
url- String
-
getFileUrls
public java.util.List<java.lang.String> getFileUrls()
Return the current file_url list.- Returns:
- List
-
setFileUrls
public void setFileUrls(java.util.List<java.lang.String> fileUrls)
Overwrite the current file_url list.- Parameters:
fileUrls- List
-
getUxVersion
public int getUxVersion()
Return the UX version for this request.- Returns:
- int UX version (UX_VERSION_1 or UX_VERSION_2)
-
setUxVersion
public void setUxVersion(int uxVersion)
Set the UX version for this request. This determines the version of the signer page displayed to signer(s). The default is UX_VERSION_1 (non-responsive). Use UX_VERSION_2 for the responsive signer page.- Parameters:
uxVersion- int
-
getClientId
public java.lang.String getClientId()
The API app client ID that has been associated with this signature request.- Returns:
- String client ID
-
setClientId
public void setClientId(java.lang.String clientId) throws HelloSignExceptionAssociates this request with an API app.- Parameters:
clientId- String client ID of the API app.- Throws:
HelloSignException- thrown if clientId is null
-
getIsDeclinable
public java.lang.Boolean getIsDeclinable()
Retrieve the flag that designates whether this request is declinable by signers.- Returns:
- Boolean or null if the flag has not been set
-
setIsDeclinable
public void setIsDeclinable(java.lang.Boolean isDeclinable)
Designate this request as declinable by signers.- Parameters:
isDeclinable- true if declinable, false otherwise (null if the parameter should be left off)
-
hasAllowReassign
public boolean hasAllowReassign()
-
isAllowReassign
public boolean isAllowReassign()
-
setAllowReassign
public void setAllowReassign(boolean b)
-
addCustomField
public void addCustomField(CustomField field)
Add the custom field to this request. This is useful for specifying a pre-filled value and/or a field editor.- Parameters:
field- CustomField
-
setCustomFieldValue
public void setCustomFieldValue(java.lang.String fieldNameOrApiId, java.lang.String value)Adds the value to fill in for a custom field with the given field name.- Parameters:
fieldNameOrApiId- String name (or "Field Label") of the custom field to be filled in. The "api_id" can also be used instead of the name.value- String value
-
getCustomFieldsMap
public java.util.Map<java.lang.String,java.lang.String> getCustomFieldsMap()
Returns the map of custom fields for the request. This is a map of String field names to String field values.- Returns:
- Map
-
getCustomFields
public java.util.List<CustomField> getCustomFields()
Gets the custom fields associated with this request, set when sending the request.- Returns:
- List CustomFields
-
setCustomFields
public void setCustomFields(java.util.Map<java.lang.String,java.lang.String> fields)
Overwrites the current map of custom fields to the provided map. This is a map of String field names to String field values.- Parameters:
fields- Map
-
getCustomFieldsList
@Deprecated public java.util.List<CustomField> getCustomFieldsList()
Deprecated.UsegetCustomFields()instead.Returns a list of CustomField objects for this request.- Returns:
- List of CustomFields
-
clearCustomFields
public void clearCustomFields()
Clears the current custom fields for this request.
-
-