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.String
UNCLAIMED_DRAFT_CLAIM_URL
static java.lang.String
UNCLAIMED_DRAFT_EXPIRES_AT
static java.lang.String
UNCLAIMED_DRAFT_IS_FOR_EMBEDDED_SIGNING
static java.lang.String
UNCLAIMED_DRAFT_KEY
static java.lang.String
UNCLAIMED_DRAFT_REQUESTER_EMAIL
static java.lang.String
UNCLAIMED_DRAFT_SIGNATURE_REQUEST_ID
static java.lang.String
UNCLAIMED_DRAFT_TEST_MODE
static java.lang.String
UNCLAIMED_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 void
addCustomField(CustomField field)
Add the custom field to this request.void
addFile(java.io.File file)
Adds a file to the unclaimed draft.void
addFile(java.io.File file, int order)
Adds a file to the unclaimed draft at the given document order.void
clearCustomFields()
Clears the current custom fields for this request.void
clearFiles()
Removes all files from this request.java.lang.String
getClaimUrl()
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.Date
getExpiresAt()
java.lang.String
getId()
java.lang.String
getMessage()
java.util.Map<java.lang.String,java.io.Serializable>
getPostFields()
java.lang.String
getRedirectUrl()
AbstractRequest
getRequest()
Gets the associated request object.java.lang.String
getRequesterEmail()
java.lang.String
getSignatureRequestId()
java.lang.String
getSubject()
java.lang.String
getTitle()
UnclaimedDraftType
getType()
Gets the unclaimed draft type.java.lang.String
getTypeString()
Gets the string value of the unclaimed draft type.boolean
hasClaimUrl()
Returns true if the draft has been created and a claim URL exists.boolean
hasMessage()
boolean
hasRedirectUrl()
boolean
hasRequesterEmail()
boolean
hasSignatureRequestId()
boolean
hasSubject()
boolean
hasTitle()
boolean
isForEmbeddedSigning()
Returns true if this Unclaimed Draft is to be embedded.boolean
isTestMode()
void
setCustomFields(java.util.Map<java.lang.String,java.lang.String> fields)
Overwrites the current map of custom fields to the provided map.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.void
setIsForEmbeddedSigning(boolean b)
Sets whether this Unclaimed Draft is to be embedded.void
setMessage(java.lang.String message)
void
setRedirectUrl(java.lang.String url)
void
setRequest(AbstractRequest request)
Sets the associated request object from which this unclaimed draft will be created.void
setRequesterEmail(java.lang.String email)
void
setSubject(java.lang.String subject)
void
setTestMode(boolean testMode)
void
setTitle(java.lang.String title)
void
setType(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, getObject, 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 HelloSignException
Constructor 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 HelloSignException
Adds a file to the unclaimed draft.- Overrides:
addFile
in 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 HelloSignException
Adds 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 HelloSignException
Removes 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:
getPostFields
in 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:
getTitle
in classAbstractRequest
-
setTitle
public void setTitle(java.lang.String title)
- Overrides:
setTitle
in classAbstractRequest
-
hasTitle
public boolean hasTitle()
- Overrides:
hasTitle
in classAbstractRequest
-
getSubject
public java.lang.String getSubject()
- Overrides:
getSubject
in classAbstractRequest
-
setSubject
public void setSubject(java.lang.String subject)
- Overrides:
setSubject
in classAbstractRequest
-
hasSubject
public boolean hasSubject()
- Overrides:
hasSubject
in classAbstractRequest
-
getMessage
public java.lang.String getMessage()
- Overrides:
getMessage
in classAbstractRequest
-
setMessage
public void setMessage(java.lang.String message)
- Overrides:
setMessage
in classAbstractRequest
-
hasMessage
public boolean hasMessage()
- Overrides:
hasMessage
in classAbstractRequest
-
isTestMode
public boolean isTestMode()
- Overrides:
isTestMode
in classAbstractRequest
-
setTestMode
public void setTestMode(boolean testMode)
- Overrides:
setTestMode
in classAbstractRequest
-
getRedirectUrl
public java.lang.String getRedirectUrl()
- Overrides:
getRedirectUrl
in classAbstractRequest
-
setRedirectUrl
public void setRedirectUrl(java.lang.String url)
- Overrides:
setRedirectUrl
in classAbstractRequest
-
hasRedirectUrl
public boolean hasRedirectUrl()
- Overrides:
hasRedirectUrl
in classAbstractRequest
-
getId
public java.lang.String getId()
- Specified by:
getId
in classAbstractRequest
-
addCustomField
public void addCustomField(CustomField field)
Description copied from class:AbstractRequest
Add the custom field to this request. This is useful for specifying a pre-filled value and/or a field editor.- Overrides:
addCustomField
in classAbstractRequest
- Parameters:
field
- CustomField
-
setCustomFieldValue
public void setCustomFieldValue(java.lang.String fieldNameOrApiId, java.lang.String value)
Description copied from class:AbstractRequest
Adds the value to fill in for a custom field with the given field name.- Overrides:
setCustomFieldValue
in 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:AbstractRequest
Gets the custom fields associated with this request, set when sending the request.- Overrides:
getCustomFields
in classAbstractRequest
- Returns:
- List CustomFields
-
setCustomFields
public void setCustomFields(java.util.Map<java.lang.String,java.lang.String> fields)
Description copied from class:AbstractRequest
Overwrites the current map of custom fields to the provided map. This is a map of String field names to String field values.- Overrides:
setCustomFields
in classAbstractRequest
- Parameters:
fields
- Map
-
getCustomFieldsMap
public java.util.Map<java.lang.String,java.lang.String> getCustomFieldsMap()
Description copied from class:AbstractRequest
Returns the map of custom fields for the request. This is a map of String field names to String field values.- Overrides:
getCustomFieldsMap
in classAbstractRequest
- Returns:
- Map
-
clearCustomFields
public void clearCustomFields()
Description copied from class:AbstractRequest
Clears the current custom fields for this request.- Overrides:
clearCustomFields
in classAbstractRequest
-
getExpiresAt
public java.util.Date getExpiresAt()
-
-