Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Allow adding files to Unclaimed Draft with Template #76

Open
radhack opened this issue Apr 10, 2018 · 0 comments
Open

Allow adding files to Unclaimed Draft with Template #76

radhack opened this issue Apr 10, 2018 · 0 comments
Labels
enhancement legacy Related to legacy, non-OpenAPI SDK

Comments

@radhack
Copy link
Contributor

radhack commented Apr 10, 2018

Since we can now add files to Unclaimed Drafts with Template, we need to either remove the check for type SignatureRequest, or include TemplateSignatureRequest in these places:
https://github.com/HelloFax/hellosign-java-sdk/blob/master/src/main/java/com/hellosign/sdk/resource/UnclaimedDraft.java#L180

    /**
     * Adds a file to the unclaimed draft.
     * 
     * @param file File
     * @throws HelloSignException thrown if there is a problem adding the File.
     */
    public void addFile(File file) throws HelloSignException {
        if (!(request instanceof SignatureRequest)) {
            throw new HelloSignException("Cannot add files to this unclaimed draft");
        }
        ((SignatureRequest) request).addFile(file);
    }

https://github.com/HelloFax/hellosign-java-sdk/blob/master/src/main/java/com/hellosign/sdk/resource/UnclaimedDraft.java#L193

    /**
     * Adds a file to the unclaimed draft at the given document order.
     * 
     * @param file File
     * @param order int
     * @throws HelloSignException thrown if there is a problem adding the File.
     */
    public void addFile(File file, int order) throws HelloSignException {
        if (!(request instanceof SignatureRequest)) {
            throw new HelloSignException("Cannot add files to this unclaimed draft");
        }
        ((SignatureRequest) request).addFile(file, order);
    }

https://github.com/HelloFax/hellosign-java-sdk/blob/master/src/main/java/com/hellosign/sdk/resource/UnclaimedDraft.java#L207

    /**
     * Removes all files from this request.
     * 
     * @throws HelloSignException thrown if there is a problem clearing the
     *         Files
     */
    public void clearFiles() throws HelloSignException {
        if (!(request instanceof SignatureRequest)) {
            throw new HelloSignException("Cannot add files to this unclaimed draft");
        }
        ((SignatureRequest) request).clearDocuments();
    }
@jtreminio-dropbox jtreminio-dropbox added the legacy Related to legacy, non-OpenAPI SDK label Jun 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement legacy Related to legacy, non-OpenAPI SDK
Projects
None yet
Development

No branches or pull requests

3 participants