Package com.hellosign.sdk.resource
Class UnclaimedDraft
- java.lang.Object
-
- com.hellosign.sdk.resource.AbstractResource
-
- com.hellosign.sdk.resource.AbstractRequest
-
- com.hellosign.sdk.resource.UnclaimedDraft
-
public class UnclaimedDraft extends AbstractRequest
Represents an unclaimed draft response and request. The UnclaimedDraft object essentially "wraps" a SignatureRequest. There are two types of unclaimed drafts that can be created:- "send_document" - simply creates a claimable file. Use the
addFile(File)andaddFile(File, int)methods to add files to be claimed. - "request_signature" - creates a claimable signature request. If this type is chosen, the signers name(s) and email address(es) are not optional.
- "send_document" - simply creates a claimable file. Use the
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringUNCLAIMED_DRAFT_CLAIM_URLstatic java.lang.StringUNCLAIMED_DRAFT_EXPIRES_ATstatic java.lang.StringUNCLAIMED_DRAFT_IS_FOR_EMBEDDED_SIGNINGstatic java.lang.StringUNCLAIMED_DRAFT_KEYstatic java.lang.StringUNCLAIMED_DRAFT_REQUESTER_EMAILstatic java.lang.StringUNCLAIMED_DRAFT_SIGNATURE_REQUEST_IDstatic java.lang.StringUNCLAIMED_DRAFT_TEST_MODEstatic java.lang.StringUNCLAIMED_DRAFT_TYPE-
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 UnclaimedDraft()Default constructor.UnclaimedDraft(AbstractRequest request)Creates an unclaimed draft with the provided AbstractRequest, and defaults the type toUnclaimedDraftType.send_document.UnclaimedDraft(AbstractRequest request, UnclaimedDraftType type)Creates an unclaimed draft with the provided AbstractRequest and UnclaimedDraftType.UnclaimedDraft(org.json.JSONObject json)Constructor to provide a way to store the API response JSON information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCustomField(CustomField field)Add the custom field to this request.voidaddFile(java.io.File file)Adds a file to the unclaimed draft.voidaddFile(java.io.File file, int order)Adds a file to the unclaimed draft at the given document order.voidclearCustomFields()Clears the current custom fields for this request.voidclearFiles()Removes all files from this request.java.lang.StringgetClaimUrl()Gets the claim URL if the draft has been created.java.util.List<CustomField>getCustomFields()Gets the custom fields associated with this request, set when sending the request.java.util.Map<java.lang.String,java.lang.String>getCustomFieldsMap()Returns the map of custom fields for the request.java.util.DategetExpiresAt()java.lang.StringgetId()java.lang.StringgetMessage()java.util.Map<java.lang.String,java.io.Serializable>getPostFields()java.lang.StringgetRedirectUrl()AbstractRequestgetRequest()Gets the associated request object.java.lang.StringgetRequesterEmail()java.lang.StringgetSignatureRequestId()java.lang.StringgetSubject()java.lang.StringgetTitle()UnclaimedDraftTypegetType()Gets the unclaimed draft type.java.lang.StringgetTypeString()Gets the string value of the unclaimed draft type.booleanhasClaimUrl()Returns true if the draft has been created and a claim URL exists.booleanhasMessage()booleanhasRedirectUrl()booleanhasRequesterEmail()booleanhasSignatureRequestId()booleanhasSubject()booleanhasTitle()booleanisForEmbeddedSigning()Returns true if this Unclaimed Draft is to be embedded.booleanisTestMode()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.voidsetIsForEmbeddedSigning(boolean b)Sets whether this Unclaimed Draft is to be embedded.voidsetMessage(java.lang.String message)voidsetRedirectUrl(java.lang.String url)voidsetRequest(AbstractRequest request)Sets the associated request object from which this unclaimed draft will be created.voidsetRequesterEmail(java.lang.String email)voidsetSubject(java.lang.String subject)voidsetTestMode(boolean testMode)voidsetTitle(java.lang.String title)voidsetType(UnclaimedDraftType type)Sets the unclaimed draft type.-
Methods inherited from class com.hellosign.sdk.resource.AbstractRequest
addDocument, addDocument, addFile, addFileUrl, addMetadata, clearDocuments, getClientId, getCustomFieldsList, getDocuments, getFileUrls, getIsDeclinable, getMetadata, getMetadata, getOrderMatters, getUxVersion, hasAllowReassign, hasHideTextTags, hasUsePreexistingFields, hasUseTextTags, isAllowReassign, isHidingTextTags, isUsingPreexistingFields, isUsingTextTags, setAllowReassign, setClientId, setDocuments, setFileUrls, setHideTextTags, setIsDeclinable, setOrderMatters, setUsePreexistingFields, setUseTextTags, 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
-
-
-
-
Field Detail
-
UNCLAIMED_DRAFT_KEY
public static final java.lang.String UNCLAIMED_DRAFT_KEY
- See Also:
- Constant Field Values
-
UNCLAIMED_DRAFT_CLAIM_URL
public static final java.lang.String UNCLAIMED_DRAFT_CLAIM_URL
- See Also:
- Constant Field Values
-
UNCLAIMED_DRAFT_TYPE
public static final java.lang.String UNCLAIMED_DRAFT_TYPE
- See Also:
- Constant Field Values
-
UNCLAIMED_DRAFT_REQUESTER_EMAIL
public static final java.lang.String UNCLAIMED_DRAFT_REQUESTER_EMAIL
- See Also:
- Constant Field Values
-
UNCLAIMED_DRAFT_IS_FOR_EMBEDDED_SIGNING
public static final java.lang.String UNCLAIMED_DRAFT_IS_FOR_EMBEDDED_SIGNING
- See Also:
- Constant Field Values
-
UNCLAIMED_DRAFT_SIGNATURE_REQUEST_ID
public static final java.lang.String UNCLAIMED_DRAFT_SIGNATURE_REQUEST_ID
- See Also:
- Constant Field Values
-
UNCLAIMED_DRAFT_EXPIRES_AT
public static final java.lang.String UNCLAIMED_DRAFT_EXPIRES_AT
- See Also:
- Constant Field Values
-
UNCLAIMED_DRAFT_TEST_MODE
public static final java.lang.String UNCLAIMED_DRAFT_TEST_MODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UnclaimedDraft
public UnclaimedDraft()
Default constructor. This will instantiate the unclaimed draft with a SignatureRequest and the UnclaimedDraftType.send_document.
-
UnclaimedDraft
public UnclaimedDraft(AbstractRequest request)
Creates an unclaimed draft with the provided AbstractRequest, and defaults the type toUnclaimedDraftType.send_document.- Parameters:
request- AbstractRequest
-
UnclaimedDraft
public UnclaimedDraft(AbstractRequest request, UnclaimedDraftType type)
Creates an unclaimed draft with the provided AbstractRequest and UnclaimedDraftType.- Parameters:
request- AbstractRequesttype- UnclaimedDraftType
-
UnclaimedDraft
public UnclaimedDraft(org.json.JSONObject json) throws HelloSignExceptionConstructor to provide a way to store the API response JSON information.- Parameters:
json- JSONObject API response object- Throws:
HelloSignException- thrown if there is a problem parsing the JSONObject.
-
-
Method Detail
-
getTypeString
public java.lang.String getTypeString()
Gets the string value of the unclaimed draft type.- Returns:
- String
-
getType
public UnclaimedDraftType getType()
Gets the unclaimed draft type.- Returns:
- UnclaimedDraft.UNCLAIMED_DRAFT_TYPE
-
setType
public void setType(UnclaimedDraftType type)
Sets the unclaimed draft type. Use the public enum: UnclaimedDraft.UNCLAIMED_DRAFT_TYPE.- Parameters:
type- UnclaimedDraft.UNCLAIMED_DRAFT_TYPE
-
getRequest
public AbstractRequest getRequest()
Gets the associated request object. Currently this will always be a SignatureRequest.- Returns:
- AbstractRequest
-
setRequest
public void setRequest(AbstractRequest request)
Sets the associated request object from which this unclaimed draft will be created.- Parameters:
request- AbstractRequest
-
getClaimUrl
public java.lang.String getClaimUrl()
Gets the claim URL if the draft has been created.- Returns:
- String claim URL
-
hasClaimUrl
public boolean hasClaimUrl()
Returns true if the draft has been created and a claim URL exists.- Returns:
- true or false, if not set
-
addFile
public void addFile(java.io.File file) throws HelloSignExceptionAdds a file to the unclaimed draft.- Overrides:
addFilein classAbstractRequest- Parameters:
file- File- Throws:
HelloSignException- thrown if there is a problem adding the File.
-
addFile
public void addFile(java.io.File file, int order) throws HelloSignExceptionAdds a file to the unclaimed draft at the given document order.- Parameters:
file- Fileorder- int- Throws:
HelloSignException- thrown if there is a problem adding the File.
-
clearFiles
public void clearFiles() throws HelloSignExceptionRemoves all files from this request.- Throws:
HelloSignException- thrown if there is a problem clearing the Files
-
isForEmbeddedSigning
public boolean isForEmbeddedSigning()
Returns true if this Unclaimed Draft is to be embedded.- Returns:
- true if this Unclaimed Draft is to be embedded, false otherwise
-
setIsForEmbeddedSigning
public void setIsForEmbeddedSigning(boolean b)
Sets whether this Unclaimed Draft is to be embedded.- Parameters:
b- boolean
-
hasSignatureRequestId
public boolean hasSignatureRequestId()
-
getSignatureRequestId
public java.lang.String getSignatureRequestId()
-
getPostFields
public java.util.Map<java.lang.String,java.io.Serializable> getPostFields() throws HelloSignException- Overrides:
getPostFieldsin classAbstractRequest- Throws:
HelloSignException
-
getRequesterEmail
public java.lang.String getRequesterEmail()
-
setRequesterEmail
public void setRequesterEmail(java.lang.String email)
-
hasRequesterEmail
public boolean hasRequesterEmail()
-
getTitle
public java.lang.String getTitle()
- Overrides:
getTitlein classAbstractRequest
-
setTitle
public void setTitle(java.lang.String title)
- Overrides:
setTitlein classAbstractRequest
-
hasTitle
public boolean hasTitle()
- Overrides:
hasTitlein classAbstractRequest
-
getSubject
public java.lang.String getSubject()
- Overrides:
getSubjectin classAbstractRequest
-
setSubject
public void setSubject(java.lang.String subject)
- Overrides:
setSubjectin classAbstractRequest
-
hasSubject
public boolean hasSubject()
- Overrides:
hasSubjectin classAbstractRequest
-
getMessage
public java.lang.String getMessage()
- Overrides:
getMessagein classAbstractRequest
-
setMessage
public void setMessage(java.lang.String message)
- Overrides:
setMessagein classAbstractRequest
-
hasMessage
public boolean hasMessage()
- Overrides:
hasMessagein classAbstractRequest
-
isTestMode
public boolean isTestMode()
- Overrides:
isTestModein classAbstractRequest
-
setTestMode
public void setTestMode(boolean testMode)
- Overrides:
setTestModein classAbstractRequest
-
getRedirectUrl
public java.lang.String getRedirectUrl()
- Overrides:
getRedirectUrlin classAbstractRequest
-
setRedirectUrl
public void setRedirectUrl(java.lang.String url)
- Overrides:
setRedirectUrlin classAbstractRequest
-
hasRedirectUrl
public boolean hasRedirectUrl()
- Overrides:
hasRedirectUrlin classAbstractRequest
-
getId
public java.lang.String getId()
- Specified by:
getIdin classAbstractRequest
-
addCustomField
public void addCustomField(CustomField field)
Description copied from class:AbstractRequestAdd the custom field to this request. This is useful for specifying a pre-filled value and/or a field editor.- Overrides:
addCustomFieldin classAbstractRequest- Parameters:
field- CustomField
-
setCustomFieldValue
public void setCustomFieldValue(java.lang.String fieldNameOrApiId, java.lang.String value)Description copied from class:AbstractRequestAdds the value to fill in for a custom field with the given field name.- Overrides:
setCustomFieldValuein classAbstractRequest- 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
-
getCustomFields
public java.util.List<CustomField> getCustomFields()
Description copied from class:AbstractRequestGets the custom fields associated with this request, set when sending the request.- Overrides:
getCustomFieldsin classAbstractRequest- Returns:
- List CustomFields
-
setCustomFields
public void setCustomFields(java.util.Map<java.lang.String,java.lang.String> fields)
Description copied from class:AbstractRequestOverwrites the current map of custom fields to the provided map. This is a map of String field names to String field values.- Overrides:
setCustomFieldsin classAbstractRequest- Parameters:
fields- Map
-
getCustomFieldsMap
public java.util.Map<java.lang.String,java.lang.String> getCustomFieldsMap()
Description copied from class:AbstractRequestReturns the map of custom fields for the request. This is a map of String field names to String field values.- Overrides:
getCustomFieldsMapin classAbstractRequest- Returns:
- Map
-
clearCustomFields
public void clearCustomFields()
Description copied from class:AbstractRequestClears the current custom fields for this request.- Overrides:
clearCustomFieldsin classAbstractRequest
-
getExpiresAt
public java.util.Date getExpiresAt()
-
-