docspring 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +39 -0
  3. data/.openapi-generator-ignore +23 -0
  4. data/.openapi-generator/VERSION +1 -0
  5. data/.rspec +2 -0
  6. data/.rubocop.yml +154 -0
  7. data/.swagger-codegen-ignore +31 -0
  8. data/.swagger-codegen/VERSION +1 -0
  9. data/.swagger-revision +1 -0
  10. data/.travis.yml +8 -0
  11. data/CHANGELOG.md +48 -0
  12. data/Gemfile +8 -0
  13. data/Gemfile.lock +80 -0
  14. data/LICENSE +7 -0
  15. data/README.md +162 -0
  16. data/Rakefile +10 -0
  17. data/docs/AuthenticationError.md +9 -0
  18. data/docs/AuthenticationSuccessResponse.md +8 -0
  19. data/docs/CombinePdfsData.md +12 -0
  20. data/docs/CombinedSubmission.md +16 -0
  21. data/docs/CombinedSubmissionAction.md +13 -0
  22. data/docs/CombinedSubmissionData.md +11 -0
  23. data/docs/CreateCombinedSubmissionResponse.md +10 -0
  24. data/docs/CreateCustomFileData.md +8 -0
  25. data/docs/CreateCustomFileResponse.md +10 -0
  26. data/docs/CreateFolderData.md +8 -0
  27. data/docs/CreateSubmissionBatchResponse.md +12 -0
  28. data/docs/CreateSubmissionBatchSubmissionsResponse.md +10 -0
  29. data/docs/CreateSubmissionDataRequestData.md +20 -0
  30. data/docs/CreateSubmissionDataRequestTokenResponse.md +10 -0
  31. data/docs/CreateSubmissionDataRequestTokenResponseToken.md +11 -0
  32. data/docs/CreateSubmissionResponse.md +10 -0
  33. data/docs/CreateTemplateData.md +8 -0
  34. data/docs/CustomFile.md +9 -0
  35. data/docs/Error.md +9 -0
  36. data/docs/Folder.md +11 -0
  37. data/docs/FoldersFolder.md +9 -0
  38. data/docs/InvalidRequest.md +9 -0
  39. data/docs/MoveFolderData.md +8 -0
  40. data/docs/MoveTemplateData.md +8 -0
  41. data/docs/PDFApi.md +1385 -0
  42. data/docs/PendingTemplate.md +22 -0
  43. data/docs/RenameFolderData.md +8 -0
  44. data/docs/Submission.md +21 -0
  45. data/docs/SubmissionAction.md +13 -0
  46. data/docs/SubmissionBatch.md +16 -0
  47. data/docs/SubmissionBatchData.md +11 -0
  48. data/docs/SubmissionData.md +13 -0
  49. data/docs/SubmissionDataBatchRequest.md +13 -0
  50. data/docs/SubmissionDataRequest.md +24 -0
  51. data/docs/Template.md +25 -0
  52. data/docs/Templatesv2Template.md +19 -0
  53. data/docs/Templatesv2TemplateDocument.md +10 -0
  54. data/docs/Templatesv2TemplateDocumentMetadata.md +10 -0
  55. data/docs/UpdateDataRequestResponse.md +10 -0
  56. data/docs/UpdateSubmissionDataRequestData.md +20 -0
  57. data/docspring.gemspec +47 -0
  58. data/git_push.sh +55 -0
  59. data/lib/docspring.rb +82 -0
  60. data/lib/docspring/api/client.rb +174 -0
  61. data/lib/docspring/api/pdf_api.rb +1481 -0
  62. data/lib/docspring/api_client.rb +406 -0
  63. data/lib/docspring/api_error.rb +38 -0
  64. data/lib/docspring/configuration.rb +230 -0
  65. data/lib/docspring/models/authentication_error.rb +231 -0
  66. data/lib/docspring/models/authentication_success_response.rb +217 -0
  67. data/lib/docspring/models/combine_pdfs_data.rb +226 -0
  68. data/lib/docspring/models/combined_submission.rb +295 -0
  69. data/lib/docspring/models/combined_submission_action.rb +316 -0
  70. data/lib/docspring/models/combined_submission_data.rb +217 -0
  71. data/lib/docspring/models/create_combined_submission_response.rb +237 -0
  72. data/lib/docspring/models/create_custom_file_data.rb +207 -0
  73. data/lib/docspring/models/create_custom_file_response.rb +237 -0
  74. data/lib/docspring/models/create_folder_data.rb +188 -0
  75. data/lib/docspring/models/create_submission_batch_response.rb +257 -0
  76. data/lib/docspring/models/create_submission_batch_submissions_response.rb +237 -0
  77. data/lib/docspring/models/create_submission_data_request_data.rb +339 -0
  78. data/lib/docspring/models/create_submission_data_request_token_response.rb +237 -0
  79. data/lib/docspring/models/create_submission_data_request_token_response_token.rb +210 -0
  80. data/lib/docspring/models/create_submission_response.rb +237 -0
  81. data/lib/docspring/models/create_template_data.rb +188 -0
  82. data/lib/docspring/models/custom_file.rb +192 -0
  83. data/lib/docspring/models/error.rb +236 -0
  84. data/lib/docspring/models/folder.rb +210 -0
  85. data/lib/docspring/models/folders_folder.rb +192 -0
  86. data/lib/docspring/models/invalid_request.rb +238 -0
  87. data/lib/docspring/models/move_folder_data.rb +183 -0
  88. data/lib/docspring/models/move_template_data.rb +183 -0
  89. data/lib/docspring/models/pending_template.rb +343 -0
  90. data/lib/docspring/models/rename_folder_data.rb +188 -0
  91. data/lib/docspring/models/submission.rb +358 -0
  92. data/lib/docspring/models/submission_action.rb +316 -0
  93. data/lib/docspring/models/submission_batch.rb +291 -0
  94. data/lib/docspring/models/submission_batch_data.rb +217 -0
  95. data/lib/docspring/models/submission_data.rb +235 -0
  96. data/lib/docspring/models/submission_data_batch_request.rb +228 -0
  97. data/lib/docspring/models/submission_data_request.rb +422 -0
  98. data/lib/docspring/models/template.rb +372 -0
  99. data/lib/docspring/models/templatesv2_template.rb +316 -0
  100. data/lib/docspring/models/templatesv2_template_document.rb +235 -0
  101. data/lib/docspring/models/templatesv2_template_document_metadata.rb +235 -0
  102. data/lib/docspring/models/update_data_request_response.rb +237 -0
  103. data/lib/docspring/models/update_submission_data_request_data.rb +339 -0
  104. data/lib/docspring/version.rb +15 -0
  105. data/spec/api/client_integration_spec.rb +259 -0
  106. data/spec/api/pdf_api_integration_spec.rb +377 -0
  107. data/spec/api/pdf_api_spec_original.skipped.rb +397 -0
  108. data/spec/api_client_spec.rb +226 -0
  109. data/spec/configuration_spec.rb +53 -0
  110. data/spec/models/authentication_error_spec.rb +51 -0
  111. data/spec/models/authentication_success_response_spec.rb +45 -0
  112. data/spec/models/combine_pdfs_data_spec.rb +65 -0
  113. data/spec/models/combined_submission_action_spec.rb +83 -0
  114. data/spec/models/combined_submission_data_spec.rb +59 -0
  115. data/spec/models/combined_submission_spec.rb +93 -0
  116. data/spec/models/create_combined_submission_response_spec.rb +57 -0
  117. data/spec/models/create_custom_file_data_spec.rb +41 -0
  118. data/spec/models/create_custom_file_response_spec.rb +57 -0
  119. data/spec/models/create_folder_data_spec.rb +41 -0
  120. data/spec/models/create_submission_batch_response_spec.rb +69 -0
  121. data/spec/models/create_submission_batch_submissions_response_spec.rb +57 -0
  122. data/spec/models/create_submission_data_request_data_spec.rb +121 -0
  123. data/spec/models/create_submission_data_request_token_response_spec.rb +57 -0
  124. data/spec/models/create_submission_data_request_token_response_token_spec.rb +59 -0
  125. data/spec/models/create_submission_response_spec.rb +57 -0
  126. data/spec/models/create_template_data_spec.rb +41 -0
  127. data/spec/models/custom_file_spec.rb +47 -0
  128. data/spec/models/error_spec.rb +51 -0
  129. data/spec/models/folder_spec.rb +59 -0
  130. data/spec/models/folders_folder_spec.rb +47 -0
  131. data/spec/models/invalid_request_spec.rb +51 -0
  132. data/spec/models/move_folder_data_spec.rb +41 -0
  133. data/spec/models/move_template_data_spec.rb +41 -0
  134. data/spec/models/pending_template_spec.rb +129 -0
  135. data/spec/models/rename_folder_data_spec.rb +41 -0
  136. data/spec/models/submission_action_spec.rb +83 -0
  137. data/spec/models/submission_batch_data_spec.rb +59 -0
  138. data/spec/models/submission_batch_spec.rb +93 -0
  139. data/spec/models/submission_data_batch_request_spec.rb +71 -0
  140. data/spec/models/submission_data_request_spec.rb +149 -0
  141. data/spec/models/submission_data_spec.rb +71 -0
  142. data/spec/models/submission_spec.rb +123 -0
  143. data/spec/models/template_spec.rb +147 -0
  144. data/spec/models/templatesv2_template_document_metadata_spec.rb +57 -0
  145. data/spec/models/templatesv2_template_document_spec.rb +57 -0
  146. data/spec/models/templatesv2_template_spec.rb +111 -0
  147. data/spec/models/update_data_request_response_spec.rb +57 -0
  148. data/spec/models/update_submission_data_request_data_spec.rb +121 -0
  149. data/spec/spec_helper.rb +117 -0
  150. metadata +430 -0
