def add_envelope_document(options={})
      options[:content_type] ||= 'application/pdf'
      options[:file_name] ||= File.basename(options[:file_path])
      options[:file_extension] ||= File.extname(options[:file_name])[1..-1]

      headers = {
        'Content-Type' => options[:content_type],
        'Content-Disposition' => "file; filename=\"#{options[:file_name]}\"; documentid=#{options[:document_id]}; fileExtension=\"#{options[:file_extension]}\""
      }

      uri = build_uri("/accounts/#{@acct_id}/envelopes/#{options[:envelope_id]}/documents/#{options[:document_id]}")
      post_body = if options[:file_io].present?
        options[:file_io].read
      else
        open(options[:file_path]).read
      end

      http = initialize_net_http_ssl(uri)
      request = Net::HTTP::Put.new(uri.request_uri, headers(headers))
      request.body = post_body
      response = http.request(request)
      generate_log(request, response, uri)
      response
    end
def add_envelope_document(options={})
      options[:content_type] ||= 'application/pdf'
      options[:file_name] ||= File.basename(options[:file_path])
      options[:file_extension] ||= File.extname(options[:file_name])[1..-1]

      headers = {
        'Content-Type' => options[:content_type],
        'Content-Disposition' => "file; filename=\"#{options[:file_name]}\"; documentid=#{options[:document_id]}; fileExtension=\"#{options[:file_extension]}\""
      }

      uri = build_uri("/accounts/#{@acct_id}/envelopes/#{options[:envelope_id]}/documents/#{options[:document_id]}")
      post_body = if options[:file_io].present?
        options[:file_io].read
      else
        open(options[:file_path]).read
      end

      http = initialize_net_http_ssl(uri)
      request = Net::HTTP::Put.new(uri.request_uri, headers(headers))
      request.body = post_body
      response = http.request(request)
      generate_log(request, response, uri)
      response
    end
Public adds a document to a given envelope
 See https://docs.docusign.com/esign/restapi/Envelopes/EnvelopeDocuments/update/

 envelope_id  - ID of the envelope from which the doc will be added
 document_id - ID of the document to add
 file_path - Local or remote path to file
 content_type - optional content type for file.  Defaults to application/pdf.
 file_name - optional name for file.  Defaults to basename of file_path.
 file_extension - optional extension for file.  Defaults to extname of file_name.
 file_io       - Optional: an opened I/O stream of data (if you don't
                 want to read from a file)

 The response only returns a success or failure.