=begin #API V1 #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) OpenAPI spec version: v1 Generated by: https://openapi-generator.tech OpenAPI Generator version: 3.3.0-SNAPSHOT =end require 'uri' module FormAPI class PDFApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Generates multiple PDFs # @param template_id # @param create_submission_data # @param [Hash] opts the optional parameters # @return [Array] def batch_generate_pdf_v1(template_id, create_submission_data, opts = {}) data, _status_code, _headers = batch_generate_pdf_v1_with_http_info(template_id, create_submission_data, opts) data end # Generates multiple PDFs # @param template_id # @param create_submission_data # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def batch_generate_pdf_v1_with_http_info(template_id, create_submission_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 'create_submission_data' is set if @api_client.config.client_side_validation && create_submission_data.nil? fail ArgumentError, "Missing the required parameter 'create_submission_data' when calling PDFApi.batch_generate_pdf_v1" end # resource path local_var_path = '/templates/{template_id}/submissions/batch'.sub('{' + 'template_id' + '}', template_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(create_submission_data) auth_names = ['api_token_basic'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array') 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 submission_batch_data # @param [Hash] opts the optional parameters # @return [CreateSubmissionBatchResponse] def batch_generate_pdfs(submission_batch_data, opts = {}) data, _status_code, _headers = batch_generate_pdfs_with_http_info(submission_batch_data, opts) data end # Generates multiple PDFs # @param submission_batch_data # @param [Hash] opts the optional parameters # @return [Array<(CreateSubmissionBatchResponse, Fixnum, Hash)>] CreateSubmissionBatchResponse data, response status code and response headers def batch_generate_pdfs_with_http_info(submission_batch_data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.batch_generate_pdfs ...' end # verify the required parameter 'submission_batch_data' is set if @api_client.config.client_side_validation && submission_batch_data.nil? fail ArgumentError, "Missing the required parameter 'submission_batch_data' when calling PDFApi.batch_generate_pdfs" end # resource path local_var_path = '/submissions/batches' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(submission_batch_data) auth_names = ['api_token_basic'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CreateSubmissionBatchResponse') 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 generated PDFs together # @param combined_submission_data # @param [Hash] opts the optional parameters # @return [CreateCombinedSubmissionResponse] def combine_submissions(combined_submission_data, opts = {}) data, _status_code, _headers = combine_submissions_with_http_info(combined_submission_data, opts) data end # Merge generated PDFs together # @param combined_submission_data # @param [Hash] opts the optional parameters # @return [Array<(CreateCombinedSubmissionResponse, Fixnum, Hash)>] CreateCombinedSubmissionResponse data, response status code and response headers def combine_submissions_with_http_info(combined_submission_data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PDFApi.combine_submissions ...' end # verify the required parameter 'combined_submission_data' is set if @api_client.config.client_side_validation && combined_submission_data.nil? fail ArgumentError, "Missing the required parameter 'combined_submission_data' when calling PDFApi.combine_submissions" end # resource path local_var_path = '/combined_submissions' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(combined_submission_data) auth_names = ['api_token_basic'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CreateCombinedSubmissionResponse') 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 # Creates a new data request token for form authentication # @param data_request_id # @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 # @param [Hash] opts the optional parameters # @return [Array<(CreateSubmissionDataRequestTokenResponse, Fixnum, 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' + '}', data_request_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_token_basic'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CreateSubmissionDataRequestTokenResponse') 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 # Expire a combined submission # @param combined_submission_id # @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 # @param [Hash] opts the optional parameters # @return [Array<(CombinedSubmission, Fixnum, 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' + '}', combined_submission_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_token_basic'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CombinedSubmission') 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 # @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 # @param [Hash] opts the optional parameters # @return [Array<(Submission, Fixnum, 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' + '}', submission_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_token_basic'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Submission') 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 # @param create_submission_data # @param [Hash] opts the optional parameters # @return [CreateSubmissionResponse] def generate_pdf(template_id, create_submission_data, opts = {}) data, _status_code, _headers = generate_pdf_with_http_info(template_id, create_submission_data, opts) data end # Generates a new PDF # @param template_id # @param create_submission_data # @param [Hash] opts the optional parameters # @return [Array<(CreateSubmissionResponse, Fixnum, Hash)>] CreateSubmissionResponse data, response status code and response headers def generate_pdf_with_http_info(template_id, create_submission_data, 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 'create_submission_data' is set if @api_client.config.client_side_validation && create_submission_data.nil? fail ArgumentError, "Missing the required parameter 'create_submission_data' when calling PDFApi.generate_pdf" end # resource path local_var_path = '/templates/{template_id}/submissions'.sub('{' + 'template_id' + '}', template_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(create_submission_data) auth_names = ['api_token_basic'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CreateSubmissionResponse') 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 # Check the status of a combined submission (merged PDFs) # @param combined_submission_id # @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 # @param [Hash] opts the optional parameters # @return [Array<(CombinedSubmission, Fixnum, 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' + '}', combined_submission_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_token_basic'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CombinedSubmission') 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 # @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 # @param [Hash] opts the optional parameters # @return [Array<(SubmissionDataRequest, Fixnum, 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' + '}', data_request_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_token_basic'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SubmissionDataRequest') 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 # Check the status of a PDF # @param submission_id # @param [Hash] opts the optional parameters # @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 # @param [Hash] opts the optional parameters # @return [Array<(Submission, Fixnum, 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' + '}', submission_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_token_basic'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Submission') 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 # @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 # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :include_submissions # @return [Array<(SubmissionBatch, Fixnum, 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' + '}', submission_batch_id.to_s) # query parameters query_params = {} query_params[:'include_submissions'] = opts[:'include_submissions'] if !opts[:'include_submissions'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_token_basic'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SubmissionBatch') 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 # Get a list of all templates # @param [Hash] opts the optional parameters # @option opts [Integer] :page Default: 1 # @option opts [Integer] :per_page Default: 50 # @return [Array