Class TemplateSignatureRequest


  • public class TemplateSignatureRequest
    extends AbstractRequest
    Represents a HelloSign signature request based on one or more Templates. Unlike the SignatureRequest, this object is only used to submit the request. A successfully submitted TemplateSignatureRequest will return a SignatureRequest object from the server.
    • Constructor Detail

      • TemplateSignatureRequest

        public TemplateSignatureRequest()
      • TemplateSignatureRequest

        public TemplateSignatureRequest​(Template template)
                                 throws HelloSignException
        Convenience constructor that accepts a single Template.
        Parameters:
        template - Template
        Throws:
        HelloSignException - thrown if there is a problem adding the template ID.
      • TemplateSignatureRequest

        public TemplateSignatureRequest​(java.util.List<Template> templates)
                                 throws HelloSignException
        Convenience constructor that accepts a list of Templates.
        Parameters:
        templates - List
        Throws:
        HelloSignException - thrown if there is a problem adding the template ID.
    • Method Detail

      • getCCs

        public java.util.Map<java.lang.String,​java.lang.String> getCCs()
        Returns a reference to the map of current roles to CC email addresses.
        Returns:
        Map
      • setCCs

        public void setCCs​(java.util.Map<java.lang.String,​java.lang.String> newCCs)
        Overwrites the map of roles to CC email addresses.
        Parameters:
        newCCs - Map
      • setCC

        public void setCC​(java.lang.String role,
                          java.lang.String email)
        Sets the CC email address for the provided role.
        Parameters:
        role - String
        email - String
      • clearCCs

        public void clearCCs()
        Clears the list of current CC email addresses.
      • setSigner

        public void setSigner​(java.lang.String role,
                              java.lang.String email,
                              java.lang.String name)
                       throws HelloSignException
        Adds the signer to the list of signers for this request.
        Parameters:
        role - String
        email - String
        name - String
        Throws:
        HelloSignException - thrown if there is a problem setting the signer.
      • getSigners

        public java.util.Map<java.lang.String,​Signer> getSigners()
        Returns a reference to the signers list. This can be modified and re-added to the request using setSigners(). Useful for more explicit modification.
        Returns:
        List
      • setSigners

        public void setSigners​(java.util.Map<java.lang.String,​Signer> signers)
        Overwrites the current list of signers for this request with the given list.
        Parameters:
        signers - List
      • removeSignerByEmail

        public void removeSignerByEmail​(java.lang.String email)
        Removes signer(s) from this request by email address. If more than one signer is listed by the given email, it will remove all instances of that signer. If no user is listed by the given email, nothing will happen.
        Parameters:
        email - String
      • getTemplateId

        public java.lang.String getTemplateId()
        Get the template ID that will be used with this request.
        Returns:
        String
      • setTemplateId

        public void setTemplateId​(java.lang.String id)
                           throws HelloSignException
        Set the template ID of the template that should be used with this request.
        Parameters:
        id - String
        Throws:
        HelloSignException - thrown if the template ID cannot be added.
      • addTemplateId

        public void addTemplateId​(java.lang.String id)
                           throws HelloSignException
        Adds the template ID to be used in this request.
        Parameters:
        id - String
        Throws:
        HelloSignException - thrown if there is a problem parsing the backing JSON object.
      • addTemplateId

        public void addTemplateId​(java.lang.String id,
                                  java.lang.Integer index)
                           throws HelloSignException
        Add the template ID to be used at the specified index.
        Parameters:
        id - String
        index - Integer
        Throws:
        HelloSignException - thrown if therer is a problem adding the given template ID.
      • getTemplateIds

        public java.util.List<java.lang.String> getTemplateIds()
        Get the list of template IDs that are used for this request.
        Returns:
        List
      • getPostFields

        public java.util.Map<java.lang.String,​java.io.Serializable> getPostFields()
                                                                                 throws HelloSignException
        Internal method used to retrieve the necessary POST fields to submit the signature request.
        Overrides:
        getPostFields in class AbstractRequest
        Returns:
        Map
        Throws:
        HelloSignException - thrown if there is a problem parsing the POST fields.
      • setUseTextTags

        public void setUseTextTags​(boolean useTextTags)
        Not implemented for templates.
        Overrides:
        setUseTextTags in class AbstractRequest
      • setHideTextTags

        public void setHideTextTags​(boolean hideTextTags)
        Not implemented for templates.
        Overrides:
        setHideTextTags in class AbstractRequest