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

Allow adding files to Unclaimed Draft with Template #76

Open

Description

@radhack

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();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementlegacyRelated to legacy, non-OpenAPI SDK

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions