=begin #API v1 #DocSpring is a service that helps you fill out and sign PDF templates. The version of the OpenAPI document: v1 Generated by: https://openapi-generator.tech Generator version: 7.11.0 =end require 'cgi' module DocSpring class PDFApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Add new fields to a Template # @param template_id [String] # @param data [AddFieldsData] # @param [Hash] opts the optional parameters # @return [AddFieldsTemplateResponse] def add_fields_to_template(template_id, data, opts = {}) data, _status_code, _headers = add_fields_to_template_with_http_info(template_id, data, opts) data end # Add new fields to a Template # @param template_id [String] # @param data [AddFieldsData] # @param [Hash] opts the optional parameters # @return [Array<(AddFieldsTemplateResponse, Integer, Hash)>] AddFieldsTemplateResponse data, response status code and response headers def add_fields_to_template_with_http_info(template_id, data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.add_fields_to_template ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.add_fields_to_template" end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling PDFApi.add_fields_to_template" end # resource path local_var_path = '/templates/{template_id}/add_fields'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'AddFieldsTemplateResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.add_fields_to_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#add_fields_to_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Generates multiple PDFs # @param template_id [String] # @param data [Array] # @param [Hash] opts the optional parameters # @return [Array] def batch_generate_pdf_v1(template_id, data, opts = {}) data, _status_code, _headers = batch_generate_pdf_v1_with_http_info(template_id, data, opts) data end # Generates multiple PDFs # @param template_id [String] # @param data [Array] # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def batch_generate_pdf_v1_with_http_info(template_id, data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.batch_generate_pdf_v1 ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.batch_generate_pdf_v1" end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling PDFApi.batch_generate_pdf_v1" end # resource path local_var_path = '/templates/{template_id}/submissions/batch'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.batch_generate_pdf_v1", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#batch_generate_pdf_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Generates multiple PDFs # @param data [SubmissionBatchData] # @param [Hash] opts the optional parameters # @return [CreateSubmissionBatchResponse] def batch_generate_pdfs(data, opts = {}) data, _status_code, _headers = batch_generate_pdfs_with_http_info(data, opts) data end # Generates multiple PDFs # @param data [SubmissionBatchData] # @param [Hash] opts the optional parameters # @return [Array<(CreateSubmissionBatchResponse, Integer, Hash)>] CreateSubmissionBatchResponse data, response status code and response headers def batch_generate_pdfs_with_http_info(data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.batch_generate_pdfs ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling PDFApi.batch_generate_pdfs" end # resource path local_var_path = '/submissions/batches' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'CreateSubmissionBatchResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.batch_generate_pdfs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#batch_generate_pdfs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Merge submission PDFs, template PDFs, or custom files # @param data [CombinePdfsData] # @param [Hash] opts the optional parameters # @return [CreateCombinedSubmissionResponse] def combine_pdfs(data, opts = {}) data, _status_code, _headers = combine_pdfs_with_http_info(data, opts) data end # Merge submission PDFs, template PDFs, or custom files # @param data [CombinePdfsData] # @param [Hash] opts the optional parameters # @return [Array<(CreateCombinedSubmissionResponse, Integer, Hash)>] CreateCombinedSubmissionResponse data, response status code and response headers def combine_pdfs_with_http_info(data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.combine_pdfs ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling PDFApi.combine_pdfs" end # resource path local_var_path = '/combined_submissions?v=2' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'CreateCombinedSubmissionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.combine_pdfs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#combine_pdfs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Merge generated PDFs together # @param data [CombinedSubmissionData] # @param [Hash] opts the optional parameters # @return [CreateCombinedSubmissionResponse] def combine_submissions(data, opts = {}) data, _status_code, _headers = combine_submissions_with_http_info(data, opts) data end # Merge generated PDFs together # @param data [CombinedSubmissionData] # @param [Hash] opts the optional parameters # @return [Array<(CreateCombinedSubmissionResponse, Integer, Hash)>] CreateCombinedSubmissionResponse data, response status code and response headers def combine_submissions_with_http_info(data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.combine_submissions ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling PDFApi.combine_submissions" end # resource path local_var_path = '/combined_submissions' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'CreateCombinedSubmissionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.combine_submissions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#combine_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Copy a Template # @param template_id [String] # @param data [CopyTemplateData] # @param [Hash] opts the optional parameters # @return [Template] def copy_template(template_id, data, opts = {}) data, _status_code, _headers = copy_template_with_http_info(template_id, data, opts) data end # Copy a Template # @param template_id [String] # @param data [CopyTemplateData] # @param [Hash] opts the optional parameters # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers def copy_template_with_http_info(template_id, data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.copy_template ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.copy_template" end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling PDFApi.copy_template" end # resource path local_var_path = '/templates/{template_id}/copy'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'Template' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.copy_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#copy_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a new custom file from a cached presign upload # @param data [CreateCustomFileData] # @param [Hash] opts the optional parameters # @return [CreateCustomFileResponse] def create_custom_file_from_upload(data, opts = {}) data, _status_code, _headers = create_custom_file_from_upload_with_http_info(data, opts) data end # Create a new custom file from a cached presign upload # @param data [CreateCustomFileData] # @param [Hash] opts the optional parameters # @return [Array<(CreateCustomFileResponse, Integer, Hash)>] CreateCustomFileResponse data, response status code and response headers def create_custom_file_from_upload_with_http_info(data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.create_custom_file_from_upload ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling PDFApi.create_custom_file_from_upload" end # resource path local_var_path = '/custom_files' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'CreateCustomFileResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.create_custom_file_from_upload", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#create_custom_file_from_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Creates a new event for emailing a signee a request for signature # @param data_request_id [String] # @param event [CreateSubmissionDataRequestEventRequest] # @param [Hash] opts the optional parameters # @return [CreateSubmissionDataRequestEventResponse] def create_data_request_event(data_request_id, event, opts = {}) data, _status_code, _headers = create_data_request_event_with_http_info(data_request_id, event, opts) data end # Creates a new event for emailing a signee a request for signature # @param data_request_id [String] # @param event [CreateSubmissionDataRequestEventRequest] # @param [Hash] opts the optional parameters # @return [Array<(CreateSubmissionDataRequestEventResponse, Integer, Hash)>] CreateSubmissionDataRequestEventResponse data, response status code and response headers def create_data_request_event_with_http_info(data_request_id, event, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.create_data_request_event ...' end # verify the required parameter 'data_request_id' is set if @api_client.config.client_side_validation && data_request_id.nil? fail ArgumentError, "Missing the required parameter 'data_request_id' when calling PDFApi.create_data_request_event" end # verify the required parameter 'event' is set if @api_client.config.client_side_validation && event.nil? fail ArgumentError, "Missing the required parameter 'event' when calling PDFApi.create_data_request_event" end # resource path local_var_path = '/data_requests/{data_request_id}/events'.sub('{' + 'data_request_id' + '}', CGI.escape(data_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(event) # return_type return_type = opts[:debug_return_type] || 'CreateSubmissionDataRequestEventResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.create_data_request_event", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#create_data_request_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Creates a new data request token for form authentication # @param data_request_id [String] # @param [Hash] opts the optional parameters # @return [CreateSubmissionDataRequestTokenResponse] def create_data_request_token(data_request_id, opts = {}) data, _status_code, _headers = create_data_request_token_with_http_info(data_request_id, opts) data end # Creates a new data request token for form authentication # @param data_request_id [String] # @param [Hash] opts the optional parameters # @return [Array<(CreateSubmissionDataRequestTokenResponse, Integer, Hash)>] CreateSubmissionDataRequestTokenResponse data, response status code and response headers def create_data_request_token_with_http_info(data_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.create_data_request_token ...' end # verify the required parameter 'data_request_id' is set if @api_client.config.client_side_validation && data_request_id.nil? fail ArgumentError, "Missing the required parameter 'data_request_id' when calling PDFApi.create_data_request_token" end # resource path local_var_path = '/data_requests/{data_request_id}/tokens'.sub('{' + 'data_request_id' + '}', CGI.escape(data_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateSubmissionDataRequestTokenResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.create_data_request_token", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#create_data_request_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a folder # @param data [CreateFolderData] # @param [Hash] opts the optional parameters # @return [Folder] def create_folder(data, opts = {}) data, _status_code, _headers = create_folder_with_http_info(data, opts) data end # Create a folder # @param data [CreateFolderData] # @param [Hash] opts the optional parameters # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers def create_folder_with_http_info(data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.create_folder ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling PDFApi.create_folder" end # resource path local_var_path = '/folders/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'Folder' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.create_folder", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a new HTML template # @param data [CreateHtmlTemplateData] # @param [Hash] opts the optional parameters # @return [PendingTemplate] def create_html_template(data, opts = {}) data, _status_code, _headers = create_html_template_with_http_info(data, opts) data end # Create a new HTML template # @param data [CreateHtmlTemplateData] # @param [Hash] opts the optional parameters # @return [Array<(PendingTemplate, Integer, Hash)>] PendingTemplate data, response status code and response headers def create_html_template_with_http_info(data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.create_html_template ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling PDFApi.create_html_template" end # resource path local_var_path = '/templates?desc=html' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'PendingTemplate' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.create_html_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#create_html_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a new PDF template with a form POST file upload # @param template_document [File] # @param template_name [String] # @param [Hash] opts the optional parameters # @option opts [String] :template_parent_folder_id # @return [PendingTemplate] def create_pdf_template(template_document, template_name, opts = {}) data, _status_code, _headers = create_pdf_template_with_http_info(template_document, template_name, opts) data end # Create a new PDF template with a form POST file upload # @param template_document [File] # @param template_name [String] # @param [Hash] opts the optional parameters # @option opts [String] :template_parent_folder_id # @return [Array<(PendingTemplate, Integer, Hash)>] PendingTemplate data, response status code and response headers def create_pdf_template_with_http_info(template_document, template_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.create_pdf_template ...' end # verify the required parameter 'template_document' is set if @api_client.config.client_side_validation && template_document.nil? fail ArgumentError, "Missing the required parameter 'template_document' when calling PDFApi.create_pdf_template" end # verify the required parameter 'template_name' is set if @api_client.config.client_side_validation && template_name.nil? fail ArgumentError, "Missing the required parameter 'template_name' when calling PDFApi.create_pdf_template" end # resource path local_var_path = '/templates' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} form_params['template[document]'] = template_document form_params['template[name]'] = template_name form_params['template[parent_folder_id]'] = opts[:'template_parent_folder_id'] if !opts[:'template_parent_folder_id'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'PendingTemplate' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.create_pdf_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#create_pdf_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a new PDF template from a cached presign upload # @param data [CreateTemplateFromUploadData] # @param [Hash] opts the optional parameters # @return [PendingTemplate] def create_pdf_template_from_upload(data, opts = {}) data, _status_code, _headers = create_pdf_template_from_upload_with_http_info(data, opts) data end # Create a new PDF template from a cached presign upload # @param data [CreateTemplateFromUploadData] # @param [Hash] opts the optional parameters # @return [Array<(PendingTemplate, Integer, Hash)>] PendingTemplate data, response status code and response headers def create_pdf_template_from_upload_with_http_info(data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.create_pdf_template_from_upload ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling PDFApi.create_pdf_template_from_upload" end # resource path local_var_path = '/templates?desc=cached_upload' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'PendingTemplate' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.create_pdf_template_from_upload", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#create_pdf_template_from_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a folder # @param folder_id [String] # @param [Hash] opts the optional parameters # @return [Folder] def delete_folder(folder_id, opts = {}) data, _status_code, _headers = delete_folder_with_http_info(folder_id, opts) data end # Delete a folder # @param folder_id [String] # @param [Hash] opts the optional parameters # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers def delete_folder_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.delete_folder ...' end # verify the required parameter 'folder_id' is set if @api_client.config.client_side_validation && folder_id.nil? fail ArgumentError, "Missing the required parameter 'folder_id' when calling PDFApi.delete_folder" end # resource path local_var_path = '/folders/{folder_id}'.sub('{' + 'folder_id' + '}', CGI.escape(folder_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Folder' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.delete_folder", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a template # @param template_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :version # @return [DeleteTemplateResponse] def delete_template(template_id, opts = {}) data, _status_code, _headers = delete_template_with_http_info(template_id, opts) data end # Delete a template # @param template_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :version # @return [Array<(DeleteTemplateResponse, Integer, Hash)>] DeleteTemplateResponse data, response status code and response headers def delete_template_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.delete_template ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.delete_template" end # resource path local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteTemplateResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.delete_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#delete_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Expire a combined submission # @param combined_submission_id [String] # @param [Hash] opts the optional parameters # @return [CombinedSubmission] def expire_combined_submission(combined_submission_id, opts = {}) data, _status_code, _headers = expire_combined_submission_with_http_info(combined_submission_id, opts) data end # Expire a combined submission # @param combined_submission_id [String] # @param [Hash] opts the optional parameters # @return [Array<(CombinedSubmission, Integer, Hash)>] CombinedSubmission data, response status code and response headers def expire_combined_submission_with_http_info(combined_submission_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.expire_combined_submission ...' end # verify the required parameter 'combined_submission_id' is set if @api_client.config.client_side_validation && combined_submission_id.nil? fail ArgumentError, "Missing the required parameter 'combined_submission_id' when calling PDFApi.expire_combined_submission" end # resource path local_var_path = '/combined_submissions/{combined_submission_id}'.sub('{' + 'combined_submission_id' + '}', CGI.escape(combined_submission_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CombinedSubmission' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.expire_combined_submission", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#expire_combined_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Expire a PDF submission # @param submission_id [String] # @param [Hash] opts the optional parameters # @return [Submission] def expire_submission(submission_id, opts = {}) data, _status_code, _headers = expire_submission_with_http_info(submission_id, opts) data end # Expire a PDF submission # @param submission_id [String] # @param [Hash] opts the optional parameters # @return [Array<(Submission, Integer, Hash)>] Submission data, response status code and response headers def expire_submission_with_http_info(submission_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.expire_submission ...' end # verify the required parameter 'submission_id' is set if @api_client.config.client_side_validation && submission_id.nil? fail ArgumentError, "Missing the required parameter 'submission_id' when calling PDFApi.expire_submission" end # resource path local_var_path = '/submissions/{submission_id}'.sub('{' + 'submission_id' + '}', CGI.escape(submission_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Submission' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.expire_submission", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#expire_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Generates a new PDF # @param template_id [String] # @param submission [CreateSubmissionData] # @param [Hash] opts the optional parameters # @return [CreateSubmissionResponse] def generate_pdf(template_id, submission, opts = {}) data, _status_code, _headers = generate_pdf_with_http_info(template_id, submission, opts) data end # Generates a new PDF # @param template_id [String] # @param submission [CreateSubmissionData] # @param [Hash] opts the optional parameters # @return [Array<(CreateSubmissionResponse, Integer, Hash)>] CreateSubmissionResponse data, response status code and response headers def generate_pdf_with_http_info(template_id, submission, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.generate_pdf ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.generate_pdf" end # verify the required parameter 'submission' is set if @api_client.config.client_side_validation && submission.nil? fail ArgumentError, "Missing the required parameter 'submission' when calling PDFApi.generate_pdf" end # resource path local_var_path = '/templates/{template_id}/submissions'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(submission) # return_type return_type = opts[:debug_return_type] || 'CreateSubmissionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.generate_pdf", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#generate_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Generated a preview PDF for partially completed data requests # @param submission_id [String] # @param [Hash] opts the optional parameters # @return [PreviewPdfResponse] def generate_preview(submission_id, opts = {}) data, _status_code, _headers = generate_preview_with_http_info(submission_id, opts) data end # Generated a preview PDF for partially completed data requests # @param submission_id [String] # @param [Hash] opts the optional parameters # @return [Array<(PreviewPdfResponse, Integer, Hash)>] PreviewPdfResponse data, response status code and response headers def generate_preview_with_http_info(submission_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.generate_preview ...' end # verify the required parameter 'submission_id' is set if @api_client.config.client_side_validation && submission_id.nil? fail ArgumentError, "Missing the required parameter 'submission_id' when calling PDFApi.generate_preview" end # resource path local_var_path = '/submissions/{submission_id}/generate_preview'.sub('{' + 'submission_id' + '}', CGI.escape(submission_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'PreviewPdfResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.generate_preview", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#generate_preview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Check the status of a combined submission (merged PDFs) # @param combined_submission_id [String] # @param [Hash] opts the optional parameters # @return [CombinedSubmission] def get_combined_submission(combined_submission_id, opts = {}) data, _status_code, _headers = get_combined_submission_with_http_info(combined_submission_id, opts) data end # Check the status of a combined submission (merged PDFs) # @param combined_submission_id [String] # @param [Hash] opts the optional parameters # @return [Array<(CombinedSubmission, Integer, Hash)>] CombinedSubmission data, response status code and response headers def get_combined_submission_with_http_info(combined_submission_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.get_combined_submission ...' end # verify the required parameter 'combined_submission_id' is set if @api_client.config.client_side_validation && combined_submission_id.nil? fail ArgumentError, "Missing the required parameter 'combined_submission_id' when calling PDFApi.get_combined_submission" end # resource path local_var_path = '/combined_submissions/{combined_submission_id}'.sub('{' + 'combined_submission_id' + '}', CGI.escape(combined_submission_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CombinedSubmission' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.get_combined_submission", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#get_combined_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Look up a submission data request # @param data_request_id [String] # @param [Hash] opts the optional parameters # @return [SubmissionDataRequest] def get_data_request(data_request_id, opts = {}) data, _status_code, _headers = get_data_request_with_http_info(data_request_id, opts) data end # Look up a submission data request # @param data_request_id [String] # @param [Hash] opts the optional parameters # @return [Array<(SubmissionDataRequest, Integer, Hash)>] SubmissionDataRequest data, response status code and response headers def get_data_request_with_http_info(data_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.get_data_request ...' end # verify the required parameter 'data_request_id' is set if @api_client.config.client_side_validation && data_request_id.nil? fail ArgumentError, "Missing the required parameter 'data_request_id' when calling PDFApi.get_data_request" end # resource path local_var_path = '/data_requests/{data_request_id}'.sub('{' + 'data_request_id' + '}', CGI.escape(data_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubmissionDataRequest' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.get_data_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#get_data_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch the full template attributes # @param template_id [String] # @param [Hash] opts the optional parameters # @return [FullTemplate] def get_full_template(template_id, opts = {}) data, _status_code, _headers = get_full_template_with_http_info(template_id, opts) data end # Fetch the full template attributes # @param template_id [String] # @param [Hash] opts the optional parameters # @return [Array<(FullTemplate, Integer, Hash)>] FullTemplate data, response status code and response headers def get_full_template_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.get_full_template ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.get_full_template" end # resource path local_var_path = '/templates/{template_id}?full=true'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'FullTemplate' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.get_full_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#get_full_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a presigned URL so that you can upload a file to our AWS S3 bucket # @param [Hash] opts the optional parameters # @return [UploadPresign] def get_presign_url(opts = {}) data, _status_code, _headers = get_presign_url_with_http_info(opts) data end # Get a presigned URL so that you can upload a file to our AWS S3 bucket # @param [Hash] opts the optional parameters # @return [Array<(UploadPresign, Integer, Hash)>] UploadPresign data, response status code and response headers def get_presign_url_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.get_presign_url ...' end # resource path local_var_path = '/uploads/presign' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'UploadPresign' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.get_presign_url", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#get_presign_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Check the status of a PDF # @param submission_id [String] # @param [Hash] opts the optional parameters # @option opts [Boolean] :include_data # @return [Submission] def get_submission(submission_id, opts = {}) data, _status_code, _headers = get_submission_with_http_info(submission_id, opts) data end # Check the status of a PDF # @param submission_id [String] # @param [Hash] opts the optional parameters # @option opts [Boolean] :include_data # @return [Array<(Submission, Integer, Hash)>] Submission data, response status code and response headers def get_submission_with_http_info(submission_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.get_submission ...' end # verify the required parameter 'submission_id' is set if @api_client.config.client_side_validation && submission_id.nil? fail ArgumentError, "Missing the required parameter 'submission_id' when calling PDFApi.get_submission" end # resource path local_var_path = '/submissions/{submission_id}'.sub('{' + 'submission_id' + '}', CGI.escape(submission_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'include_data'] = opts[:'include_data'] if !opts[:'include_data'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Submission' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.get_submission", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#get_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Check the status of a submission batch job # @param submission_batch_id [String] # @param [Hash] opts the optional parameters # @option opts [Boolean] :include_submissions # @return [SubmissionBatch] def get_submission_batch(submission_batch_id, opts = {}) data, _status_code, _headers = get_submission_batch_with_http_info(submission_batch_id, opts) data end # Check the status of a submission batch job # @param submission_batch_id [String] # @param [Hash] opts the optional parameters # @option opts [Boolean] :include_submissions # @return [Array<(SubmissionBatch, Integer, Hash)>] SubmissionBatch data, response status code and response headers def get_submission_batch_with_http_info(submission_batch_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.get_submission_batch ...' end # verify the required parameter 'submission_batch_id' is set if @api_client.config.client_side_validation && submission_batch_id.nil? fail ArgumentError, "Missing the required parameter 'submission_batch_id' when calling PDFApi.get_submission_batch" end # resource path local_var_path = '/submissions/batches/{submission_batch_id}'.sub('{' + 'submission_batch_id' + '}', CGI.escape(submission_batch_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'include_submissions'] = opts[:'include_submissions'] if !opts[:'include_submissions'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubmissionBatch' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.get_submission_batch", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#get_submission_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Check the status of an uploaded template # @param template_id [String] # @param [Hash] opts the optional parameters # @return [Template] def get_template(template_id, opts = {}) data, _status_code, _headers = get_template_with_http_info(template_id, opts) data end # Check the status of an uploaded template # @param template_id [String] # @param [Hash] opts the optional parameters # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers def get_template_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.get_template ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.get_template" end # resource path local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Template' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.get_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#get_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch the JSON schema for a template # @param template_id [String] # @param [Hash] opts the optional parameters # @return [TemplateSchema] def get_template_schema(template_id, opts = {}) data, _status_code, _headers = get_template_schema_with_http_info(template_id, opts) data end # Fetch the JSON schema for a template # @param template_id [String] # @param [Hash] opts the optional parameters # @return [Array<(TemplateSchema, Integer, Hash)>] TemplateSchema data, response status code and response headers def get_template_schema_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.get_template_schema ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.get_template_schema" end # resource path local_var_path = '/templates/{template_id}/schema'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TemplateSchema' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.get_template_schema", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#get_template_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of all combined submissions # @param [Hash] opts the optional parameters # @option opts [Integer] :page Default: 1 # @option opts [Integer] :per_page Default: 50 # @return [Array] def list_combined_submissions(opts = {}) data, _status_code, _headers = list_combined_submissions_with_http_info(opts) data end # Get a list of all combined submissions # @param [Hash] opts the optional parameters # @option opts [Integer] :page Default: 1 # @option opts [Integer] :per_page Default: 50 # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def list_combined_submissions_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.list_combined_submissions ...' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling PDFApi.list_combined_submissions, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 50 fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling PDFApi.list_combined_submissions, must be smaller than or equal to 50.' end if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1 fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling PDFApi.list_combined_submissions, must be greater than or equal to 1.' end # resource path local_var_path = '/combined_submissions' # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.list_combined_submissions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#list_combined_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of all folders # @param [Hash] opts the optional parameters # @option opts [String] :parent_folder_id Filter By Folder Id # @return [Array] def list_folders(opts = {}) data, _status_code, _headers = list_folders_with_http_info(opts) data end # Get a list of all folders # @param [Hash] opts the optional parameters # @option opts [String] :parent_folder_id Filter By Folder Id # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def list_folders_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.list_folders ...' end # resource path local_var_path = '/folders/' # query parameters query_params = opts[:query_params] || {} query_params[:'parent_folder_id'] = opts[:'parent_folder_id'] if !opts[:'parent_folder_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.list_folders", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#list_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List all submissions # @param [Hash] opts the optional parameters # @option opts [String] :cursor # @option opts [Float] :limit # @option opts [String] :created_after # @option opts [String] :created_before # @option opts [String] :type # @option opts [Boolean] :include_data # @return [ListSubmissionsResponse] def list_submissions(opts = {}) data, _status_code, _headers = list_submissions_with_http_info(opts) data end # List all submissions # @param [Hash] opts the optional parameters # @option opts [String] :cursor # @option opts [Float] :limit # @option opts [String] :created_after # @option opts [String] :created_before # @option opts [String] :type # @option opts [Boolean] :include_data # @return [Array<(ListSubmissionsResponse, Integer, Hash)>] ListSubmissionsResponse data, response status code and response headers def list_submissions_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.list_submissions ...' end # resource path local_var_path = '/submissions' # query parameters query_params = opts[:query_params] || {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'include_data'] = opts[:'include_data'] if !opts[:'include_data'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListSubmissionsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.list_submissions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#list_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List all submissions for a given template # @param template_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :cursor # @option opts [Float] :limit # @option opts [String] :created_after # @option opts [String] :created_before # @option opts [String] :type # @option opts [Boolean] :include_data # @return [ListSubmissionsResponse] def list_template_submissions(template_id, opts = {}) data, _status_code, _headers = list_template_submissions_with_http_info(template_id, opts) data end # List all submissions for a given template # @param template_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :cursor # @option opts [Float] :limit # @option opts [String] :created_after # @option opts [String] :created_before # @option opts [String] :type # @option opts [Boolean] :include_data # @return [Array<(ListSubmissionsResponse, Integer, Hash)>] ListSubmissionsResponse data, response status code and response headers def list_template_submissions_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.list_template_submissions ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.list_template_submissions" end # resource path local_var_path = '/templates/{template_id}/submissions'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'include_data'] = opts[:'include_data'] if !opts[:'include_data'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListSubmissionsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_token_basic'] new_options = opts.merge( :operation => :"PDFApi.list_template_submissions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PDFApi#list_template_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of all templates # @param [Hash] opts the optional parameters # @option opts [String] :query Search By Name # @option opts [String] :parent_folder_id Filter By Folder Id # @option opts [Integer] :page Default: 1 # @option opts [Integer] :per_page Default: 50 # @return [Array