@@ -0,0 +1,174 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'docspring/api/pdf_api'
4
+
5
+ module DocSpring
6
+ class Client < PDFApi
7
+ class InvalidDataError < ApiError; end
8
+ class PollTimeoutError < ApiError; end
9
+ class InvalidResponseError < ApiError; end
10
+ class FailedBatchError < ApiError; end
11
+
12
+ def generate_pdf(options)
13
+ unless options[:data].is_a?(::Hash)
14
+ raise InvalidDataError, 'data is required, and must be a Hash.'
15
+ end
16
+
17
+ # Wait for job to finish by default.
18
+ wait = options.key?(:wait) ? options[:wait] : true
19
+ options.delete :wait
20
+
21
+ template_id = options.delete :template_id
22
+ create_submission_data = options
23
+ response = super(template_id, create_submission_data)
24
+
25
+ return response unless wait
26
+
27
+ submission = response.submission
28
+ timeout = options[:timeout] || 60
29
+ start_time = Time.now.to_i
30
+
31
+ # Wait for submission to be ready
32
+ while submission.state == 'pending'
33
+ sleep 1
34
+ submission = get_submission(submission.id)
35
+ if Time.now.to_i - start_time > timeout
36
+ raise PollTimeoutError, "PDF was not processed after #{timeout} seconds!"
37
+ end
38
+ end
39
+
40
+ CreateSubmissionResponse.new(
41
+ status: submission.state == 'processed' ? 'success' : 'error',
42
+ submission: submission
43
+ )
44
+ end
45
+
46
+ def batch_generate_pdfs(options)
47
+ unless options[:submissions].is_a?(::Array)
48
+ raise InvalidDataError, ':submissions is required, and must be an Array.'
49
+ end
50
+
51
+ options[:submissions].each do |submission|
52
+ unless submission[:data].is_a?(::Hash)
53
+ raise InvalidDataError,
54
+ ':data is required for each submission, and must be a Hash.'
55
+ end
56
+ end
57
+
58
+ # Wait for job to finish by default.
59
+ wait = options.key?(:wait) ? options[:wait] : true
60
+ options.delete :wait
61
+
62
+ submission_batch_data = options
63
+ response = super(submission_batch_data)
64
+
65
+ return response unless wait
66
+
67
+ batch = response.submission_batch
68
+ submission_responses = response.submissions
69
+ timeout = options[:timeout] || 600
70
+ start_time = Time.now.to_i
71
+
72
+ # Wait for submission to be ready
73
+ while batch.state == 'pending'
74
+ sleep 1
75
+ batch = get_submission_batch(batch.id)
76
+ if Time.now.to_i - start_time > timeout
77
+ raise PollTimeoutError, "PDFs were not processed after #{timeout} seconds!"
78
+ end
79
+ end
80
+
81
+ # While polling the batch status, we exclude any info about the submissions.
82
+ # We need to make one more request to fetch the updated submissions and
83
+ # prepare the correct responses for CreateSubmissionBatchResponse
84
+ batch_with_submissions = get_submission_batch(batch.id, include_submissions: true)
85
+ if batch_with_submissions.submissions&.any?
86
+ updated_submissions_hash =
87
+ batch_with_submissions.submissions.each_with_object({}) do |sub, h|
88
+ next h unless sub&.id
89
+
90
+ h[sub.id] = sub
91
+ end
92
+ submission_responses.each do |sub|
93
+ # If there's no submission it's already an error.
94
+ next unless sub.submission
95
+
96
+ updated_sub = updated_submissions_hash[sub.submission.id]
97
+ if updated_sub
98
+ sub.submission = updated_sub
99
+ sub.status = updated_sub.state == 'processed' ? 'success' : 'error'
100
+ else
101
+ sub.status = 'error'
102
+ end
103
+ end
104
+ end
105
+
106
+ CreateSubmissionBatchResponse.new(
107
+ status: batch.state == 'processed' ? 'success' : 'error',
108
+ submission_batch: batch,
109
+ submissions: submission_responses
110
+ )
111
+ end
112
+
113
+ def combine_pdfs(options)
114
+ unless options[:source_pdfs].is_a?(::Array)
115
+ raise InvalidDataError, 'source_pdfs is required, and must be an Array.'
116
+ end
117
+
118
+ # Wait for job to finish by default.
119
+ wait = options.key?(:wait) ? options[:wait] : true
120
+ options.delete :wait
121
+
122
+ # PdfAPI requires a :combined_submission_data option.
123
+ response = super(options)
124
+
125
+ return response unless wait
126
+
127
+ combined_submission = response.combined_submission
128
+ timeout = options[:timeout] || 600
129
+ start_time = Time.now.to_i
130
+
131
+ # Wait for submission to be ready
132
+ while combined_submission.state == 'pending'
133
+ sleep 1
134
+ combined_submission = get_combined_submission(combined_submission.id)
135
+
136
+ if Time.now.to_i - start_time > timeout
137
+ raise PollTimeoutError, "Merged PDF was not ready after #{timeout} seconds!"
138
+ end
139
+ end
140
+
141
+ CreateCombinedSubmissionResponse.new(
142
+ status: combined_submission.state == 'processed' ? 'success' : 'error',
143
+ combined_submission: combined_submission
144
+ )
145
+ end
146
+
147
+ # Alias for combine_pdfs, for backwards compatibility
148
+ def combine_submissions(options)
149
+ unless options[:submission_ids].is_a?(::Array)
150
+ raise InvalidDataError, 'submission_ids is required, and must be an Array.'
151
+ end
152
+
153
+ options[:source_pdfs] = options[:submission_ids].map do |id|
154
+ { type: 'submission', id: id }
155
+ end
156
+ options.delete :submission_ids
157
+
158
+ combine_pdfs(options)
159
+ end
160
+
161
+ def batch_generate_and_combine_pdfs(options)
162
+ # We pass the wait option to the combine_submissions method
163
+ wait = options.key?(:wait) ? options.delete(:wait) : true
164
+
165
+ response = batch_generate_pdfs(options)
166
+ if response.status == 'error'
167
+ raise FailedBatchError, 'Batch job failed, cannot combine PDFs!'
168
+ end
169
+
170
+ submission_ids = response.submissions.map { |s| s.submission.id }
171
+ combine_submissions(submission_ids: submission_ids, wait: wait)
172
+ end
173
+ end
174
+ end
@@ -0,0 +1,1481 @@
1
+ =begin
2
+ #API v1
3
+
4
+ #DocSpring is a service that helps you fill out and sign PDF templates.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 3.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module DocSpring
16
+ class PDFApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Generates multiple PDFs
23
+ # @param template_id
24
+ # @param request_body
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [Array<CreateSubmissionResponse>]
27
+ def batch_generate_pdf_v1(template_id, request_body, opts = {})
28
+ data, _status_code, _headers = batch_generate_pdf_v1_with_http_info(template_id, request_body, opts)
29
+ data
30
+ end
31
+
32
+ # Generates multiple PDFs
33
+ # @param template_id
34
+ # @param request_body
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(Array<CreateSubmissionResponse>, Fixnum, Hash)>] Array<CreateSubmissionResponse> data, response status code and response headers
37
+ def batch_generate_pdf_v1_with_http_info(template_id, request_body, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: PDFApi.batch_generate_pdf_v1 ...'
40
+ end
41
+ # verify the required parameter 'template_id' is set
42
+ if @api_client.config.client_side_validation && template_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.batch_generate_pdf_v1"
44
+ end
45
+ # verify the required parameter 'request_body' is set
46
+ if @api_client.config.client_side_validation && request_body.nil?
47
+ fail ArgumentError, "Missing the required parameter 'request_body' when calling PDFApi.batch_generate_pdf_v1"
48
+ end
49
+ # resource path
50
+ local_var_path = '/templates/{template_id}/submissions/batch'.sub('{' + 'template_id' + '}', template_id.to_s)
51
+
52
+ # query parameters
53
+ query_params = {}
54
+
55
+ # header parameters
56
+ header_params = {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+ # HTTP header 'Content-Type'
60
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
61
+
62
+ # form parameters
63
+ form_params = {}
64
+
65
+ # http body (model)
66
+ post_body = @api_client.object_to_http_body(request_body)
67
+ auth_names = ['api_token_basic']
68
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => 'Array<CreateSubmissionResponse>')
75
+ if @api_client.config.debugging
76
+ @api_client.config.logger.debug "API called: PDFApi#batch_generate_pdf_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
77
+ end
78
+ return data, status_code, headers
79
+ end
80
+
81
+ # Generates multiple PDFs
82
+ # @param submission_batch_data
83
+ # @param [Hash] opts the optional parameters
84
+ # @return [CreateSubmissionBatchResponse]
85
+ def batch_generate_pdfs(submission_batch_data, opts = {})
86
+ data, _status_code, _headers = batch_generate_pdfs_with_http_info(submission_batch_data, opts)
87
+ data
88
+ end
89
+
90
+ # Generates multiple PDFs
91
+ # @param submission_batch_data
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [Array<(CreateSubmissionBatchResponse, Fixnum, Hash)>] CreateSubmissionBatchResponse data, response status code and response headers
94
+ def batch_generate_pdfs_with_http_info(submission_batch_data, opts = {})
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug 'Calling API: PDFApi.batch_generate_pdfs ...'
97
+ end
98
+ # verify the required parameter 'submission_batch_data' is set
99
+ if @api_client.config.client_side_validation && submission_batch_data.nil?
100
+ fail ArgumentError, "Missing the required parameter 'submission_batch_data' when calling PDFApi.batch_generate_pdfs"
101
+ end
102
+ # resource path
103
+ local_var_path = '/submissions/batches'
104
+
105
+ # query parameters
106
+ query_params = {}
107
+
108
+ # header parameters
109
+ header_params = {}
110
+ # HTTP header 'Accept' (if needed)
111
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
112
+ # HTTP header 'Content-Type'
113
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
114
+
115
+ # form parameters
116
+ form_params = {}
117
+
118
+ # http body (model)
119
+ post_body = @api_client.object_to_http_body(submission_batch_data)
120
+ auth_names = ['api_token_basic']
121
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
122
+ :header_params => header_params,
123
+ :query_params => query_params,
124
+ :form_params => form_params,
125
+ :body => post_body,
126
+ :auth_names => auth_names,
127
+ :return_type => 'CreateSubmissionBatchResponse')
128
+ if @api_client.config.debugging
129
+ @api_client.config.logger.debug "API called: PDFApi#batch_generate_pdfs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
130
+ end
131
+ return data, status_code, headers
132
+ end
133
+
134
+ # Merge submission PDFs, template PDFs, or custom files
135
+ # @param combine_pdfs_data
136
+ # @param [Hash] opts the optional parameters
137
+ # @return [CreateCombinedSubmissionResponse]
138
+ def combine_pdfs(combine_pdfs_data, opts = {})
139
+ data, _status_code, _headers = combine_pdfs_with_http_info(combine_pdfs_data, opts)
140
+ data
141
+ end
142
+
143
+ # Merge submission PDFs, template PDFs, or custom files
144
+ # @param combine_pdfs_data
145
+ # @param [Hash] opts the optional parameters
146
+ # @return [Array<(CreateCombinedSubmissionResponse, Fixnum, Hash)>] CreateCombinedSubmissionResponse data, response status code and response headers
147
+ def combine_pdfs_with_http_info(combine_pdfs_data, opts = {})
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug 'Calling API: PDFApi.combine_pdfs ...'
150
+ end
151
+ # verify the required parameter 'combine_pdfs_data' is set
152
+ if @api_client.config.client_side_validation && combine_pdfs_data.nil?
153
+ fail ArgumentError, "Missing the required parameter 'combine_pdfs_data' when calling PDFApi.combine_pdfs"
154
+ end
155
+ # resource path
156
+ local_var_path = '/combined_submissions?v=2'
157
+
158
+ # query parameters
159
+ query_params = {}
160
+
161
+ # header parameters
162
+ header_params = {}
163
+ # HTTP header 'Accept' (if needed)
164
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
165
+ # HTTP header 'Content-Type'
166
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
167
+
168
+ # form parameters
169
+ form_params = {}
170
+
171
+ # http body (model)
172
+ post_body = @api_client.object_to_http_body(combine_pdfs_data)
173
+ auth_names = ['api_token_basic']
174
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
175
+ :header_params => header_params,
176
+ :query_params => query_params,
177
+ :form_params => form_params,
178
+ :body => post_body,
179
+ :auth_names => auth_names,
180
+ :return_type => 'CreateCombinedSubmissionResponse')
181
+ if @api_client.config.debugging
182
+ @api_client.config.logger.debug "API called: PDFApi#combine_pdfs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
183
+ end
184
+ return data, status_code, headers
185
+ end
186
+
187
+ # Merge generated PDFs together
188
+ # @param combined_submission_data
189
+ # @param [Hash] opts the optional parameters
190
+ # @return [CreateCombinedSubmissionResponse]
191
+ def combine_submissions(combined_submission_data, opts = {})
192
+ data, _status_code, _headers = combine_submissions_with_http_info(combined_submission_data, opts)
193
+ data
194
+ end
195
+
196
+ # Merge generated PDFs together
197
+ # @param combined_submission_data
198
+ # @param [Hash] opts the optional parameters
199
+ # @return [Array<(CreateCombinedSubmissionResponse, Fixnum, Hash)>] CreateCombinedSubmissionResponse data, response status code and response headers
200
+ def combine_submissions_with_http_info(combined_submission_data, opts = {})
201
+ if @api_client.config.debugging
202
+ @api_client.config.logger.debug 'Calling API: PDFApi.combine_submissions ...'
203
+ end
204
+ # verify the required parameter 'combined_submission_data' is set
205
+ if @api_client.config.client_side_validation && combined_submission_data.nil?
206
+ fail ArgumentError, "Missing the required parameter 'combined_submission_data' when calling PDFApi.combine_submissions"
207
+ end
208
+ # resource path
209
+ local_var_path = '/combined_submissions'
210
+
211
+ # query parameters
212
+ query_params = {}
213
+
214
+ # header parameters
215
+ header_params = {}
216
+ # HTTP header 'Accept' (if needed)
217
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
218
+ # HTTP header 'Content-Type'
219
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
220
+
221
+ # form parameters
222
+ form_params = {}
223
+
224
+ # http body (model)
225
+ post_body = @api_client.object_to_http_body(combined_submission_data)
226
+ auth_names = ['api_token_basic']
227
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
228
+ :header_params => header_params,
229
+ :query_params => query_params,
230
+ :form_params => form_params,
231
+ :body => post_body,
232
+ :auth_names => auth_names,
233
+ :return_type => 'CreateCombinedSubmissionResponse')
234
+ if @api_client.config.debugging
235
+ @api_client.config.logger.debug "API called: PDFApi#combine_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
236
+ end
237
+ return data, status_code, headers
238
+ end
239
+
240
+ # Create a new custom file from a cached presign upload
241
+ # @param create_custom_file_data
242
+ # @param [Hash] opts the optional parameters
243
+ # @return [CreateCustomFileResponse]
244
+ def create_custom_file_from_upload(create_custom_file_data, opts = {})
245
+ data, _status_code, _headers = create_custom_file_from_upload_with_http_info(create_custom_file_data, opts)
246
+ data
247
+ end
248
+
249
+ # Create a new custom file from a cached presign upload
250
+ # @param create_custom_file_data
251
+ # @param [Hash] opts the optional parameters
252
+ # @return [Array<(CreateCustomFileResponse, Fixnum, Hash)>] CreateCustomFileResponse data, response status code and response headers
253
+ def create_custom_file_from_upload_with_http_info(create_custom_file_data, opts = {})
254
+ if @api_client.config.debugging
255
+ @api_client.config.logger.debug 'Calling API: PDFApi.create_custom_file_from_upload ...'
256
+ end
257
+ # verify the required parameter 'create_custom_file_data' is set
258
+ if @api_client.config.client_side_validation && create_custom_file_data.nil?
259
+ fail ArgumentError, "Missing the required parameter 'create_custom_file_data' when calling PDFApi.create_custom_file_from_upload"
260
+ end
261
+ # resource path
262
+ local_var_path = '/custom_files'
263
+
264
+ # query parameters
265
+ query_params = {}
266
+
267
+ # header parameters
268
+ header_params = {}
269
+ # HTTP header 'Accept' (if needed)
270
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
271
+ # HTTP header 'Content-Type'
272
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
273
+
274
+ # form parameters
275
+ form_params = {}
276
+
277
+ # http body (model)
278
+ post_body = @api_client.object_to_http_body(create_custom_file_data)
279
+ auth_names = ['api_token_basic']
280
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
281
+ :header_params => header_params,
282
+ :query_params => query_params,
283
+ :form_params => form_params,
284
+ :body => post_body,
285
+ :auth_names => auth_names,
286
+ :return_type => 'CreateCustomFileResponse')
287
+ if @api_client.config.debugging
288
+ @api_client.config.logger.debug "API called: PDFApi#create_custom_file_from_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
289
+ end
290
+ return data, status_code, headers
291
+ end
292
+
293
+ # Creates a new data request token for form authentication
294
+ # @param data_request_id
295
+ # @param [Hash] opts the optional parameters
296
+ # @return [CreateSubmissionDataRequestTokenResponse]
297
+ def create_data_request_token(data_request_id, opts = {})
298
+ data, _status_code, _headers = create_data_request_token_with_http_info(data_request_id, opts)
299
+ data
300
+ end
301
+
302
+ # Creates a new data request token for form authentication
303
+ # @param data_request_id
304
+ # @param [Hash] opts the optional parameters
305
+ # @return [Array<(CreateSubmissionDataRequestTokenResponse, Fixnum, Hash)>] CreateSubmissionDataRequestTokenResponse data, response status code and response headers
306
+ def create_data_request_token_with_http_info(data_request_id, opts = {})
307
+ if @api_client.config.debugging
308
+ @api_client.config.logger.debug 'Calling API: PDFApi.create_data_request_token ...'
309
+ end
310
+ # verify the required parameter 'data_request_id' is set
311
+ if @api_client.config.client_side_validation && data_request_id.nil?
312
+ fail ArgumentError, "Missing the required parameter 'data_request_id' when calling PDFApi.create_data_request_token"
313
+ end
314
+ # resource path
315
+ local_var_path = '/data_requests/{data_request_id}/tokens'.sub('{' + 'data_request_id' + '}', data_request_id.to_s)
316
+
317
+ # query parameters
318
+ query_params = {}
319
+
320
+ # header parameters
321
+ header_params = {}
322
+ # HTTP header 'Accept' (if needed)
323
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
324
+
325
+ # form parameters
326
+ form_params = {}
327
+
328
+ # http body (model)
329
+ post_body = nil
330
+ auth_names = ['api_token_basic']
331
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
332
+ :header_params => header_params,
333
+ :query_params => query_params,
334
+ :form_params => form_params,
335
+ :body => post_body,
336
+ :auth_names => auth_names,
337
+ :return_type => 'CreateSubmissionDataRequestTokenResponse')
338
+ if @api_client.config.debugging
339
+ @api_client.config.logger.debug "API called: PDFApi#create_data_request_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
340
+ end
341
+ return data, status_code, headers
342
+ end
343
+
344
+ # Create a folder
345
+ # @param create_folder_data
346
+ # @param [Hash] opts the optional parameters
347
+ # @return [Folder]
348
+ def create_folder(create_folder_data, opts = {})
349
+ data, _status_code, _headers = create_folder_with_http_info(create_folder_data, opts)
350
+ data
351
+ end
352
+
353
+ # Create a folder
354
+ # @param create_folder_data
355
+ # @param [Hash] opts the optional parameters
356
+ # @return [Array<(Folder, Fixnum, Hash)>] Folder data, response status code and response headers
357
+ def create_folder_with_http_info(create_folder_data, opts = {})
358
+ if @api_client.config.debugging
359
+ @api_client.config.logger.debug 'Calling API: PDFApi.create_folder ...'
360
+ end
361
+ # verify the required parameter 'create_folder_data' is set
362
+ if @api_client.config.client_side_validation && create_folder_data.nil?
363
+ fail ArgumentError, "Missing the required parameter 'create_folder_data' when calling PDFApi.create_folder"
364
+ end
365
+ # resource path
366
+ local_var_path = '/folders/'
367
+
368
+ # query parameters
369
+ query_params = {}
370
+
371
+ # header parameters
372
+ header_params = {}
373
+ # HTTP header 'Accept' (if needed)
374
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
375
+ # HTTP header 'Content-Type'
376
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
377
+
378
+ # form parameters
379
+ form_params = {}
380
+
381
+ # http body (model)
382
+ post_body = @api_client.object_to_http_body(create_folder_data)
383
+ auth_names = ['api_token_basic']
384
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
385
+ :header_params => header_params,
386
+ :query_params => query_params,
387
+ :form_params => form_params,
388
+ :body => post_body,
389
+ :auth_names => auth_names,
390
+ :return_type => 'Folder')
391
+ if @api_client.config.debugging
392
+ @api_client.config.logger.debug "API called: PDFApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
393
+ end
394
+ return data, status_code, headers
395
+ end
396
+
397
+ # Upload a new PDF template with a file upload
398
+ # @param template_document
399
+ # @param template_name
400
+ # @param [Hash] opts the optional parameters
401
+ # @option opts [String] :template_parent_folder_id
402
+ # @return [PendingTemplate]
403
+ def create_template(template_document, template_name, opts = {})
404
+ data, _status_code, _headers = create_template_with_http_info(template_document, template_name, opts)
405
+ data
406
+ end
407
+
408
+ # Upload a new PDF template with a file upload
409
+ # @param template_document
410
+ # @param template_name
411
+ # @param [Hash] opts the optional parameters
412
+ # @option opts [String] :template_parent_folder_id
413
+ # @return [Array<(PendingTemplate, Fixnum, Hash)>] PendingTemplate data, response status code and response headers
414
+ def create_template_with_http_info(template_document, template_name, opts = {})
415
+ if @api_client.config.debugging
416
+ @api_client.config.logger.debug 'Calling API: PDFApi.create_template ...'
417
+ end
418
+ # verify the required parameter 'template_document' is set
419
+ if @api_client.config.client_side_validation && template_document.nil?
420
+ fail ArgumentError, "Missing the required parameter 'template_document' when calling PDFApi.create_template"
421
+ end
422
+ # verify the required parameter 'template_name' is set
423
+ if @api_client.config.client_side_validation && template_name.nil?
424
+ fail ArgumentError, "Missing the required parameter 'template_name' when calling PDFApi.create_template"
425
+ end
426
+ # resource path
427
+ local_var_path = '/templates'
428
+
429
+ # query parameters
430
+ query_params = {}
431
+
432
+ # header parameters
433
+ header_params = {}
434
+ # HTTP header 'Accept' (if needed)
435
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
436
+ # HTTP header 'Content-Type'
437
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
438
+
439
+ # form parameters
440
+ form_params = {}
441
+ form_params['template[document]'] = template_document
442
+ form_params['template[name]'] = template_name
443
+ form_params['template[parent_folder_id]'] = opts[:'template_parent_folder_id'] if !opts[:'template_parent_folder_id'].nil?
444
+
445
+ # http body (model)
446
+ post_body = nil
447
+ auth_names = ['api_token_basic']
448
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
449
+ :header_params => header_params,
450
+ :query_params => query_params,
451
+ :form_params => form_params,
452
+ :body => post_body,
453
+ :auth_names => auth_names,
454
+ :return_type => 'PendingTemplate')
455
+ if @api_client.config.debugging
456
+ @api_client.config.logger.debug "API called: PDFApi#create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
457
+ end
458
+ return data, status_code, headers
459
+ end
460
+
461
+ # Create a new PDF template from a cached presign upload
462
+ # @param create_template_data
463
+ # @param [Hash] opts the optional parameters
464
+ # @return [PendingTemplate]
465
+ def create_template_from_upload(create_template_data, opts = {})
466
+ data, _status_code, _headers = create_template_from_upload_with_http_info(create_template_data, opts)
467
+ data
468
+ end
469
+
470
+ # Create a new PDF template from a cached presign upload
471
+ # @param create_template_data
472
+ # @param [Hash] opts the optional parameters
473
+ # @return [Array<(PendingTemplate, Fixnum, Hash)>] PendingTemplate data, response status code and response headers
474
+ def create_template_from_upload_with_http_info(create_template_data, opts = {})
475
+ if @api_client.config.debugging
476
+ @api_client.config.logger.debug 'Calling API: PDFApi.create_template_from_upload ...'
477
+ end
478
+ # verify the required parameter 'create_template_data' is set
479
+ if @api_client.config.client_side_validation && create_template_data.nil?
480
+ fail ArgumentError, "Missing the required parameter 'create_template_data' when calling PDFApi.create_template_from_upload"
481
+ end
482
+ # resource path
483
+ local_var_path = '/templates?v=2'
484
+
485
+ # query parameters
486
+ query_params = {}
487
+
488
+ # header parameters
489
+ header_params = {}
490
+ # HTTP header 'Accept' (if needed)
491
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
492
+ # HTTP header 'Content-Type'
493
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
494
+
495
+ # form parameters
496
+ form_params = {}
497
+
498
+ # http body (model)
499
+ post_body = @api_client.object_to_http_body(create_template_data)
500
+ auth_names = ['api_token_basic']
501
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
502
+ :header_params => header_params,
503
+ :query_params => query_params,
504
+ :form_params => form_params,
505
+ :body => post_body,
506
+ :auth_names => auth_names,
507
+ :return_type => 'PendingTemplate')
508
+ if @api_client.config.debugging
509
+ @api_client.config.logger.debug "API called: PDFApi#create_template_from_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
510
+ end
511
+ return data, status_code, headers
512
+ end
513
+
514
+ # Delete a folder
515
+ # @param folder_id
516
+ # @param [Hash] opts the optional parameters
517
+ # @return [Folder]
518
+ def delete_folder(folder_id, opts = {})
519
+ data, _status_code, _headers = delete_folder_with_http_info(folder_id, opts)
520
+ data
521
+ end
522
+
523
+ # Delete a folder
524
+ # @param folder_id
525
+ # @param [Hash] opts the optional parameters
526
+ # @return [Array<(Folder, Fixnum, Hash)>] Folder data, response status code and response headers
527
+ def delete_folder_with_http_info(folder_id, opts = {})
528
+ if @api_client.config.debugging
529
+ @api_client.config.logger.debug 'Calling API: PDFApi.delete_folder ...'
530
+ end
531
+ # verify the required parameter 'folder_id' is set
532
+ if @api_client.config.client_side_validation && folder_id.nil?
533
+ fail ArgumentError, "Missing the required parameter 'folder_id' when calling PDFApi.delete_folder"
534
+ end
535
+ # resource path
536
+ local_var_path = '/folders/{folder_id}'.sub('{' + 'folder_id' + '}', folder_id.to_s)
537
+
538
+ # query parameters
539
+ query_params = {}
540
+
541
+ # header parameters
542
+ header_params = {}
543
+ # HTTP header 'Accept' (if needed)
544
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
545
+
546
+ # form parameters
547
+ form_params = {}
548
+
549
+ # http body (model)
550
+ post_body = nil
551
+ auth_names = ['api_token_basic']
552
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
553
+ :header_params => header_params,
554
+ :query_params => query_params,
555
+ :form_params => form_params,
556
+ :body => post_body,
557
+ :auth_names => auth_names,
558
+ :return_type => 'Folder')
559
+ if @api_client.config.debugging
560
+ @api_client.config.logger.debug "API called: PDFApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
561
+ end
562
+ return data, status_code, headers
563
+ end
564
+
565
+ # Expire a combined submission
566
+ # @param combined_submission_id
567
+ # @param [Hash] opts the optional parameters
568
+ # @return [CombinedSubmission]
569
+ def expire_combined_submission(combined_submission_id, opts = {})
570
+ data, _status_code, _headers = expire_combined_submission_with_http_info(combined_submission_id, opts)
571
+ data
572
+ end
573
+
574
+ # Expire a combined submission
575
+ # @param combined_submission_id
576
+ # @param [Hash] opts the optional parameters
577
+ # @return [Array<(CombinedSubmission, Fixnum, Hash)>] CombinedSubmission data, response status code and response headers
578
+ def expire_combined_submission_with_http_info(combined_submission_id, opts = {})
579
+ if @api_client.config.debugging
580
+ @api_client.config.logger.debug 'Calling API: PDFApi.expire_combined_submission ...'
581
+ end
582
+ # verify the required parameter 'combined_submission_id' is set
583
+ if @api_client.config.client_side_validation && combined_submission_id.nil?
584
+ fail ArgumentError, "Missing the required parameter 'combined_submission_id' when calling PDFApi.expire_combined_submission"
585
+ end
586
+ # resource path
587
+ local_var_path = '/combined_submissions/{combined_submission_id}'.sub('{' + 'combined_submission_id' + '}', combined_submission_id.to_s)
588
+
589
+ # query parameters
590
+ query_params = {}
591
+
592
+ # header parameters
593
+ header_params = {}
594
+ # HTTP header 'Accept' (if needed)
595
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
596
+
597
+ # form parameters
598
+ form_params = {}
599
+
600
+ # http body (model)
601
+ post_body = nil
602
+ auth_names = ['api_token_basic']
603
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
604
+ :header_params => header_params,
605
+ :query_params => query_params,
606
+ :form_params => form_params,
607
+ :body => post_body,
608
+ :auth_names => auth_names,
609
+ :return_type => 'CombinedSubmission')
610
+ if @api_client.config.debugging
611
+ @api_client.config.logger.debug "API called: PDFApi#expire_combined_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
612
+ end
613
+ return data, status_code, headers
614
+ end
615
+
616
+ # Expire a PDF submission
617
+ # @param submission_id
618
+ # @param [Hash] opts the optional parameters
619
+ # @return [Submission]
620
+ def expire_submission(submission_id, opts = {})
621
+ data, _status_code, _headers = expire_submission_with_http_info(submission_id, opts)
622
+ data
623
+ end
624
+
625
+ # Expire a PDF submission
626
+ # @param submission_id
627
+ # @param [Hash] opts the optional parameters
628
+ # @return [Array<(Submission, Fixnum, Hash)>] Submission data, response status code and response headers
629
+ def expire_submission_with_http_info(submission_id, opts = {})
630
+ if @api_client.config.debugging
631
+ @api_client.config.logger.debug 'Calling API: PDFApi.expire_submission ...'
632
+ end
633
+ # verify the required parameter 'submission_id' is set
634
+ if @api_client.config.client_side_validation && submission_id.nil?
635
+ fail ArgumentError, "Missing the required parameter 'submission_id' when calling PDFApi.expire_submission"
636
+ end
637
+ # resource path
638
+ local_var_path = '/submissions/{submission_id}'.sub('{' + 'submission_id' + '}', submission_id.to_s)
639
+
640
+ # query parameters
641
+ query_params = {}
642
+
643
+ # header parameters
644
+ header_params = {}
645
+ # HTTP header 'Accept' (if needed)
646
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
647
+
648
+ # form parameters
649
+ form_params = {}
650
+
651
+ # http body (model)
652
+ post_body = nil
653
+ auth_names = ['api_token_basic']
654
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
655
+ :header_params => header_params,
656
+ :query_params => query_params,
657
+ :form_params => form_params,
658
+ :body => post_body,
659
+ :auth_names => auth_names,
660
+ :return_type => 'Submission')
661
+ if @api_client.config.debugging
662
+ @api_client.config.logger.debug "API called: PDFApi#expire_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
663
+ end
664
+ return data, status_code, headers
665
+ end
666
+
667
+ # Generates a new PDF
668
+ # @param template_id
669
+ # @param submission_data
670
+ # @param [Hash] opts the optional parameters
671
+ # @return [CreateSubmissionResponse]
672
+ def generate_pdf(template_id, submission_data, opts = {})
673
+ data, _status_code, _headers = generate_pdf_with_http_info(template_id, submission_data, opts)
674
+ data
675
+ end
676
+
677
+ # Generates a new PDF
678
+ # @param template_id
679
+ # @param submission_data
680
+ # @param [Hash] opts the optional parameters
681
+ # @return [Array<(CreateSubmissionResponse, Fixnum, Hash)>] CreateSubmissionResponse data, response status code and response headers
682
+ def generate_pdf_with_http_info(template_id, submission_data, opts = {})
683
+ if @api_client.config.debugging
684
+ @api_client.config.logger.debug 'Calling API: PDFApi.generate_pdf ...'
685
+ end
686
+ # verify the required parameter 'template_id' is set
687
+ if @api_client.config.client_side_validation && template_id.nil?
688
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.generate_pdf"
689
+ end
690
+ # verify the required parameter 'submission_data' is set
691
+ if @api_client.config.client_side_validation && submission_data.nil?
692
+ fail ArgumentError, "Missing the required parameter 'submission_data' when calling PDFApi.generate_pdf"
693
+ end
694
+ # resource path
695
+ local_var_path = '/templates/{template_id}/submissions'.sub('{' + 'template_id' + '}', template_id.to_s)
696
+
697
+ # query parameters
698
+ query_params = {}
699
+
700
+ # header parameters
701
+ header_params = {}
702
+ # HTTP header 'Accept' (if needed)
703
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
704
+ # HTTP header 'Content-Type'
705
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
706
+
707
+ # form parameters
708
+ form_params = {}
709
+
710
+ # http body (model)
711
+ post_body = @api_client.object_to_http_body(submission_data)
712
+ auth_names = ['api_token_basic']
713
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
714
+ :header_params => header_params,
715
+ :query_params => query_params,
716
+ :form_params => form_params,
717
+ :body => post_body,
718
+ :auth_names => auth_names,
719
+ :return_type => 'CreateSubmissionResponse')
720
+ if @api_client.config.debugging
721
+ @api_client.config.logger.debug "API called: PDFApi#generate_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
722
+ end
723
+ return data, status_code, headers
724
+ end
725
+
726
+ # Check the status of a combined submission (merged PDFs)
727
+ # @param combined_submission_id
728
+ # @param [Hash] opts the optional parameters
729
+ # @return [CombinedSubmission]
730
+ def get_combined_submission(combined_submission_id, opts = {})
731
+ data, _status_code, _headers = get_combined_submission_with_http_info(combined_submission_id, opts)
732
+ data
733
+ end
734
+
735
+ # Check the status of a combined submission (merged PDFs)
736
+ # @param combined_submission_id
737
+ # @param [Hash] opts the optional parameters
738
+ # @return [Array<(CombinedSubmission, Fixnum, Hash)>] CombinedSubmission data, response status code and response headers
739
+ def get_combined_submission_with_http_info(combined_submission_id, opts = {})
740
+ if @api_client.config.debugging
741
+ @api_client.config.logger.debug 'Calling API: PDFApi.get_combined_submission ...'
742
+ end
743
+ # verify the required parameter 'combined_submission_id' is set
744
+ if @api_client.config.client_side_validation && combined_submission_id.nil?
745
+ fail ArgumentError, "Missing the required parameter 'combined_submission_id' when calling PDFApi.get_combined_submission"
746
+ end
747
+ # resource path
748
+ local_var_path = '/combined_submissions/{combined_submission_id}'.sub('{' + 'combined_submission_id' + '}', combined_submission_id.to_s)
749
+
750
+ # query parameters
751
+ query_params = {}
752
+
753
+ # header parameters
754
+ header_params = {}
755
+ # HTTP header 'Accept' (if needed)
756
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
757
+
758
+ # form parameters
759
+ form_params = {}
760
+
761
+ # http body (model)
762
+ post_body = nil
763
+ auth_names = ['api_token_basic']
764
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
765
+ :header_params => header_params,
766
+ :query_params => query_params,
767
+ :form_params => form_params,
768
+ :body => post_body,
769
+ :auth_names => auth_names,
770
+ :return_type => 'CombinedSubmission')
771
+ if @api_client.config.debugging
772
+ @api_client.config.logger.debug "API called: PDFApi#get_combined_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
773
+ end
774
+ return data, status_code, headers
775
+ end
776
+
777
+ # Look up a submission data request
778
+ # @param data_request_id
779
+ # @param [Hash] opts the optional parameters
780
+ # @return [SubmissionDataRequest]
781
+ def get_data_request(data_request_id, opts = {})
782
+ data, _status_code, _headers = get_data_request_with_http_info(data_request_id, opts)
783
+ data
784
+ end
785
+
786
+ # Look up a submission data request
787
+ # @param data_request_id
788
+ # @param [Hash] opts the optional parameters
789
+ # @return [Array<(SubmissionDataRequest, Fixnum, Hash)>] SubmissionDataRequest data, response status code and response headers
790
+ def get_data_request_with_http_info(data_request_id, opts = {})
791
+ if @api_client.config.debugging
792
+ @api_client.config.logger.debug 'Calling API: PDFApi.get_data_request ...'
793
+ end
794
+ # verify the required parameter 'data_request_id' is set
795
+ if @api_client.config.client_side_validation && data_request_id.nil?
796
+ fail ArgumentError, "Missing the required parameter 'data_request_id' when calling PDFApi.get_data_request"
797
+ end
798
+ # resource path
799
+ local_var_path = '/data_requests/{data_request_id}'.sub('{' + 'data_request_id' + '}', data_request_id.to_s)
800
+
801
+ # query parameters
802
+ query_params = {}
803
+
804
+ # header parameters
805
+ header_params = {}
806
+ # HTTP header 'Accept' (if needed)
807
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
808
+
809
+ # form parameters
810
+ form_params = {}
811
+
812
+ # http body (model)
813
+ post_body = nil
814
+ auth_names = ['api_token_basic']
815
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
816
+ :header_params => header_params,
817
+ :query_params => query_params,
818
+ :form_params => form_params,
819
+ :body => post_body,
820
+ :auth_names => auth_names,
821
+ :return_type => 'SubmissionDataRequest')
822
+ if @api_client.config.debugging
823
+ @api_client.config.logger.debug "API called: PDFApi#get_data_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
824
+ end
825
+ return data, status_code, headers
826
+ end
827
+
828
+ # Get a presigned URL so that you can upload a file to our AWS S3 bucket
829
+ # @param [Hash] opts the optional parameters
830
+ # @return [Hash<String, Object>]
831
+ def get_presign_url(opts = {})
832
+ data, _status_code, _headers = get_presign_url_with_http_info(opts)
833
+ data
834
+ end
835
+
836
+ # Get a presigned URL so that you can upload a file to our AWS S3 bucket
837
+ # @param [Hash] opts the optional parameters
838
+ # @return [Array<(Hash<String, Object>, Fixnum, Hash)>] Hash<String, Object> data, response status code and response headers
839
+ def get_presign_url_with_http_info(opts = {})
840
+ if @api_client.config.debugging
841
+ @api_client.config.logger.debug 'Calling API: PDFApi.get_presign_url ...'
842
+ end
843
+ # resource path
844
+ local_var_path = '/uploads/presign'
845
+
846
+ # query parameters
847
+ query_params = {}
848
+
849
+ # header parameters
850
+ header_params = {}
851
+ # HTTP header 'Accept' (if needed)
852
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
853
+
854
+ # form parameters
855
+ form_params = {}
856
+
857
+ # http body (model)
858
+ post_body = nil
859
+ auth_names = ['api_token_basic']
860
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
861
+ :header_params => header_params,
862
+ :query_params => query_params,
863
+ :form_params => form_params,
864
+ :body => post_body,
865
+ :auth_names => auth_names,
866
+ :return_type => 'Hash<String, Object>')
867
+ if @api_client.config.debugging
868
+ @api_client.config.logger.debug "API called: PDFApi#get_presign_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
869
+ end
870
+ return data, status_code, headers
871
+ end
872
+
873
+ # Check the status of a PDF
874
+ # @param submission_id
875
+ # @param [Hash] opts the optional parameters
876
+ # @option opts [BOOLEAN] :include_data
877
+ # @return [Submission]
878
+ def get_submission(submission_id, opts = {})
879
+ data, _status_code, _headers = get_submission_with_http_info(submission_id, opts)
880
+ data
881
+ end
882
+
883
+ # Check the status of a PDF
884
+ # @param submission_id
885
+ # @param [Hash] opts the optional parameters
886
+ # @option opts [BOOLEAN] :include_data
887
+ # @return [Array<(Submission, Fixnum, Hash)>] Submission data, response status code and response headers
888
+ def get_submission_with_http_info(submission_id, opts = {})
889
+ if @api_client.config.debugging
890
+ @api_client.config.logger.debug 'Calling API: PDFApi.get_submission ...'
891
+ end
892
+ # verify the required parameter 'submission_id' is set
893
+ if @api_client.config.client_side_validation && submission_id.nil?
894
+ fail ArgumentError, "Missing the required parameter 'submission_id' when calling PDFApi.get_submission"
895
+ end
896
+ # resource path
897
+ local_var_path = '/submissions/{submission_id}'.sub('{' + 'submission_id' + '}', submission_id.to_s)
898
+
899
+ # query parameters
900
+ query_params = {}
901
+ query_params[:'include_data'] = opts[:'include_data'] if !opts[:'include_data'].nil?
902
+
903
+ # header parameters
904
+ header_params = {}
905
+ # HTTP header 'Accept' (if needed)
906
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
907
+
908
+ # form parameters
909
+ form_params = {}
910
+
911
+ # http body (model)
912
+ post_body = nil
913
+ auth_names = ['api_token_basic']
914
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
915
+ :header_params => header_params,
916
+ :query_params => query_params,
917
+ :form_params => form_params,
918
+ :body => post_body,
919
+ :auth_names => auth_names,
920
+ :return_type => 'Submission')
921
+ if @api_client.config.debugging
922
+ @api_client.config.logger.debug "API called: PDFApi#get_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
923
+ end
924
+ return data, status_code, headers
925
+ end
926
+
927
+ # Check the status of a submission batch job
928
+ # @param submission_batch_id
929
+ # @param [Hash] opts the optional parameters
930
+ # @option opts [BOOLEAN] :include_submissions
931
+ # @return [SubmissionBatch]
932
+ def get_submission_batch(submission_batch_id, opts = {})
933
+ data, _status_code, _headers = get_submission_batch_with_http_info(submission_batch_id, opts)
934
+ data
935
+ end
936
+
937
+ # Check the status of a submission batch job
938
+ # @param submission_batch_id
939
+ # @param [Hash] opts the optional parameters
940
+ # @option opts [BOOLEAN] :include_submissions
941
+ # @return [Array<(SubmissionBatch, Fixnum, Hash)>] SubmissionBatch data, response status code and response headers
942
+ def get_submission_batch_with_http_info(submission_batch_id, opts = {})
943
+ if @api_client.config.debugging
944
+ @api_client.config.logger.debug 'Calling API: PDFApi.get_submission_batch ...'
945
+ end
946
+ # verify the required parameter 'submission_batch_id' is set
947
+ if @api_client.config.client_side_validation && submission_batch_id.nil?
948
+ fail ArgumentError, "Missing the required parameter 'submission_batch_id' when calling PDFApi.get_submission_batch"
949
+ end
950
+ # resource path
951
+ local_var_path = '/submissions/batches/{submission_batch_id}'.sub('{' + 'submission_batch_id' + '}', submission_batch_id.to_s)
952
+
953
+ # query parameters
954
+ query_params = {}
955
+ query_params[:'include_submissions'] = opts[:'include_submissions'] if !opts[:'include_submissions'].nil?
956
+
957
+ # header parameters
958
+ header_params = {}
959
+ # HTTP header 'Accept' (if needed)
960
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
961
+
962
+ # form parameters
963
+ form_params = {}
964
+
965
+ # http body (model)
966
+ post_body = nil
967
+ auth_names = ['api_token_basic']
968
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
969
+ :header_params => header_params,
970
+ :query_params => query_params,
971
+ :form_params => form_params,
972
+ :body => post_body,
973
+ :auth_names => auth_names,
974
+ :return_type => 'SubmissionBatch')
975
+ if @api_client.config.debugging
976
+ @api_client.config.logger.debug "API called: PDFApi#get_submission_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
977
+ end
978
+ return data, status_code, headers
979
+ end
980
+
981
+ # Get a single template
982
+ # @param template_id
983
+ # @param [Hash] opts the optional parameters
984
+ # @return [Template]
985
+ def get_template(template_id, opts = {})
986
+ data, _status_code, _headers = get_template_with_http_info(template_id, opts)
987
+ data
988
+ end
989
+
990
+ # Get a single template
991
+ # @param template_id
992
+ # @param [Hash] opts the optional parameters
993
+ # @return [Array<(Template, Fixnum, Hash)>] Template data, response status code and response headers
994
+ def get_template_with_http_info(template_id, opts = {})
995
+ if @api_client.config.debugging
996
+ @api_client.config.logger.debug 'Calling API: PDFApi.get_template ...'
997
+ end
998
+ # verify the required parameter 'template_id' is set
999
+ if @api_client.config.client_side_validation && template_id.nil?
1000
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.get_template"
1001
+ end
1002
+ # resource path
1003
+ local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)
1004
+
1005
+ # query parameters
1006
+ query_params = {}
1007
+
1008
+ # header parameters
1009
+ header_params = {}
1010
+ # HTTP header 'Accept' (if needed)
1011
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1012
+
1013
+ # form parameters
1014
+ form_params = {}
1015
+
1016
+ # http body (model)
1017
+ post_body = nil
1018
+ auth_names = ['api_token_basic']
1019
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1020
+ :header_params => header_params,
1021
+ :query_params => query_params,
1022
+ :form_params => form_params,
1023
+ :body => post_body,
1024
+ :auth_names => auth_names,
1025
+ :return_type => 'Template')
1026
+ if @api_client.config.debugging
1027
+ @api_client.config.logger.debug "API called: PDFApi#get_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1028
+ end
1029
+ return data, status_code, headers
1030
+ end
1031
+
1032
+ # Fetch the JSON schema for a template
1033
+ # @param template_id
1034
+ # @param [Hash] opts the optional parameters
1035
+ # @return [Hash<String, Object>]
1036
+ def get_template_schema(template_id, opts = {})
1037
+ data, _status_code, _headers = get_template_schema_with_http_info(template_id, opts)
1038
+ data
1039
+ end
1040
+
1041
+ # Fetch the JSON schema for a template
1042
+ # @param template_id
1043
+ # @param [Hash] opts the optional parameters
1044
+ # @return [Array<(Hash<String, Object>, Fixnum, Hash)>] Hash<String, Object> data, response status code and response headers
1045
+ def get_template_schema_with_http_info(template_id, opts = {})
1046
+ if @api_client.config.debugging
1047
+ @api_client.config.logger.debug 'Calling API: PDFApi.get_template_schema ...'
1048
+ end
1049
+ # verify the required parameter 'template_id' is set
1050
+ if @api_client.config.client_side_validation && template_id.nil?
1051
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.get_template_schema"
1052
+ end
1053
+ # resource path
1054
+ local_var_path = '/templates/{template_id}/schema'.sub('{' + 'template_id' + '}', template_id.to_s)
1055
+
1056
+ # query parameters
1057
+ query_params = {}
1058
+
1059
+ # header parameters
1060
+ header_params = {}
1061
+ # HTTP header 'Accept' (if needed)
1062
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1063
+
1064
+ # form parameters
1065
+ form_params = {}
1066
+
1067
+ # http body (model)
1068
+ post_body = nil
1069
+ auth_names = ['api_token_basic']
1070
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1071
+ :header_params => header_params,
1072
+ :query_params => query_params,
1073
+ :form_params => form_params,
1074
+ :body => post_body,
1075
+ :auth_names => auth_names,
1076
+ :return_type => 'Hash<String, Object>')
1077
+ if @api_client.config.debugging
1078
+ @api_client.config.logger.debug "API called: PDFApi#get_template_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1079
+ end
1080
+ return data, status_code, headers
1081
+ end
1082
+
1083
+ # Get a list of all folders
1084
+ # @param [Hash] opts the optional parameters
1085
+ # @option opts [String] :parent_folder_id Filter By Folder Id
1086
+ # @return [Array<Folder>]
1087
+ def list_folders(opts = {})
1088
+ data, _status_code, _headers = list_folders_with_http_info(opts)
1089
+ data
1090
+ end
1091
+
1092
+ # Get a list of all folders
1093
+ # @param [Hash] opts the optional parameters
1094
+ # @option opts [String] :parent_folder_id Filter By Folder Id
1095
+ # @return [Array<(Array<Folder>, Fixnum, Hash)>] Array<Folder> data, response status code and response headers
1096
+ def list_folders_with_http_info(opts = {})
1097
+ if @api_client.config.debugging
1098
+ @api_client.config.logger.debug 'Calling API: PDFApi.list_folders ...'
1099
+ end
1100
+ # resource path
1101
+ local_var_path = '/folders/'
1102
+
1103
+ # query parameters
1104
+ query_params = {}
1105
+ query_params[:'parent_folder_id'] = opts[:'parent_folder_id'] if !opts[:'parent_folder_id'].nil?
1106
+
1107
+ # header parameters
1108
+ header_params = {}
1109
+ # HTTP header 'Accept' (if needed)
1110
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1111
+
1112
+ # form parameters
1113
+ form_params = {}
1114
+
1115
+ # http body (model)
1116
+ post_body = nil
1117
+ auth_names = ['api_token_basic']
1118
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1119
+ :header_params => header_params,
1120
+ :query_params => query_params,
1121
+ :form_params => form_params,
1122
+ :body => post_body,
1123
+ :auth_names => auth_names,
1124
+ :return_type => 'Array<Folder>')
1125
+ if @api_client.config.debugging
1126
+ @api_client.config.logger.debug "API called: PDFApi#list_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1127
+ end
1128
+ return data, status_code, headers
1129
+ end
1130
+
1131
+ # Get a list of all templates
1132
+ # @param [Hash] opts the optional parameters
1133
+ # @option opts [String] :query Search By Name
1134
+ # @option opts [String] :parent_folder_id Filter By Folder Id
1135
+ # @option opts [Integer] :page Default: 1
1136
+ # @option opts [Integer] :per_page Default: 50
1137
+ # @return [Array<Template>]
1138
+ def list_templates(opts = {})
1139
+ data, _status_code, _headers = list_templates_with_http_info(opts)
1140
+ data
1141
+ end
1142
+
1143
+ # Get a list of all templates
1144
+ # @param [Hash] opts the optional parameters
1145
+ # @option opts [String] :query Search By Name
1146
+ # @option opts [String] :parent_folder_id Filter By Folder Id
1147
+ # @option opts [Integer] :page Default: 1
1148
+ # @option opts [Integer] :per_page Default: 50
1149
+ # @return [Array<(Array<Template>, Fixnum, Hash)>] Array<Template> data, response status code and response headers
1150
+ def list_templates_with_http_info(opts = {})
1151
+ if @api_client.config.debugging
1152
+ @api_client.config.logger.debug 'Calling API: PDFApi.list_templates ...'
1153
+ end
1154
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
1155
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling PDFApi.list_templates, must be greater than or equal to 1.'
1156
+ end
1157
+
1158
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 50
1159
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling PDFApi.list_templates, must be smaller than or equal to 50.'
1160
+ end
1161
+
1162
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
1163
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling PDFApi.list_templates, must be greater than or equal to 1.'
1164
+ end
1165
+
1166
+ # resource path
1167
+ local_var_path = '/templates'
1168
+
1169
+ # query parameters
1170
+ query_params = {}
1171
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
1172
+ query_params[:'parent_folder_id'] = opts[:'parent_folder_id'] if !opts[:'parent_folder_id'].nil?
1173
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
1174
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
1175
+
1176
+ # header parameters
1177
+ header_params = {}
1178
+ # HTTP header 'Accept' (if needed)
1179
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1180
+
1181
+ # form parameters
1182
+ form_params = {}
1183
+
1184
+ # http body (model)
1185
+ post_body = nil
1186
+ auth_names = ['api_token_basic']
1187
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1188
+ :header_params => header_params,
1189
+ :query_params => query_params,
1190
+ :form_params => form_params,
1191
+ :body => post_body,
1192
+ :auth_names => auth_names,
1193
+ :return_type => 'Array<Template>')
1194
+ if @api_client.config.debugging
1195
+ @api_client.config.logger.debug "API called: PDFApi#list_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1196
+ end
1197
+ return data, status_code, headers
1198
+ end
1199
+
1200
+ # Move a folder
1201
+ # @param folder_id
1202
+ # @param move_folder_data
1203
+ # @param [Hash] opts the optional parameters
1204
+ # @return [Folder]
1205
+ def move_folder_to_folder(folder_id, move_folder_data, opts = {})
1206
+ data, _status_code, _headers = move_folder_to_folder_with_http_info(folder_id, move_folder_data, opts)
1207
+ data
1208
+ end
1209
+
1210
+ # Move a folder
1211
+ # @param folder_id
1212
+ # @param move_folder_data
1213
+ # @param [Hash] opts the optional parameters
1214
+ # @return [Array<(Folder, Fixnum, Hash)>] Folder data, response status code and response headers
1215
+ def move_folder_to_folder_with_http_info(folder_id, move_folder_data, opts = {})
1216
+ if @api_client.config.debugging
1217
+ @api_client.config.logger.debug 'Calling API: PDFApi.move_folder_to_folder ...'
1218
+ end
1219
+ # verify the required parameter 'folder_id' is set
1220
+ if @api_client.config.client_side_validation && folder_id.nil?
1221
+ fail ArgumentError, "Missing the required parameter 'folder_id' when calling PDFApi.move_folder_to_folder"
1222
+ end
1223
+ # verify the required parameter 'move_folder_data' is set
1224
+ if @api_client.config.client_side_validation && move_folder_data.nil?
1225
+ fail ArgumentError, "Missing the required parameter 'move_folder_data' when calling PDFApi.move_folder_to_folder"
1226
+ end
1227
+ # resource path
1228
+ local_var_path = '/folders/{folder_id}/move'.sub('{' + 'folder_id' + '}', folder_id.to_s)
1229
+
1230
+ # query parameters
1231
+ query_params = {}
1232
+
1233
+ # header parameters
1234
+ header_params = {}
1235
+ # HTTP header 'Accept' (if needed)
1236
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1237
+ # HTTP header 'Content-Type'
1238
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1239
+
1240
+ # form parameters
1241
+ form_params = {}
1242
+
1243
+ # http body (model)
1244
+ post_body = @api_client.object_to_http_body(move_folder_data)
1245
+ auth_names = ['api_token_basic']
1246
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
1247
+ :header_params => header_params,
1248
+ :query_params => query_params,
1249
+ :form_params => form_params,
1250
+ :body => post_body,
1251
+ :auth_names => auth_names,
1252
+ :return_type => 'Folder')
1253
+ if @api_client.config.debugging
1254
+ @api_client.config.logger.debug "API called: PDFApi#move_folder_to_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1255
+ end
1256
+ return data, status_code, headers
1257
+ end
1258
+
1259
+ # Move Template to folder
1260
+ # @param template_id
1261
+ # @param move_template_data
1262
+ # @param [Hash] opts the optional parameters
1263
+ # @return [Template]
1264
+ def move_template_to_folder(template_id, move_template_data, opts = {})
1265
+ data, _status_code, _headers = move_template_to_folder_with_http_info(template_id, move_template_data, opts)
1266
+ data
1267
+ end
1268
+
1269
+ # Move Template to folder
1270
+ # @param template_id
1271
+ # @param move_template_data
1272
+ # @param [Hash] opts the optional parameters
1273
+ # @return [Array<(Template, Fixnum, Hash)>] Template data, response status code and response headers
1274
+ def move_template_to_folder_with_http_info(template_id, move_template_data, opts = {})
1275
+ if @api_client.config.debugging
1276
+ @api_client.config.logger.debug 'Calling API: PDFApi.move_template_to_folder ...'
1277
+ end
1278
+ # verify the required parameter 'template_id' is set
1279
+ if @api_client.config.client_side_validation && template_id.nil?
1280
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.move_template_to_folder"
1281
+ end
1282
+ # verify the required parameter 'move_template_data' is set
1283
+ if @api_client.config.client_side_validation && move_template_data.nil?
1284
+ fail ArgumentError, "Missing the required parameter 'move_template_data' when calling PDFApi.move_template_to_folder"
1285
+ end
1286
+ # resource path
1287
+ local_var_path = '/templates/{template_id}/move'.sub('{' + 'template_id' + '}', template_id.to_s)
1288
+
1289
+ # query parameters
1290
+ query_params = {}
1291
+
1292
+ # header parameters
1293
+ header_params = {}
1294
+ # HTTP header 'Accept' (if needed)
1295
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1296
+ # HTTP header 'Content-Type'
1297
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1298
+
1299
+ # form parameters
1300
+ form_params = {}
1301
+
1302
+ # http body (model)
1303
+ post_body = @api_client.object_to_http_body(move_template_data)
1304
+ auth_names = ['api_token_basic']
1305
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
1306
+ :header_params => header_params,
1307
+ :query_params => query_params,
1308
+ :form_params => form_params,
1309
+ :body => post_body,
1310
+ :auth_names => auth_names,
1311
+ :return_type => 'Template')
1312
+ if @api_client.config.debugging
1313
+ @api_client.config.logger.debug "API called: PDFApi#move_template_to_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1314
+ end
1315
+ return data, status_code, headers
1316
+ end
1317
+
1318
+ # Rename a folder
1319
+ # @param folder_id
1320
+ # @param rename_folder_data
1321
+ # @param [Hash] opts the optional parameters
1322
+ # @return [nil]
1323
+ def rename_folder(folder_id, rename_folder_data, opts = {})
1324
+ rename_folder_with_http_info(folder_id, rename_folder_data, opts)
1325
+ nil
1326
+ end
1327
+
1328
+ # Rename a folder
1329
+ # @param folder_id
1330
+ # @param rename_folder_data
1331
+ # @param [Hash] opts the optional parameters
1332
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
1333
+ def rename_folder_with_http_info(folder_id, rename_folder_data, opts = {})
1334
+ if @api_client.config.debugging
1335
+ @api_client.config.logger.debug 'Calling API: PDFApi.rename_folder ...'
1336
+ end
1337
+ # verify the required parameter 'folder_id' is set
1338
+ if @api_client.config.client_side_validation && folder_id.nil?
1339
+ fail ArgumentError, "Missing the required parameter 'folder_id' when calling PDFApi.rename_folder"
1340
+ end
1341
+ # verify the required parameter 'rename_folder_data' is set
1342
+ if @api_client.config.client_side_validation && rename_folder_data.nil?
1343
+ fail ArgumentError, "Missing the required parameter 'rename_folder_data' when calling PDFApi.rename_folder"
1344
+ end
1345
+ # resource path
1346
+ local_var_path = '/folders/{folder_id}/rename'.sub('{' + 'folder_id' + '}', folder_id.to_s)
1347
+
1348
+ # query parameters
1349
+ query_params = {}
1350
+
1351
+ # header parameters
1352
+ header_params = {}
1353
+ # HTTP header 'Accept' (if needed)
1354
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1355
+ # HTTP header 'Content-Type'
1356
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1357
+
1358
+ # form parameters
1359
+ form_params = {}
1360
+
1361
+ # http body (model)
1362
+ post_body = @api_client.object_to_http_body(rename_folder_data)
1363
+ auth_names = ['api_token_basic']
1364
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
1365
+ :header_params => header_params,
1366
+ :query_params => query_params,
1367
+ :form_params => form_params,
1368
+ :body => post_body,
1369
+ :auth_names => auth_names)
1370
+ if @api_client.config.debugging
1371
+ @api_client.config.logger.debug "API called: PDFApi#rename_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1372
+ end
1373
+ return data, status_code, headers
1374
+ end
1375
+
1376
+ # Test Authentication
1377
+ # @param [Hash] opts the optional parameters
1378
+ # @return [AuthenticationSuccessResponse]
1379
+ def test_authentication(opts = {})
1380
+ data, _status_code, _headers = test_authentication_with_http_info(opts)
1381
+ data
1382
+ end
1383
+
1384
+ # Test Authentication
1385
+ # @param [Hash] opts the optional parameters
1386
+ # @return [Array<(AuthenticationSuccessResponse, Fixnum, Hash)>] AuthenticationSuccessResponse data, response status code and response headers
1387
+ def test_authentication_with_http_info(opts = {})
1388
+ if @api_client.config.debugging
1389
+ @api_client.config.logger.debug 'Calling API: PDFApi.test_authentication ...'
1390
+ end
1391
+ # resource path
1392
+ local_var_path = '/authentication'
1393
+
1394
+ # query parameters
1395
+ query_params = {}
1396
+
1397
+ # header parameters
1398
+ header_params = {}
1399
+ # HTTP header 'Accept' (if needed)
1400
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1401
+
1402
+ # form parameters
1403
+ form_params = {}
1404
+
1405
+ # http body (model)
1406
+ post_body = nil
1407
+ auth_names = ['api_token_basic']
1408
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1409
+ :header_params => header_params,
1410
+ :query_params => query_params,
1411
+ :form_params => form_params,
1412
+ :body => post_body,
1413
+ :auth_names => auth_names,
1414
+ :return_type => 'AuthenticationSuccessResponse')
1415
+ if @api_client.config.debugging
1416
+ @api_client.config.logger.debug "API called: PDFApi#test_authentication\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1417
+ end
1418
+ return data, status_code, headers
1419
+ end
1420
+
1421
+ # Update a submission data request
1422
+ # @param data_request_id
1423
+ # @param update_submission_data_request_data
1424
+ # @param [Hash] opts the optional parameters
1425
+ # @return [UpdateDataRequestResponse]
1426
+ def update_data_request(data_request_id, update_submission_data_request_data, opts = {})
1427
+ data, _status_code, _headers = update_data_request_with_http_info(data_request_id, update_submission_data_request_data, opts)
1428
+ data
1429
+ end
1430
+
1431
+ # Update a submission data request
1432
+ # @param data_request_id
1433
+ # @param update_submission_data_request_data
1434
+ # @param [Hash] opts the optional parameters
1435
+ # @return [Array<(UpdateDataRequestResponse, Fixnum, Hash)>] UpdateDataRequestResponse data, response status code and response headers
1436
+ def update_data_request_with_http_info(data_request_id, update_submission_data_request_data, opts = {})
1437
+ if @api_client.config.debugging
1438
+ @api_client.config.logger.debug 'Calling API: PDFApi.update_data_request ...'
1439
+ end
1440
+ # verify the required parameter 'data_request_id' is set
1441
+ if @api_client.config.client_side_validation && data_request_id.nil?
1442
+ fail ArgumentError, "Missing the required parameter 'data_request_id' when calling PDFApi.update_data_request"
1443
+ end
1444
+ # verify the required parameter 'update_submission_data_request_data' is set
1445
+ if @api_client.config.client_side_validation && update_submission_data_request_data.nil?
1446
+ fail ArgumentError, "Missing the required parameter 'update_submission_data_request_data' when calling PDFApi.update_data_request"
1447
+ end
1448
+ # resource path
1449
+ local_var_path = '/data_requests/{data_request_id}'.sub('{' + 'data_request_id' + '}', data_request_id.to_s)
1450
+
1451
+ # query parameters
1452
+ query_params = {}
1453
+
1454
+ # header parameters
1455
+ header_params = {}
1456
+ # HTTP header 'Accept' (if needed)
1457
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1458
+ # HTTP header 'Content-Type'
1459
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1460
+
1461
+ # form parameters
1462
+ form_params = {}
1463
+
1464
+ # http body (model)
1465
+ post_body = @api_client.object_to_http_body(update_submission_data_request_data)
1466
+ auth_names = ['api_token_basic']
1467
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
1468
+ :header_params => header_params,
1469
+ :query_params => query_params,
1470
+ :form_params => form_params,
1471
+ :body => post_body,
1472
+ :auth_names => auth_names,
1473
+ :return_type => 'UpdateDataRequestResponse')
1474
+ if @api_client.config.debugging
1475
+ @api_client.config.logger.debug "API called: PDFApi#update_data_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1476
+ end
1477
+ return data, status_code, headers
1478
+ end
1479
+
1480
+ end
1481
+ end