docspring 3.5.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (505) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +361 -150
  3. data/.openapi-generator/VERSION +1 -1
  4. data/.rubocop.yml +1 -1
  5. data/.travis.yml +1 -1
  6. data/AGENTS.md +79 -19
  7. data/CHANGELOG.md +123 -0
  8. data/Gemfile.lock +7 -7
  9. data/README.md +60 -53
  10. data/docs/{RenameFolderData.md → AiFieldNamingLanguage.md} +2 -5
  11. data/docs/AuthenticationCheck.md +18 -0
  12. data/docs/{CreateFolderData.md → BarcodeSymbology.md} +2 -5
  13. data/docs/{CreateWebhookData.md → CheckCharacter.md} +2 -5
  14. data/docs/Client.md +890 -777
  15. data/docs/{UpdateWebhookData.md → CombinedFieldType.md} +2 -5
  16. data/docs/CombinedPdf.md +44 -0
  17. data/docs/CombinedPdfFiles.md +18 -0
  18. data/docs/CombinedPdfList.md +20 -0
  19. data/docs/CombinedPdfSource.md +26 -0
  20. data/docs/CombinedPdfSourceInput.md +88 -0
  21. data/docs/CombinedPdfSourcePdf.md +20 -0
  22. data/docs/CombinedPdfSourceType.md +15 -0
  23. data/docs/CombinedPdfState.md +15 -0
  24. data/docs/CopyTemplateRequest.md +22 -0
  25. data/docs/CreateCombinedPdfRequest.md +26 -0
  26. data/docs/CreateCustomFileFromUploadRequest.md +18 -0
  27. data/docs/CreateFolderRequest.md +20 -0
  28. data/docs/CreateSignatureRequestEventRequest.md +24 -0
  29. data/docs/CreateSignatureRequestTokenRequest.md +18 -0
  30. data/docs/CreateSubmissionBatchRequest.md +26 -0
  31. data/docs/CreateSubmissionRequest.md +36 -0
  32. data/docs/CreateTemplateRequest.md +94 -0
  33. data/docs/CreateWebhookRequest.md +38 -0
  34. data/docs/CustomFile.md +11 -3
  35. data/docs/CustomFileList.md +20 -0
  36. data/docs/CustomFileSourcePdf.md +20 -0
  37. data/docs/ErrorCode.md +15 -0
  38. data/docs/ErrorDetail.md +26 -0
  39. data/docs/ErrorInfo.md +32 -0
  40. data/docs/ErrorResponse.md +1 -3
  41. data/docs/ExpirationInterval.md +15 -0
  42. data/docs/FieldComparisonCondition.md +22 -0
  43. data/docs/FieldComparisonOperator.md +15 -0
  44. data/docs/FieldDisplayType.md +15 -0
  45. data/docs/FieldEqualsCondition.md +22 -0
  46. data/docs/FieldEqualsOperator.md +15 -0
  47. data/docs/FieldInCondition.md +22 -0
  48. data/docs/FieldOverride.md +142 -0
  49. data/docs/FieldPresenceCondition.md +20 -0
  50. data/docs/FieldPresenceOperator.md +15 -0
  51. data/docs/FieldRangeCondition.md +24 -0
  52. data/docs/FieldReimportState.md +15 -0
  53. data/docs/FieldSetupLogic.md +15 -0
  54. data/docs/FieldSetupNaming.md +15 -0
  55. data/docs/FieldSetupSource.md +15 -0
  56. data/docs/Folder.md +9 -5
  57. data/docs/FolderList.md +20 -0
  58. data/docs/GeneratedFile.md +32 -0
  59. data/docs/GeneratedFileState.md +15 -0
  60. data/docs/HtmlEngineOptions.md +36 -0
  61. data/docs/HtmlEngineOptionsInput.md +36 -0
  62. data/docs/ImageGravity.md +15 -0
  63. data/docs/ImageScaleType.md +15 -0
  64. data/docs/ModelCodeLanguage.md +15 -0
  65. data/docs/MoveFolderRequest.md +18 -0
  66. data/docs/MoveTemplateRequest.md +18 -0
  67. data/docs/NumberConditionType.md +15 -0
  68. data/docs/PageFormat.md +15 -0
  69. data/docs/PublishTemplateVersionRequest.md +20 -0
  70. data/docs/RenameFolderRequest.md +18 -0
  71. data/docs/RestoreTemplateVersionRequest.md +18 -0
  72. data/docs/ShapeType.md +15 -0
  73. data/docs/SignatureRequest.md +66 -0
  74. data/docs/SignatureRequestAuthSecondFactorType.md +15 -0
  75. data/docs/SignatureRequestAuthType.md +15 -0
  76. data/docs/SignatureRequestEvent.md +32 -0
  77. data/docs/SignatureRequestEventType.md +15 -0
  78. data/docs/SignatureRequestInput.md +46 -0
  79. data/docs/SignatureRequestMessageType.md +15 -0
  80. data/docs/SignatureRequestState.md +15 -0
  81. data/docs/SignatureRequestToken.md +30 -0
  82. data/docs/SignatureRequestTokenType.md +15 -0
  83. data/docs/StringConditionType.md +15 -0
  84. data/docs/Submission.md +41 -47
  85. data/docs/SubmissionAction.md +6 -8
  86. data/docs/SubmissionActionState.md +15 -0
  87. data/docs/SubmissionActionType.md +15 -0
  88. data/docs/SubmissionBatch.md +16 -10
  89. data/docs/SubmissionBatchState.md +15 -0
  90. data/docs/SubmissionFiles.md +22 -0
  91. data/docs/SubmissionInput.md +38 -0
  92. data/docs/SubmissionList.md +20 -0
  93. data/docs/SubmissionSource.md +15 -0
  94. data/docs/SubmissionSourcePdf.md +20 -0
  95. data/docs/SubmissionState.md +15 -0
  96. data/docs/Template.md +73 -107
  97. data/docs/TemplateActor.md +26 -0
  98. data/docs/TemplateActorType.md +15 -0
  99. data/docs/TemplateDefaults.md +56 -0
  100. data/docs/TemplateDefaultsInput.md +56 -0
  101. data/docs/TemplateDocument.md +40 -0
  102. data/docs/TemplateDocumentState.md +15 -0
  103. data/docs/TemplateFieldDependency.md +26 -0
  104. data/docs/TemplateFieldDependencyAction.md +15 -0
  105. data/docs/TemplateFieldDependencyCondition.md +24 -0
  106. data/docs/TemplateFieldDependencyConditionInput.md +93 -0
  107. data/docs/TemplateFieldDependencyInput.md +26 -0
  108. data/docs/TemplateFieldDependencyMatch.md +15 -0
  109. data/docs/TemplateFieldDependencyOperator.md +15 -0
  110. data/docs/TemplateFieldLogicStatus.md +15 -0
  111. data/docs/TemplateFormMode.md +15 -0
  112. data/docs/TemplateModelCode.md +22 -0
  113. data/docs/TemplatePageAiError.md +15 -0
  114. data/docs/TemplatePageAiNamingStatus.md +15 -0
  115. data/docs/TemplatePageFieldsStatus.md +15 -0
  116. data/docs/TemplatePageImageStatus.md +15 -0
  117. data/docs/TemplatePageProcessingStatus.md +26 -0
  118. data/docs/TemplateSourcePdf.md +24 -0
  119. data/docs/TemplateSummary.md +90 -0
  120. data/docs/TemplateSummaryList.md +20 -0
  121. data/docs/TemplateType.md +15 -0
  122. data/docs/TemplateVersion.md +24 -0
  123. data/docs/TemplateVersionType.md +15 -0
  124. data/docs/TextAlignment.md +15 -0
  125. data/docs/TextOverflow.md +15 -0
  126. data/docs/TextVerticalAlignment.md +15 -0
  127. data/docs/Typeface.md +15 -0
  128. data/docs/UpdateSignatureRequestRequest.md +34 -0
  129. data/docs/UpdateTemplateDocumentRequest.md +22 -0
  130. data/docs/UpdateTemplateRequest.md +80 -0
  131. data/docs/UpdateWebhookRequest.md +38 -0
  132. data/docs/UploadMethod.md +15 -0
  133. data/docs/UploadPresign.md +24 -0
  134. data/docs/UrlSourcePdf.md +20 -0
  135. data/docs/Webhook.md +20 -20
  136. data/docs/WebhookEventType.md +15 -0
  137. data/docs/WebhookList.md +20 -0
  138. data/docs/WebhookMode.md +15 -0
  139. data/docspring.gemspec +3 -3
  140. data/lib/docspring/api/client.rb +995 -942
  141. data/lib/docspring/api_client.rb +14 -6
  142. data/lib/docspring/api_error.rb +3 -3
  143. data/lib/docspring/api_model_base.rb +88 -0
  144. data/lib/docspring/configuration.rb +12 -7
  145. data/lib/docspring/models/ai_field_naming_language.rb +42 -0
  146. data/lib/docspring/models/authentication_check.rb +185 -0
  147. data/lib/docspring/models/barcode_symbology.rb +47 -0
  148. data/lib/docspring/models/check_character.rb +44 -0
  149. data/lib/docspring/models/combined_field_type.rb +41 -0
  150. data/lib/docspring/models/{combined_submission.rb → combined_pdf.rb} +228 -206
  151. data/lib/docspring/models/combined_pdf_files.rb +167 -0
  152. data/lib/docspring/models/combined_pdf_list.rb +200 -0
  153. data/lib/docspring/models/{update_webhook_data.rb → combined_pdf_source.rb} +107 -103
  154. data/lib/docspring/models/combined_pdf_source_input.rb +62 -0
  155. data/lib/docspring/models/combined_pdf_source_pdf.rb +212 -0
  156. data/lib/docspring/models/combined_pdf_source_type.rb +44 -0
  157. data/lib/docspring/models/combined_pdf_state.rb +44 -0
  158. data/lib/docspring/models/{copy_template_options.rb → copy_template_request.rb} +32 -87
  159. data/lib/docspring/models/{combine_pdfs_data.rb → create_combined_pdf_request.rb} +60 -123
  160. data/lib/docspring/models/{create_custom_file_data.rb → create_custom_file_from_upload_request.rb} +29 -96
  161. data/lib/docspring/models/{move_template_data.rb → create_folder_request.rb} +60 -102
  162. data/lib/docspring/models/{create_submission_data_request_event_request.rb → create_signature_request_event_request.rb} +50 -122
  163. data/lib/docspring/models/create_signature_request_token_request.rb +190 -0
  164. data/lib/docspring/models/{submission_batch_data.rb → create_submission_batch_request.rb} +53 -108
  165. data/lib/docspring/models/{create_pdf_submission_data.rb → create_submission_request.rb} +97 -149
  166. data/lib/docspring/models/create_template_request.rb +601 -0
  167. data/lib/docspring/models/create_webhook_request.rb +368 -0
  168. data/lib/docspring/models/custom_file.rb +132 -95
  169. data/lib/docspring/models/custom_file_list.rb +200 -0
  170. data/lib/docspring/models/custom_file_source_pdf.rb +212 -0
  171. data/lib/docspring/models/error_code.rb +60 -0
  172. data/lib/docspring/models/error_detail.rb +242 -0
  173. data/lib/docspring/models/error_info.rb +316 -0
  174. data/lib/docspring/models/error_response.rb +28 -138
  175. data/lib/docspring/models/expiration_interval.rb +42 -0
  176. data/lib/docspring/models/field_comparison_condition.rb +247 -0
  177. data/lib/docspring/models/field_comparison_operator.rb +43 -0
  178. data/lib/docspring/models/field_display_type.rb +45 -0
  179. data/lib/docspring/models/field_equals_condition.rb +247 -0
  180. data/lib/docspring/models/field_equals_operator.rb +41 -0
  181. data/lib/docspring/models/{create_folder_data.rb → field_in_condition.rb} +101 -103
  182. data/lib/docspring/models/field_override.rb +829 -0
  183. data/lib/docspring/models/field_presence_condition.rb +234 -0
  184. data/lib/docspring/models/field_presence_operator.rb +41 -0
  185. data/lib/docspring/models/field_range_condition.rb +234 -0
  186. data/lib/docspring/models/field_reimport_state.rb +43 -0
  187. data/lib/docspring/models/field_setup_logic.rb +41 -0
  188. data/lib/docspring/models/field_setup_naming.rb +41 -0
  189. data/lib/docspring/models/field_setup_source.rb +42 -0
  190. data/lib/docspring/models/folder.rb +134 -93
  191. data/lib/docspring/models/folder_list.rb +200 -0
  192. data/lib/docspring/models/generated_file.rb +326 -0
  193. data/lib/docspring/models/generated_file_state.rb +42 -0
  194. data/lib/docspring/models/html_engine_options.rb +416 -0
  195. data/lib/docspring/models/html_engine_options_input.rb +280 -0
  196. data/lib/docspring/models/image_gravity.rb +48 -0
  197. data/lib/docspring/models/image_scale_type.rb +42 -0
  198. data/lib/docspring/models/model_code_language.rb +48 -0
  199. data/lib/docspring/models/{move_folder_data.rb → move_folder_request.rb} +31 -87
  200. data/lib/docspring/models/move_template_request.rb +171 -0
  201. data/lib/docspring/models/number_condition_type.rb +45 -0
  202. data/lib/docspring/models/page_format.rb +52 -0
  203. data/lib/docspring/models/{publish_version_data.rb → publish_template_version_request.rb} +64 -99
  204. data/lib/docspring/models/{rename_folder_data.rb → rename_folder_request.rb} +29 -87
  205. data/lib/docspring/models/{restore_version_data.rb → restore_template_version_request.rb} +29 -87
  206. data/lib/docspring/models/shape_type.rb +45 -0
  207. data/lib/docspring/models/{submission_data_request_show.rb → signature_request.rb} +240 -171
  208. data/lib/docspring/models/signature_request_auth_second_factor_type.rb +45 -0
  209. data/lib/docspring/models/signature_request_auth_type.rb +46 -0
  210. data/lib/docspring/models/{submission_data_request_event.rb → signature_request_event.rb} +137 -122
  211. data/lib/docspring/models/signature_request_event_type.rb +45 -0
  212. data/lib/docspring/models/{update_submission_data_request_data.rb → signature_request_input.rb} +156 -173
  213. data/lib/docspring/models/signature_request_message_type.rb +48 -0
  214. data/lib/docspring/models/signature_request_state.rb +42 -0
  215. data/lib/docspring/models/signature_request_token.rb +369 -0
  216. data/lib/docspring/models/signature_request_token_type.rb +41 -0
  217. data/lib/docspring/models/string_condition_type.rb +44 -0
  218. data/lib/docspring/models/submission.rb +374 -339
  219. data/lib/docspring/models/submission_action.rb +64 -136
  220. data/lib/docspring/models/submission_action_state.rb +43 -0
  221. data/lib/docspring/models/submission_action_type.rb +46 -0
  222. data/lib/docspring/models/submission_batch.rb +157 -112
  223. data/lib/docspring/models/submission_batch_state.rb +42 -0
  224. data/lib/docspring/models/submission_files.rb +188 -0
  225. data/lib/docspring/models/submission_input.rb +274 -0
  226. data/lib/docspring/models/submission_list.rb +200 -0
  227. data/lib/docspring/models/submission_source.rb +43 -0
  228. data/lib/docspring/models/submission_source_pdf.rb +212 -0
  229. data/lib/docspring/models/submission_state.rb +52 -0
  230. data/lib/docspring/models/template.rb +485 -766
  231. data/lib/docspring/models/{add_fields_data.rb → template_actor.rb} +119 -105
  232. data/lib/docspring/models/template_actor_type.rb +42 -0
  233. data/lib/docspring/models/template_defaults.rb +395 -0
  234. data/lib/docspring/models/template_defaults_input.rb +395 -0
  235. data/lib/docspring/models/template_document.rb +396 -0
  236. data/lib/docspring/models/template_document_state.rb +44 -0
  237. data/lib/docspring/models/{success_error_response.rb → template_field_dependency.rb} +122 -114
  238. data/lib/docspring/models/template_field_dependency_action.rb +42 -0
  239. data/lib/docspring/models/{create_pdf_template.rb → template_field_dependency_condition.rb} +116 -103
  240. data/lib/docspring/models/template_field_dependency_condition_input.rb +67 -0
  241. data/lib/docspring/models/template_field_dependency_input.rb +285 -0
  242. data/lib/docspring/models/template_field_dependency_match.rb +41 -0
  243. data/lib/docspring/models/template_field_dependency_operator.rb +49 -0
  244. data/lib/docspring/models/template_field_logic_status.rb +44 -0
  245. data/lib/docspring/models/template_form_mode.rb +42 -0
  246. data/lib/docspring/models/{template_model_code_response.rb → template_model_code.rb} +37 -96
  247. data/lib/docspring/models/template_page_ai_error.rb +43 -0
  248. data/lib/docspring/models/template_page_ai_naming_status.rb +41 -0
  249. data/lib/docspring/models/template_page_fields_status.rb +44 -0
  250. data/lib/docspring/models/template_page_image_status.rb +41 -0
  251. data/lib/docspring/models/template_page_processing_status.rb +275 -0
  252. data/lib/docspring/models/{create_webhook_data.rb → template_source_pdf.rb} +92 -103
  253. data/lib/docspring/models/{template_preview.rb → template_summary.rb} +436 -589
  254. data/lib/docspring/models/template_summary_list.rb +200 -0
  255. data/lib/docspring/models/template_type.rb +41 -0
  256. data/lib/docspring/models/template_version.rb +238 -0
  257. data/lib/docspring/models/template_version_type.rb +42 -0
  258. data/lib/docspring/models/text_alignment.rb +43 -0
  259. data/lib/docspring/models/text_overflow.rb +41 -0
  260. data/lib/docspring/models/text_vertical_alignment.rb +42 -0
  261. data/lib/docspring/models/typeface.rb +56 -0
  262. data/lib/docspring/models/{create_submission_data_request_data.rb → update_signature_request_request.rb} +72 -196
  263. data/lib/docspring/models/update_template_document_request.rb +205 -0
  264. data/lib/docspring/models/update_template_request.rb +514 -0
  265. data/lib/docspring/models/update_webhook_request.rb +344 -0
  266. data/lib/docspring/models/upload_method.rb +40 -0
  267. data/lib/docspring/models/{upload_presign_response.rb → upload_presign.rb} +93 -140
  268. data/lib/docspring/models/url_source_pdf.rb +212 -0
  269. data/lib/docspring/models/webhook.rb +97 -107
  270. data/lib/docspring/models/webhook_event_type.rb +64 -0
  271. data/lib/docspring/models/webhook_list.rb +200 -0
  272. data/lib/docspring/models/webhook_mode.rb +41 -0
  273. data/lib/docspring/request_schemas.json +3187 -0
  274. data/lib/docspring/request_validator.rb +396 -0
  275. data/lib/docspring/version.rb +4 -4
  276. data/lib/docspring.rb +125 -53
  277. data/spec/api/client_spec.rb +304 -277
  278. data/spec/models/ai_field_naming_language_spec.rb +30 -0
  279. data/spec/models/authentication_check_spec.rb +36 -0
  280. data/spec/models/barcode_symbology_spec.rb +30 -0
  281. data/spec/models/check_character_spec.rb +30 -0
  282. data/spec/models/combined_field_type_spec.rb +30 -0
  283. data/spec/models/combined_pdf_files_spec.rb +36 -0
  284. data/spec/models/combined_pdf_list_spec.rb +42 -0
  285. data/spec/models/combined_pdf_source_input_spec.rb +44 -0
  286. data/spec/models/combined_pdf_source_pdf_spec.rb +42 -0
  287. data/spec/models/{submission_data_request_token_spec.rb → combined_pdf_source_spec.rb} +18 -12
  288. data/spec/models/combined_pdf_source_type_spec.rb +30 -0
  289. data/spec/models/{combined_submission_spec.rb → combined_pdf_spec.rb} +20 -24
  290. data/spec/models/combined_pdf_state_spec.rb +30 -0
  291. data/spec/models/{copy_template_options_spec.rb → copy_template_request_spec.rb} +9 -9
  292. data/spec/models/{combine_pdfs_data_spec.rb → create_combined_pdf_request_spec.rb} +12 -18
  293. data/spec/models/{create_custom_file_data_spec.rb → create_custom_file_from_upload_request_spec.rb} +9 -9
  294. data/spec/models/{move_template_data_spec.rb → create_folder_request_spec.rb} +11 -11
  295. data/spec/models/{list_submissions_response_spec.rb → create_signature_request_event_request_spec.rb} +18 -12
  296. data/spec/models/create_signature_request_token_request_spec.rb +36 -0
  297. data/spec/models/{submission_batch_data_spec.rb → create_submission_batch_request_spec.rb} +13 -13
  298. data/spec/models/{create_pdf_submission_data_spec.rb → create_submission_request_spec.rb} +24 -18
  299. data/spec/models/{template_preview_spec.rb → create_template_request_spec.rb} +40 -118
  300. data/spec/models/create_webhook_request_spec.rb +96 -0
  301. data/spec/models/custom_file_list_spec.rb +42 -0
  302. data/spec/models/custom_file_source_pdf_spec.rb +42 -0
  303. data/spec/models/custom_file_spec.rb +29 -5
  304. data/spec/models/error_code_spec.rb +30 -0
  305. data/spec/models/{create_submission_response_spec.rb → error_detail_spec.rb} +14 -18
  306. data/spec/models/{batch_generate_pdfs201_response_spec.rb → error_info_spec.rb} +27 -19
  307. data/spec/models/error_response_spec.rb +4 -14
  308. data/spec/models/expiration_interval_spec.rb +30 -0
  309. data/spec/models/field_comparison_condition_spec.rb +48 -0
  310. data/spec/models/field_comparison_operator_spec.rb +30 -0
  311. data/spec/models/field_display_type_spec.rb +30 -0
  312. data/spec/models/field_equals_condition_spec.rb +48 -0
  313. data/spec/models/field_equals_operator_spec.rb +30 -0
  314. data/spec/models/field_in_condition_spec.rb +48 -0
  315. data/spec/models/field_override_spec.rb +408 -0
  316. data/spec/models/field_presence_condition_spec.rb +42 -0
  317. data/spec/models/field_presence_operator_spec.rb +30 -0
  318. data/spec/models/field_range_condition_spec.rb +54 -0
  319. data/spec/models/field_reimport_state_spec.rb +30 -0
  320. data/spec/models/field_setup_logic_spec.rb +30 -0
  321. data/spec/models/field_setup_naming_spec.rb +30 -0
  322. data/spec/models/field_setup_source_spec.rb +30 -0
  323. data/spec/models/folder_list_spec.rb +42 -0
  324. data/spec/models/folder_spec.rb +16 -4
  325. data/spec/models/generated_file_spec.rb +78 -0
  326. data/spec/models/generated_file_state_spec.rb +30 -0
  327. data/spec/models/html_engine_options_input_spec.rb +90 -0
  328. data/spec/models/html_engine_options_spec.rb +90 -0
  329. data/spec/models/image_gravity_spec.rb +30 -0
  330. data/spec/models/image_scale_type_spec.rb +30 -0
  331. data/spec/models/model_code_language_spec.rb +30 -0
  332. data/spec/models/move_folder_request_spec.rb +36 -0
  333. data/spec/models/move_template_request_spec.rb +36 -0
  334. data/spec/models/number_condition_type_spec.rb +30 -0
  335. data/spec/models/page_format_spec.rb +30 -0
  336. data/spec/models/{publish_version_data_spec.rb → publish_template_version_request_spec.rb} +11 -11
  337. data/spec/models/{rename_folder_data_spec.rb → rename_folder_request_spec.rb} +9 -9
  338. data/spec/models/restore_template_version_request_spec.rb +36 -0
  339. data/spec/models/shape_type_spec.rb +30 -0
  340. data/spec/models/signature_request_auth_second_factor_type_spec.rb +30 -0
  341. data/spec/models/signature_request_auth_type_spec.rb +30 -0
  342. data/spec/models/{submission_data_request_event_spec.rb → signature_request_event_spec.rb} +16 -18
  343. data/spec/models/signature_request_event_type_spec.rb +30 -0
  344. data/spec/models/{create_submission_data_request_data_spec.rb → signature_request_input_spec.rb} +28 -30
  345. data/spec/models/signature_request_message_type_spec.rb +30 -0
  346. data/spec/models/{submission_data_request_show_spec.rb → signature_request_spec.rb} +31 -31
  347. data/spec/models/signature_request_state_spec.rb +30 -0
  348. data/spec/models/signature_request_token_spec.rb +72 -0
  349. data/spec/models/signature_request_token_type_spec.rb +30 -0
  350. data/spec/models/string_condition_type_spec.rb +30 -0
  351. data/spec/models/submission_action_spec.rb +4 -22
  352. data/spec/models/submission_action_state_spec.rb +30 -0
  353. data/spec/models/submission_action_type_spec.rb +30 -0
  354. data/spec/models/submission_batch_spec.rb +27 -13
  355. data/spec/models/submission_batch_state_spec.rb +30 -0
  356. data/spec/models/submission_files_spec.rb +48 -0
  357. data/spec/models/submission_input_spec.rb +96 -0
  358. data/spec/models/submission_list_spec.rb +42 -0
  359. data/spec/models/submission_source_pdf_spec.rb +42 -0
  360. data/spec/models/submission_source_spec.rb +30 -0
  361. data/spec/models/submission_spec.rb +26 -56
  362. data/spec/models/submission_state_spec.rb +30 -0
  363. data/spec/models/template_actor_spec.rb +60 -0
  364. data/spec/models/template_actor_type_spec.rb +30 -0
  365. data/spec/models/{submission_data_request_spec.rb → template_defaults_input_spec.rb} +29 -53
  366. data/spec/models/template_defaults_spec.rb +150 -0
  367. data/spec/models/{json_schema_spec.rb → template_document_spec.rb} +21 -21
  368. data/spec/models/template_document_state_spec.rb +30 -0
  369. data/spec/models/template_field_dependency_action_spec.rb +30 -0
  370. data/spec/models/template_field_dependency_condition_input_spec.rb +44 -0
  371. data/spec/models/template_field_dependency_condition_spec.rb +54 -0
  372. data/spec/models/template_field_dependency_input_spec.rb +60 -0
  373. data/spec/models/template_field_dependency_match_spec.rb +30 -0
  374. data/spec/models/template_field_dependency_operator_spec.rb +30 -0
  375. data/spec/models/template_field_dependency_spec.rb +60 -0
  376. data/spec/models/template_field_logic_status_spec.rb +30 -0
  377. data/spec/models/template_form_mode_spec.rb +30 -0
  378. data/spec/models/{template_model_code_response_spec.rb → template_model_code_spec.rb} +9 -13
  379. data/spec/models/template_page_ai_error_spec.rb +30 -0
  380. data/spec/models/template_page_ai_naming_status_spec.rb +30 -0
  381. data/spec/models/template_page_fields_status_spec.rb +30 -0
  382. data/spec/models/template_page_image_status_spec.rb +30 -0
  383. data/spec/models/template_page_processing_status_spec.rb +60 -0
  384. data/spec/models/template_source_pdf_spec.rb +54 -0
  385. data/spec/models/template_spec.rb +40 -154
  386. data/spec/models/template_summary_list_spec.rb +42 -0
  387. data/spec/models/template_summary_spec.rb +252 -0
  388. data/spec/models/template_type_spec.rb +30 -0
  389. data/spec/models/template_version_spec.rb +54 -0
  390. data/spec/models/template_version_type_spec.rb +30 -0
  391. data/spec/models/text_alignment_spec.rb +30 -0
  392. data/spec/models/text_overflow_spec.rb +30 -0
  393. data/spec/models/text_vertical_alignment_spec.rb +30 -0
  394. data/spec/models/typeface_spec.rb +30 -0
  395. data/spec/models/{submission_batch_with_submissions_spec.rb → update_signature_request_request_spec.rb} +18 -22
  396. data/spec/models/update_template_document_request_spec.rb +48 -0
  397. data/spec/models/{submission_preview_spec.rb → update_template_request_spec.rb} +81 -41
  398. data/spec/models/update_webhook_request_spec.rb +96 -0
  399. data/spec/models/upload_method_spec.rb +30 -0
  400. data/spec/models/{upload_presign_response_spec.rb → upload_presign_spec.rb} +13 -17
  401. data/spec/models/url_source_pdf_spec.rb +42 -0
  402. data/spec/models/webhook_event_type_spec.rb +30 -0
  403. data/spec/models/webhook_list_spec.rb +42 -0
  404. data/spec/models/webhook_mode_spec.rb +30 -0
  405. data/spec/models/webhook_spec.rb +4 -8
  406. data/spec/spec_helper.rb +3 -3
  407. metadata +485 -202
  408. data/docs/AddFieldsData.md +0 -18
  409. data/docs/BatchGeneratePdfs201Response.md +0 -28
  410. data/docs/CombinePdfsData.md +0 -28
  411. data/docs/CombinedSubmission.md +0 -44
  412. data/docs/CombinedSubmissionAction.md +0 -30
  413. data/docs/CopyTemplateOptions.md +0 -22
  414. data/docs/CreateCombinedSubmissionResponse.md +0 -26
  415. data/docs/CreateCustomFileData.md +0 -18
  416. data/docs/CreateCustomFileResponse.md +0 -24
  417. data/docs/CreateHtmlTemplate.md +0 -18
  418. data/docs/CreatePdfSubmissionData.md +0 -34
  419. data/docs/CreatePdfTemplate.md +0 -18
  420. data/docs/CreateSubmissionDataRequestData.md +0 -44
  421. data/docs/CreateSubmissionDataRequestEventRequest.md +0 -24
  422. data/docs/CreateSubmissionDataRequestEventResponse.md +0 -24
  423. data/docs/CreateSubmissionDataRequestResponse.md +0 -24
  424. data/docs/CreateSubmissionDataRequestTokenResponse.md +0 -24
  425. data/docs/CreateSubmissionResponse.md +0 -26
  426. data/docs/ErrorOrMultipleErrorsResponse.md +0 -22
  427. data/docs/ForbiddenErrorResponse.md +0 -22
  428. data/docs/JsonSchema.md +0 -40
  429. data/docs/ListSubmissionsResponse.md +0 -22
  430. data/docs/MoveFolderData.md +0 -18
  431. data/docs/MoveTemplateData.md +0 -20
  432. data/docs/MultipleErrorsResponse.md +0 -20
  433. data/docs/PublishVersionData.md +0 -20
  434. data/docs/RestoreVersionData.md +0 -18
  435. data/docs/Submission422Response.md +0 -24
  436. data/docs/SubmissionBatchData.md +0 -26
  437. data/docs/SubmissionBatchWithSubmissions.md +0 -34
  438. data/docs/SubmissionDataRequest.md +0 -60
  439. data/docs/SubmissionDataRequestEvent.md +0 -30
  440. data/docs/SubmissionDataRequestShow.md +0 -62
  441. data/docs/SubmissionDataRequestToken.md +0 -24
  442. data/docs/SubmissionPreview.md +0 -64
  443. data/docs/SuccessErrorResponse.md +0 -20
  444. data/docs/SuccessMultipleErrorsResponse.md +0 -20
  445. data/docs/TemplateAddFieldsResponse.md +0 -22
  446. data/docs/TemplateDeleteResponse.md +0 -24
  447. data/docs/TemplateModelCodeResponse.md +0 -22
  448. data/docs/TemplatePreview.md +0 -116
  449. data/docs/TemplatePublishVersionResponse.md +0 -22
  450. data/docs/UpdateHtmlTemplate.md +0 -18
  451. data/docs/UpdatePdfTemplate.md +0 -18
  452. data/docs/UpdateSubmissionDataRequestData.md +0 -42
  453. data/docs/UploadPresignResponse.md +0 -24
  454. data/lib/docspring/models/batch_generate_pdfs201_response.rb +0 -352
  455. data/lib/docspring/models/combined_submission_action.rb +0 -384
  456. data/lib/docspring/models/create_combined_submission_response.rb +0 -324
  457. data/lib/docspring/models/create_custom_file_response.rb +0 -314
  458. data/lib/docspring/models/create_html_template.rb +0 -243
  459. data/lib/docspring/models/create_submission_data_request_event_response.rb +0 -314
  460. data/lib/docspring/models/create_submission_data_request_response.rb +0 -314
  461. data/lib/docspring/models/create_submission_data_request_token_response.rb +0 -314
  462. data/lib/docspring/models/create_submission_response.rb +0 -324
  463. data/lib/docspring/models/error_or_multiple_errors_response.rb +0 -290
  464. data/lib/docspring/models/forbidden_error_response.rb +0 -323
  465. data/lib/docspring/models/json_schema.rb +0 -329
  466. data/lib/docspring/models/list_submissions_response.rb +0 -283
  467. data/lib/docspring/models/multiple_errors_response.rb +0 -296
  468. data/lib/docspring/models/submission422_response.rb +0 -299
  469. data/lib/docspring/models/submission_batch_with_submissions.rb +0 -433
  470. data/lib/docspring/models/submission_data_request.rb +0 -570
  471. data/lib/docspring/models/submission_data_request_token.rb +0 -279
  472. data/lib/docspring/models/submission_preview.rb +0 -637
  473. data/lib/docspring/models/success_multiple_errors_response.rb +0 -279
  474. data/lib/docspring/models/template_add_fields_response.rb +0 -290
  475. data/lib/docspring/models/template_delete_response.rb +0 -300
  476. data/lib/docspring/models/template_publish_version_response.rb +0 -305
  477. data/lib/docspring/models/update_html_template.rb +0 -243
  478. data/lib/docspring/models/update_pdf_template.rb +0 -243
  479. data/spec/models/add_fields_data_spec.rb +0 -36
  480. data/spec/models/combined_submission_action_spec.rb +0 -84
  481. data/spec/models/create_combined_submission_response_spec.rb +0 -64
  482. data/spec/models/create_custom_file_response_spec.rb +0 -58
  483. data/spec/models/create_folder_data_spec.rb +0 -36
  484. data/spec/models/create_html_template_spec.rb +0 -36
  485. data/spec/models/create_pdf_template_spec.rb +0 -36
  486. data/spec/models/create_submission_data_request_event_request_spec.rb +0 -62
  487. data/spec/models/create_submission_data_request_event_response_spec.rb +0 -58
  488. data/spec/models/create_submission_data_request_response_spec.rb +0 -58
  489. data/spec/models/create_submission_data_request_token_response_spec.rb +0 -58
  490. data/spec/models/create_webhook_data_spec.rb +0 -36
  491. data/spec/models/error_or_multiple_errors_response_spec.rb +0 -52
  492. data/spec/models/forbidden_error_response_spec.rb +0 -56
  493. data/spec/models/move_folder_data_spec.rb +0 -36
  494. data/spec/models/multiple_errors_response_spec.rb +0 -46
  495. data/spec/models/restore_version_data_spec.rb +0 -36
  496. data/spec/models/submission422_response_spec.rb +0 -58
  497. data/spec/models/success_error_response_spec.rb +0 -46
  498. data/spec/models/success_multiple_errors_response_spec.rb +0 -46
  499. data/spec/models/template_add_fields_response_spec.rb +0 -52
  500. data/spec/models/template_delete_response_spec.rb +0 -58
  501. data/spec/models/template_publish_version_response_spec.rb +0 -52
  502. data/spec/models/update_html_template_spec.rb +0 -36
  503. data/spec/models/update_pdf_template_spec.rb +0 -36
  504. data/spec/models/update_submission_data_request_data_spec.rb +0 -116
  505. data/spec/models/update_webhook_data_spec.rb +0 -36
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #DocSpring API
3
3
 
4
- #Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
4
+ #Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
5
5
 
6
- The version of the OpenAPI document: v1
6
+ The version of the OpenAPI document: v2
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.16.0-DOCSPRING
9
+ Generator version: 7.26.0-DOCSPRING
10
10
 
11
11
  =end
12
12
 
@@ -20,16 +20,21 @@ module DocSpring
20
20
  if api_client
21
21
  @api_client = api_client
22
22
  else
23
- @api_client = ApiClient.default
23
+ # A client given credentials, a host or a region gets its own ApiClient (with a copy of the default
24
+ # configuration), so two clients don't change each other's. Without them it uses the shared ApiClient.default.
25
+ @api_client = if [api_token_id, api_token_secret, host, region].all?(&:nil?)
26
+ ApiClient.default
27
+ else
28
+ ApiClient.new(Configuration.default.dup)
29
+ end
24
30
 
25
- # Use provided credentials or fall back to ENV variables
26
- token_id = api_token_id || ENV.fetch('DOCSPRING_TOKEN_ID', nil)
27
- token_secret = api_token_secret || ENV.fetch('DOCSPRING_TOKEN_SECRET', nil)
31
+ # Use the credentials passed in, or the environment variables. An empty string counts as not set.
32
+ token_id = [api_token_id, ENV.fetch('DOCSPRING_TOKEN_ID', nil)].find { |value| !value.to_s.empty? }
33
+ token_secret = [api_token_secret, ENV.fetch('DOCSPRING_TOKEN_SECRET', nil)].find { |value| !value.to_s.empty? }
28
34
 
29
- if token_id && token_secret
30
- @api_client.config.username = token_id
31
- @api_client.config.password = token_secret
32
- end
35
+ # Without credentials the client is still created, and the API's 401 response says what's missing
36
+ @api_client.config.username = token_id if token_id
37
+ @api_client.config.password = token_secret if token_secret
33
38
 
34
39
  # Resolve host from argument, DOCSPRING_HOST, or DOCSPRING_REGION (US/EU)
35
40
  resolved_host = (host || ENV.fetch('DOCSPRING_HOST', nil)).to_s.strip
@@ -54,43 +59,40 @@ module DocSpring
54
59
  h = match.post_match
55
60
  end
56
61
  @api_client.config.scheme = scheme
57
- # base_path remains '/api/v1'
58
- @api_client.config.host = h.sub(%r{/+\z}, '').sub(%r{/api/v1\z}i, '')
62
+ # The generated base_path adds /api/v2. Any API version's path on the host (such as /api/v1 from a 3.x setup) is
63
+ # dropped.
64
+ @api_client.config.host = h.sub(%r{/+\z}, '').sub(%r{/api/v\d+\z}i, '')
59
65
  end
60
66
  end
61
67
  end
62
68
 
63
- # Add new fields to a Template
64
- # Adds fields to a PDF template. Configure field types, positions, defaults, and formatting options.
65
- # @param template_id [String]
66
- # @param data [AddFieldsData]
69
+ # Copy a template
70
+ # Copies a template (its draft, or a published version) into a new template.
71
+ # @param template_id [String] The template's ID.
67
72
  # @param [Hash] opts the optional parameters
68
- # @return [TemplateAddFieldsResponse]
69
- def add_fields_to_template(template_id, data, opts = {})
70
- data, _status_code, _headers = add_fields_to_template_with_http_info(template_id, data, opts)
73
+ # @option opts [CopyTemplateRequest] :body Settings for the copy.
74
+ # @return [Template]
75
+ def copy_template(template_id, opts = {})
76
+ data, _status_code, _headers = copy_template_with_http_info(template_id, opts)
71
77
  data
72
78
  end
73
79
 
74
- # Add new fields to a Template
75
- # Adds fields to a PDF template. Configure field types, positions, defaults, and formatting options.
76
- # @param template_id [String]
77
- # @param data [AddFieldsData]
80
+ # Copy a template
81
+ # Copies a template (its draft, or a published version) into a new template.
82
+ # @param template_id [String] The template's ID.
78
83
  # @param [Hash] opts the optional parameters
79
- # @return [Array<(TemplateAddFieldsResponse, Integer, Hash)>] TemplateAddFieldsResponse data, response status code and response headers
80
- def add_fields_to_template_with_http_info(template_id, data, opts = {})
84
+ # @option opts [CopyTemplateRequest] :body Settings for the copy.
85
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
86
+ def copy_template_with_http_info(template_id, opts = {})
81
87
  if @api_client.config.debugging
82
- @api_client.config.logger.debug 'Calling API: Client.add_fields_to_template ...'
88
+ @api_client.config.logger.debug 'Calling API: Client.copy_template ...'
83
89
  end
84
90
  # verify the required parameter 'template_id' is set
85
91
  if @api_client.config.client_side_validation && template_id.nil?
86
- fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.add_fields_to_template"
87
- end
88
- # verify the required parameter 'data' is set
89
- if @api_client.config.client_side_validation && data.nil?
90
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.add_fields_to_template"
92
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.copy_template"
91
93
  end
92
94
  # resource path
93
- local_var_path = '/templates/{template_id}/add_fields'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
95
+ local_var_path = '/templates/{template_id}/copy'.sub('{template_id}', CGI.escape(template_id.to_s))
94
96
 
95
97
  # query parameters
96
98
  query_params = opts[:query_params] || {}
@@ -109,16 +111,16 @@ end
109
111
  form_params = opts[:form_params] || {}
110
112
 
111
113
  # http body (model)
112
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
114
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
113
115
 
114
116
  # return_type
115
- return_type = opts[:debug_return_type] || 'TemplateAddFieldsResponse'
117
+ return_type = opts[:debug_return_type] || 'Template'
116
118
 
117
119
  # auth_names
118
120
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
119
121
 
120
122
  new_options = opts.merge(
121
- :operation => :"Client.add_fields_to_template",
123
+ :operation => :"Client.copy_template",
122
124
  :header_params => header_params,
123
125
  :query_params => query_params,
124
126
  :form_params => form_params,
@@ -127,40 +129,40 @@ end
127
129
  :return_type => return_type
128
130
  )
129
131
 
130
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
132
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
131
133
  if @api_client.config.debugging
132
- @api_client.config.logger.debug "API called: Client#add_fields_to_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
134
+ @api_client.config.logger.debug "API called: Client#copy_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
133
135
  end
134
136
  return data, status_code, headers
135
137
  end
136
138
 
137
- # Generate multiple PDFs
138
- # Generates up to 50 PDFs in a single request. Each submission can use a different template and data. Supports both synchronous (wait for all PDFs) and asynchronous processing. More efficient than individual requests when creating multiple PDFs. Live PDFs use credits. If any live submission is waiting for credits, the API returns 402 and the others are still processed: check each submission's `state`. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/). See also: - [Batch Generate PDFs](https://docspring.com/docs/api-guide/generate-pdfs/batch-generate-pdfs/) - Request format, responses, and limits
139
- # @param data [SubmissionBatchData]
139
+ # Combine PDFs
140
+ # Merges PDFs into one: submissions, other combined PDFs, templates, custom files (POST /custom_files) and PDFs from URLs, in the order of `source_pdfs`. The PDF is generated in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /combined_pdfs/{combined_pdf_id} until `state` isn't `pending`. A template source merges the template's processed PDF by default: the PDF submissions are filled in on, decrypted and with its form fields removed. Pass `processed: false` to merge the PDF as it was uploaded.
141
+ # @param body [CreateCombinedPdfRequest] The PDFs to merge, and the combined PDF's settings.
140
142
  # @param [Hash] opts the optional parameters
141
- # @option opts [Boolean] :wait Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (default to true)
142
- # @return [BatchGeneratePdfs201Response]
143
- def batch_generate_pdfs(data, opts = {})
144
- data, _status_code, _headers = batch_generate_pdfs_with_http_info(data, opts)
143
+ # @option opts [Boolean] :wait Wait until the PDF has been generated before responding. Default true on sync.api hosts.
144
+ # @return [CombinedPdf]
145
+ def create_combined_pdf(body, opts = {})
146
+ data, _status_code, _headers = create_combined_pdf_with_http_info(body, opts)
145
147
  data
146
148
  end
147
149
 
148
- # Generate multiple PDFs
149
- # Generates up to 50 PDFs in a single request. Each submission can use a different template and data. Supports both synchronous (wait for all PDFs) and asynchronous processing. More efficient than individual requests when creating multiple PDFs. Live PDFs use credits. If any live submission is waiting for credits, the API returns 402 and the others are still processed: check each submission&#39;s &#x60;state&#x60;. See [Credits &amp; Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/). See also: - [Batch Generate PDFs](https://docspring.com/docs/api-guide/generate-pdfs/batch-generate-pdfs/) - Request format, responses, and limits
150
- # @param data [SubmissionBatchData]
150
+ # Combine PDFs
151
+ # Merges PDFs into one: submissions, other combined PDFs, templates, custom files (POST /custom_files) and PDFs from URLs, in the order of `source_pdfs`. The PDF is generated in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /combined_pdfs/{combined_pdf_id} until `state` isn't `pending`. A template source merges the template's processed PDF by default: the PDF submissions are filled in on, decrypted and with its form fields removed. Pass `processed: false` to merge the PDF as it was uploaded.
152
+ # @param body [CreateCombinedPdfRequest] The PDFs to merge, and the combined PDF's settings.
151
153
  # @param [Hash] opts the optional parameters
152
- # @option opts [Boolean] :wait Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (default to true)
153
- # @return [Array<(BatchGeneratePdfs201Response, Integer, Hash)>] BatchGeneratePdfs201Response data, response status code and response headers
154
- def batch_generate_pdfs_with_http_info(data, opts = {})
154
+ # @option opts [Boolean] :wait Wait until the PDF has been generated before responding. Default true on sync.api hosts.
155
+ # @return [Array<(CombinedPdf, Integer, Hash)>] CombinedPdf data, response status code and response headers
156
+ def create_combined_pdf_with_http_info(body, opts = {})
155
157
  if @api_client.config.debugging
156
- @api_client.config.logger.debug 'Calling API: Client.batch_generate_pdfs ...'
158
+ @api_client.config.logger.debug 'Calling API: Client.create_combined_pdf ...'
157
159
  end
158
- # verify the required parameter 'data' is set
159
- if @api_client.config.client_side_validation && data.nil?
160
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.batch_generate_pdfs"
160
+ # verify the required parameter 'body' is set
161
+ if @api_client.config.client_side_validation && body.nil?
162
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.create_combined_pdf"
161
163
  end
162
164
  # resource path
163
- local_var_path = '/submissions/batches'
165
+ local_var_path = '/combined_pdfs'
164
166
 
165
167
  # query parameters
166
168
  query_params = opts[:query_params] || {}
@@ -180,16 +182,16 @@ end
180
182
  form_params = opts[:form_params] || {}
181
183
 
182
184
  # http body (model)
183
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
185
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
184
186
 
185
187
  # return_type
186
- return_type = opts[:debug_return_type] || 'BatchGeneratePdfs201Response'
188
+ return_type = opts[:debug_return_type] || 'CombinedPdf'
187
189
 
188
190
  # auth_names
189
191
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
190
192
 
191
193
  new_options = opts.merge(
192
- :operation => :"Client.batch_generate_pdfs",
194
+ :operation => :"Client.create_combined_pdf",
193
195
  :header_params => header_params,
194
196
  :query_params => query_params,
195
197
  :form_params => form_params,
@@ -200,36 +202,36 @@ end
200
202
 
201
203
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
202
204
  if @api_client.config.debugging
203
- @api_client.config.logger.debug "API called: Client#batch_generate_pdfs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
205
+ @api_client.config.logger.debug "API called: Client#create_combined_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
204
206
  end
205
207
  return data, status_code, headers
206
208
  end
207
209
 
208
- # Merge submission PDFs, template PDFs, or custom files
209
- # Combines multiple PDFs from various sources into a single PDF file. Supports merging submission PDFs, template PDFs, custom files, other merged PDFs, and PDFs from URLs. Merges the PDFs in the order provided. Combining uses credits (4 per source PDF, plus 4 per unit of the combined PDF), even with a test API token or watermarked source PDFs. If your balance can't cover it, the API returns 402 and the combined submission waits in the `insufficient_credits` state until you add credits. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
210
- # @param data [CombinePdfsData]
210
+ # Create a custom file from an upload
211
+ # Creates a custom file from a PDF you uploaded, so you can merge it with other PDFs. Upload the file with the presigned upload (GET /uploads/presign) first, then pass its `fields.key` as `cache_id`.
212
+ # @param body [CreateCustomFileFromUploadRequest] The uploaded file to create the custom file from.
211
213
  # @param [Hash] opts the optional parameters
212
- # @return [CreateCombinedSubmissionResponse]
213
- def combine_pdfs(data, opts = {})
214
- data, _status_code, _headers = combine_pdfs_with_http_info(data, opts)
214
+ # @return [CustomFile]
215
+ def create_custom_file_from_upload(body, opts = {})
216
+ data, _status_code, _headers = create_custom_file_from_upload_with_http_info(body, opts)
215
217
  data
216
218
  end
217
219
 
218
- # Merge submission PDFs, template PDFs, or custom files
219
- # Combines multiple PDFs from various sources into a single PDF file. Supports merging submission PDFs, template PDFs, custom files, other merged PDFs, and PDFs from URLs. Merges the PDFs in the order provided. Combining uses credits (4 per source PDF, plus 4 per unit of the combined PDF), even with a test API token or watermarked source PDFs. If your balance can&#39;t cover it, the API returns 402 and the combined submission waits in the &#x60;insufficient_credits&#x60; state until you add credits. See [Credits &amp; Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
220
- # @param data [CombinePdfsData]
220
+ # Create a custom file from an upload
221
+ # Creates a custom file from a PDF you uploaded, so you can merge it with other PDFs. Upload the file with the presigned upload (GET /uploads/presign) first, then pass its `fields.key` as `cache_id`.
222
+ # @param body [CreateCustomFileFromUploadRequest] The uploaded file to create the custom file from.
221
223
  # @param [Hash] opts the optional parameters
222
- # @return [Array<(CreateCombinedSubmissionResponse, Integer, Hash)>] CreateCombinedSubmissionResponse data, response status code and response headers
223
- def combine_pdfs_with_http_info(data, opts = {})
224
+ # @return [Array<(CustomFile, Integer, Hash)>] CustomFile data, response status code and response headers
225
+ def create_custom_file_from_upload_with_http_info(body, opts = {})
224
226
  if @api_client.config.debugging
225
- @api_client.config.logger.debug 'Calling API: Client.combine_pdfs ...'
227
+ @api_client.config.logger.debug 'Calling API: Client.create_custom_file_from_upload ...'
226
228
  end
227
- # verify the required parameter 'data' is set
228
- if @api_client.config.client_side_validation && data.nil?
229
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.combine_pdfs"
229
+ # verify the required parameter 'body' is set
230
+ if @api_client.config.client_side_validation && body.nil?
231
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.create_custom_file_from_upload"
230
232
  end
231
233
  # resource path
232
- local_var_path = '/combined_submissions'
234
+ local_var_path = '/custom_files'
233
235
 
234
236
  # query parameters
235
237
  query_params = opts[:query_params] || {}
@@ -248,16 +250,16 @@ end
248
250
  form_params = opts[:form_params] || {}
249
251
 
250
252
  # http body (model)
251
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
253
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
252
254
 
253
255
  # return_type
254
- return_type = opts[:debug_return_type] || 'CreateCombinedSubmissionResponse'
256
+ return_type = opts[:debug_return_type] || 'CustomFile'
255
257
 
256
258
  # auth_names
257
259
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
258
260
 
259
261
  new_options = opts.merge(
260
- :operation => :"Client.combine_pdfs",
262
+ :operation => :"Client.create_custom_file_from_upload",
261
263
  :header_params => header_params,
262
264
  :query_params => query_params,
263
265
  :form_params => form_params,
@@ -268,38 +270,36 @@ end
268
270
 
269
271
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
270
272
  if @api_client.config.debugging
271
- @api_client.config.logger.debug "API called: Client#combine_pdfs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
273
+ @api_client.config.logger.debug "API called: Client#create_custom_file_from_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
272
274
  end
273
275
  return data, status_code, headers
274
276
  end
275
277
 
276
- # Copy a template
277
- # Creates a copy of an existing template with all its fields and configuration. Optionally specify a new name and target folder. The copied template starts as a new draft that can be modified independently of the original.
278
- # @param template_id [String]
278
+ # Create a folder
279
+ # Creates a folder for organizing templates. Pass `parent_folder_id` to create it inside another folder. Folder names are unique within their parent folder.
280
+ # @param body [CreateFolderRequest] The folder to create.
279
281
  # @param [Hash] opts the optional parameters
280
- # @option opts [CopyTemplateOptions] :options
281
- # @return [TemplatePreview]
282
- def copy_template(template_id, opts = {})
283
- data, _status_code, _headers = copy_template_with_http_info(template_id, opts)
282
+ # @return [Folder]
283
+ def create_folder(body, opts = {})
284
+ data, _status_code, _headers = create_folder_with_http_info(body, opts)
284
285
  data
285
286
  end
286
287
 
287
- # Copy a template
288
- # Creates a copy of an existing template with all its fields and configuration. Optionally specify a new name and target folder. The copied template starts as a new draft that can be modified independently of the original.
289
- # @param template_id [String]
288
+ # Create a folder
289
+ # Creates a folder for organizing templates. Pass `parent_folder_id` to create it inside another folder. Folder names are unique within their parent folder.
290
+ # @param body [CreateFolderRequest] The folder to create.
290
291
  # @param [Hash] opts the optional parameters
291
- # @option opts [CopyTemplateOptions] :options
292
- # @return [Array<(TemplatePreview, Integer, Hash)>] TemplatePreview data, response status code and response headers
293
- def copy_template_with_http_info(template_id, opts = {})
292
+ # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers
293
+ def create_folder_with_http_info(body, opts = {})
294
294
  if @api_client.config.debugging
295
- @api_client.config.logger.debug 'Calling API: Client.copy_template ...'
295
+ @api_client.config.logger.debug 'Calling API: Client.create_folder ...'
296
296
  end
297
- # verify the required parameter 'template_id' is set
298
- if @api_client.config.client_side_validation && template_id.nil?
299
- fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.copy_template"
297
+ # verify the required parameter 'body' is set
298
+ if @api_client.config.client_side_validation && body.nil?
299
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.create_folder"
300
300
  end
301
301
  # resource path
302
- local_var_path = '/templates/{template_id}/copy'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
302
+ local_var_path = '/folders'
303
303
 
304
304
  # query parameters
305
305
  query_params = opts[:query_params] || {}
@@ -318,16 +318,16 @@ end
318
318
  form_params = opts[:form_params] || {}
319
319
 
320
320
  # http body (model)
321
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'options'])
321
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
322
322
 
323
323
  # return_type
324
- return_type = opts[:debug_return_type] || 'TemplatePreview'
324
+ return_type = opts[:debug_return_type] || 'Folder'
325
325
 
326
326
  # auth_names
327
327
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
328
328
 
329
329
  new_options = opts.merge(
330
- :operation => :"Client.copy_template",
330
+ :operation => :"Client.create_folder",
331
331
  :header_params => header_params,
332
332
  :query_params => query_params,
333
333
  :form_params => form_params,
@@ -338,36 +338,42 @@ end
338
338
 
339
339
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
340
340
  if @api_client.config.debugging
341
- @api_client.config.logger.debug "API called: Client#copy_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
341
+ @api_client.config.logger.debug "API called: Client#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
342
342
  end
343
343
  return data, status_code, headers
344
344
  end
345
345
 
346
- # Create a new custom file from a cached S3 upload
347
- # The Custom Files API endpoint allows you to upload PDFs to DocSpring and then merge them with other PDFs. First upload your file using the presigned URL endpoint, then use the returned cache_id to create the custom file.
348
- # @param data [CreateCustomFileData]
346
+ # Record a signature request event
347
+ # Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account.
348
+ # @param signature_request_id [String] The signature request's ID.
349
+ # @param body [CreateSignatureRequestEventRequest] The event to record.
349
350
  # @param [Hash] opts the optional parameters
350
- # @return [CreateCustomFileResponse]
351
- def create_custom_file_from_upload(data, opts = {})
352
- data, _status_code, _headers = create_custom_file_from_upload_with_http_info(data, opts)
351
+ # @return [SignatureRequestEvent]
352
+ def create_signature_request_event(signature_request_id, body, opts = {})
353
+ data, _status_code, _headers = create_signature_request_event_with_http_info(signature_request_id, body, opts)
353
354
  data
354
355
  end
355
356
 
356
- # Create a new custom file from a cached S3 upload
357
- # The Custom Files API endpoint allows you to upload PDFs to DocSpring and then merge them with other PDFs. First upload your file using the presigned URL endpoint, then use the returned cache_id to create the custom file.
358
- # @param data [CreateCustomFileData]
357
+ # Record a signature request event
358
+ # Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account.
359
+ # @param signature_request_id [String] The signature request's ID.
360
+ # @param body [CreateSignatureRequestEventRequest] The event to record.
359
361
  # @param [Hash] opts the optional parameters
360
- # @return [Array<(CreateCustomFileResponse, Integer, Hash)>] CreateCustomFileResponse data, response status code and response headers
361
- def create_custom_file_from_upload_with_http_info(data, opts = {})
362
+ # @return [Array<(SignatureRequestEvent, Integer, Hash)>] SignatureRequestEvent data, response status code and response headers
363
+ def create_signature_request_event_with_http_info(signature_request_id, body, opts = {})
362
364
  if @api_client.config.debugging
363
- @api_client.config.logger.debug 'Calling API: Client.create_custom_file_from_upload ...'
365
+ @api_client.config.logger.debug 'Calling API: Client.create_signature_request_event ...'
364
366
  end
365
- # verify the required parameter 'data' is set
366
- if @api_client.config.client_side_validation && data.nil?
367
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.create_custom_file_from_upload"
367
+ # verify the required parameter 'signature_request_id' is set
368
+ if @api_client.config.client_side_validation && signature_request_id.nil?
369
+ fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling Client.create_signature_request_event"
370
+ end
371
+ # verify the required parameter 'body' is set
372
+ if @api_client.config.client_side_validation && body.nil?
373
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.create_signature_request_event"
368
374
  end
369
375
  # resource path
370
- local_var_path = '/custom_files'
376
+ local_var_path = '/signature_requests/{signature_request_id}/events'.sub('{signature_request_id}', CGI.escape(signature_request_id.to_s))
371
377
 
372
378
  # query parameters
373
379
  query_params = opts[:query_params] || {}
@@ -386,16 +392,16 @@ end
386
392
  form_params = opts[:form_params] || {}
387
393
 
388
394
  # http body (model)
389
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
395
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
390
396
 
391
397
  # return_type
392
- return_type = opts[:debug_return_type] || 'CreateCustomFileResponse'
398
+ return_type = opts[:debug_return_type] || 'SignatureRequestEvent'
393
399
 
394
400
  # auth_names
395
401
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
396
402
 
397
403
  new_options = opts.merge(
398
- :operation => :"Client.create_custom_file_from_upload",
404
+ :operation => :"Client.create_signature_request_event",
399
405
  :header_params => header_params,
400
406
  :query_params => query_params,
401
407
  :form_params => form_params,
@@ -406,42 +412,38 @@ end
406
412
 
407
413
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
408
414
  if @api_client.config.debugging
409
- @api_client.config.logger.debug "API called: Client#create_custom_file_from_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
415
+ @api_client.config.logger.debug "API called: Client#create_signature_request_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
410
416
  end
411
417
  return data, status_code, headers
412
418
  end
413
419
 
414
- # Create a new event for emailing a signee a request for signature
415
- # Records user notification events for data requests. Use this to create an audit trail showing when and how users were notified about data request forms. Supports email, SMS, and other notification types. Records the notification time for compliance tracking. See also: - [Embedded Data Requests Guide](https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/) - User notification workflow
416
- # @param data_request_id [String]
417
- # @param event [CreateSubmissionDataRequestEventRequest]
420
+ # Create a signature request token
421
+ # Creates a token that opens the signature request without signing in, in a form embedded in your app or from a link you send. The response is the only time the token's secret is returned. The link works for 24 hours, or 7 days for an `email` token, and a signing page that opened in time keeps working for 7 more days. A test API token can't create a token for a live signature request.
422
+ # @param signature_request_id [String] The signature request's ID.
418
423
  # @param [Hash] opts the optional parameters
419
- # @return [CreateSubmissionDataRequestEventResponse]
420
- def create_data_request_event(data_request_id, event, opts = {})
421
- data, _status_code, _headers = create_data_request_event_with_http_info(data_request_id, event, opts)
424
+ # @option opts [CreateSignatureRequestTokenRequest] :body The kind of link to make. Send no body for an `api` token.
425
+ # @return [SignatureRequestToken]
426
+ def create_signature_request_token(signature_request_id, opts = {})
427
+ data, _status_code, _headers = create_signature_request_token_with_http_info(signature_request_id, opts)
422
428
  data
423
429
  end
424
430
 
425
- # Create a new event for emailing a signee a request for signature
426
- # Records user notification events for data requests. Use this to create an audit trail showing when and how users were notified about data request forms. Supports email, SMS, and other notification types. Records the notification time for compliance tracking. See also: - [Embedded Data Requests Guide](https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/) - User notification workflow
427
- # @param data_request_id [String]
428
- # @param event [CreateSubmissionDataRequestEventRequest]
431
+ # Create a signature request token
432
+ # Creates a token that opens the signature request without signing in, in a form embedded in your app or from a link you send. The response is the only time the token's secret is returned. The link works for 24 hours, or 7 days for an `email` token, and a signing page that opened in time keeps working for 7 more days. A test API token can't create a token for a live signature request.
433
+ # @param signature_request_id [String] The signature request's ID.
429
434
  # @param [Hash] opts the optional parameters
430
- # @return [Array<(CreateSubmissionDataRequestEventResponse, Integer, Hash)>] CreateSubmissionDataRequestEventResponse data, response status code and response headers
431
- def create_data_request_event_with_http_info(data_request_id, event, opts = {})
435
+ # @option opts [CreateSignatureRequestTokenRequest] :body The kind of link to make. Send no body for an `api` token.
436
+ # @return [Array<(SignatureRequestToken, Integer, Hash)>] SignatureRequestToken data, response status code and response headers
437
+ def create_signature_request_token_with_http_info(signature_request_id, opts = {})
432
438
  if @api_client.config.debugging
433
- @api_client.config.logger.debug 'Calling API: Client.create_data_request_event ...'
434
- end
435
- # verify the required parameter 'data_request_id' is set
436
- if @api_client.config.client_side_validation && data_request_id.nil?
437
- fail ArgumentError, "Missing the required parameter 'data_request_id' when calling Client.create_data_request_event"
439
+ @api_client.config.logger.debug 'Calling API: Client.create_signature_request_token ...'
438
440
  end
439
- # verify the required parameter 'event' is set
440
- if @api_client.config.client_side_validation && event.nil?
441
- fail ArgumentError, "Missing the required parameter 'event' when calling Client.create_data_request_event"
441
+ # verify the required parameter 'signature_request_id' is set
442
+ if @api_client.config.client_side_validation && signature_request_id.nil?
443
+ fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling Client.create_signature_request_token"
442
444
  end
443
445
  # resource path
444
- local_var_path = '/data_requests/{data_request_id}/events'.sub('{' + 'data_request_id' + '}', CGI.escape(data_request_id.to_s))
446
+ local_var_path = '/signature_requests/{signature_request_id}/tokens'.sub('{signature_request_id}', CGI.escape(signature_request_id.to_s))
445
447
 
446
448
  # query parameters
447
449
  query_params = opts[:query_params] || {}
@@ -460,16 +462,16 @@ end
460
462
  form_params = opts[:form_params] || {}
461
463
 
462
464
  # http body (model)
463
- post_body = opts[:debug_body] || @api_client.object_to_http_body(event)
465
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
464
466
 
465
467
  # return_type
466
- return_type = opts[:debug_return_type] || 'CreateSubmissionDataRequestEventResponse'
468
+ return_type = opts[:debug_return_type] || 'SignatureRequestToken'
467
469
 
468
470
  # auth_names
469
471
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
470
472
 
471
473
  new_options = opts.merge(
472
- :operation => :"Client.create_data_request_event",
474
+ :operation => :"Client.create_signature_request_token",
473
475
  :header_params => header_params,
474
476
  :query_params => query_params,
475
477
  :form_params => form_params,
@@ -480,109 +482,51 @@ end
480
482
 
481
483
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
482
484
  if @api_client.config.debugging
483
- @api_client.config.logger.debug "API called: Client#create_data_request_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
485
+ @api_client.config.logger.debug "API called: Client#create_signature_request_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
484
486
  end
485
487
  return data, status_code, headers
486
488
  end
487
489
 
488
- # Create a new data request token for form authentication
489
- # Creates an authentication token for accessing a data request form. Returns a token and a pre-authenticated URL for the data request form. The token remains valid until the data request is completed. See also: - [Embedded Data Requests Guide](https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/)
490
- # @param data_request_id [String]
490
+ # Generate a PDF
491
+ # Creates a submission: fills in a template with your data and generates a PDF. The PDF is generated in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until `state` isn't `pending`. Data that doesn't match the template's fields returns a 422 with an `invalid_data` error. The submission is still saved, with its errors, so you can find it in DocSpring: the error's `submission_id` is its ID.
492
+ # @param template_id [String] The template's ID.
493
+ # @param body [CreateSubmissionRequest] The submission's data and settings.
491
494
  # @param [Hash] opts the optional parameters
492
- # @option opts [String] :type
493
- # @return [CreateSubmissionDataRequestTokenResponse]
494
- def create_data_request_token(data_request_id, opts = {})
495
- data, _status_code, _headers = create_data_request_token_with_http_info(data_request_id, opts)
495
+ # @option opts [String] :version The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published).
496
+ # @option opts [Boolean] :wait Wait until the PDF has been generated before responding. Default true on sync.api hosts.
497
+ # @return [Submission]
498
+ def create_submission(template_id, body, opts = {})
499
+ data, _status_code, _headers = create_submission_with_http_info(template_id, body, opts)
496
500
  data
497
501
  end
498
502
 
499
- # Create a new data request token for form authentication
500
- # Creates an authentication token for accessing a data request form. Returns a token and a pre-authenticated URL for the data request form. The token remains valid until the data request is completed. See also: - [Embedded Data Requests Guide](https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/)
501
- # @param data_request_id [String]
503
+ # Generate a PDF
504
+ # Creates a submission: fills in a template with your data and generates a PDF. The PDF is generated in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until `state` isn't `pending`. Data that doesn't match the template's fields returns a 422 with an `invalid_data` error. The submission is still saved, with its errors, so you can find it in DocSpring: the error's `submission_id` is its ID.
505
+ # @param template_id [String] The template's ID.
506
+ # @param body [CreateSubmissionRequest] The submission's data and settings.
502
507
  # @param [Hash] opts the optional parameters
503
- # @option opts [String] :type
504
- # @return [Array<(CreateSubmissionDataRequestTokenResponse, Integer, Hash)>] CreateSubmissionDataRequestTokenResponse data, response status code and response headers
505
- def create_data_request_token_with_http_info(data_request_id, opts = {})
506
- if @api_client.config.debugging
507
- @api_client.config.logger.debug 'Calling API: Client.create_data_request_token ...'
508
- end
509
- # verify the required parameter 'data_request_id' is set
510
- if @api_client.config.client_side_validation && data_request_id.nil?
511
- fail ArgumentError, "Missing the required parameter 'data_request_id' when calling Client.create_data_request_token"
512
- end
513
- allowable_values = ["api", "email"]
514
- if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
515
- fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
516
- end
517
- # resource path
518
- local_var_path = '/data_requests/{data_request_id}/tokens'.sub('{' + 'data_request_id' + '}', CGI.escape(data_request_id.to_s))
519
-
520
- # query parameters
521
- query_params = opts[:query_params] || {}
522
- query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
523
-
524
- # header parameters
525
- header_params = opts[:header_params] || {}
526
- # HTTP header 'Accept' (if needed)
527
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
528
-
529
- # form parameters
530
- form_params = opts[:form_params] || {}
531
-
532
- # http body (model)
533
- post_body = opts[:debug_body]
534
-
535
- # return_type
536
- return_type = opts[:debug_return_type] || 'CreateSubmissionDataRequestTokenResponse'
537
-
538
- # auth_names
539
- auth_names = opts[:debug_auth_names] || ['api_token_basic']
540
-
541
- new_options = opts.merge(
542
- :operation => :"Client.create_data_request_token",
543
- :header_params => header_params,
544
- :query_params => query_params,
545
- :form_params => form_params,
546
- :body => post_body,
547
- :auth_names => auth_names,
548
- :return_type => return_type
549
- )
550
-
551
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
508
+ # @option opts [String] :version The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published).
509
+ # @option opts [Boolean] :wait Wait until the PDF has been generated before responding. Default true on sync.api hosts.
510
+ # @return [Array<(Submission, Integer, Hash)>] Submission data, response status code and response headers
511
+ def create_submission_with_http_info(template_id, body, opts = {})
552
512
  if @api_client.config.debugging
553
- @api_client.config.logger.debug "API called: Client#create_data_request_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
513
+ @api_client.config.logger.debug 'Calling API: Client.create_submission ...'
554
514
  end
555
- return data, status_code, headers
556
- end
557
-
558
- # Create a folder
559
- # Creates a new folder for organizing templates. Folders can be nested within other folders by providing a `parent_folder_id`. Folder names must be unique within the same parent.
560
- # @param data [CreateFolderData]
561
- # @param [Hash] opts the optional parameters
562
- # @return [Folder]
563
- def create_folder(data, opts = {})
564
- data, _status_code, _headers = create_folder_with_http_info(data, opts)
565
- data
566
- end
567
-
568
- # Create a folder
569
- # Creates a new folder for organizing templates. Folders can be nested within other folders by providing a &#x60;parent_folder_id&#x60;. Folder names must be unique within the same parent.
570
- # @param data [CreateFolderData]
571
- # @param [Hash] opts the optional parameters
572
- # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers
573
- def create_folder_with_http_info(data, opts = {})
574
- if @api_client.config.debugging
575
- @api_client.config.logger.debug 'Calling API: Client.create_folder ...'
515
+ # verify the required parameter 'template_id' is set
516
+ if @api_client.config.client_side_validation && template_id.nil?
517
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.create_submission"
576
518
  end
577
- # verify the required parameter 'data' is set
578
- if @api_client.config.client_side_validation && data.nil?
579
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.create_folder"
519
+ # verify the required parameter 'body' is set
520
+ if @api_client.config.client_side_validation && body.nil?
521
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.create_submission"
580
522
  end
581
523
  # resource path
582
- local_var_path = '/folders/'
524
+ local_var_path = '/templates/{template_id}/submissions'.sub('{template_id}', CGI.escape(template_id.to_s))
583
525
 
584
526
  # query parameters
585
527
  query_params = opts[:query_params] || {}
528
+ query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?
529
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
586
530
 
587
531
  # header parameters
588
532
  header_params = opts[:header_params] || {}
@@ -598,16 +542,16 @@ end
598
542
  form_params = opts[:form_params] || {}
599
543
 
600
544
  # http body (model)
601
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
545
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
602
546
 
603
547
  # return_type
604
- return_type = opts[:debug_return_type] || 'Folder'
548
+ return_type = opts[:debug_return_type] || 'Submission'
605
549
 
606
550
  # auth_names
607
551
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
608
552
 
609
553
  new_options = opts.merge(
610
- :operation => :"Client.create_folder",
554
+ :operation => :"Client.create_submission",
611
555
  :header_params => header_params,
612
556
  :query_params => query_params,
613
557
  :form_params => form_params,
@@ -618,39 +562,42 @@ end
618
562
 
619
563
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
620
564
  if @api_client.config.debugging
621
- @api_client.config.logger.debug "API called: Client#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
565
+ @api_client.config.logger.debug "API called: Client#create_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
622
566
  end
623
567
  return data, status_code, headers
624
568
  end
625
569
 
626
- # Create a new HTML template
627
- # Creates a new HTML template using HTML, CSS/SCSS, and Liquid templating. Allows complete control over PDF layout and styling. Supports headers, footers, and dynamic content using Liquid syntax for field values, conditions, loops, and filters.
628
- # @param data [CreateHtmlTemplate]
570
+ # Generate PDFs in a batch
571
+ # Creates up to 50 submissions in one request, from one template or several. The PDFs are only generated when every submission is valid. On sync.api hosts the request waits until every PDF has been generated (unless you pass `wait=false`), otherwise poll GET /submissions/batches/{submission_batch_id} until `processed_at` is set. When any submission is invalid, nothing is generated and the request returns a 422. Submissions whose data doesn't match their template's fields are still saved with their errors (an `invalid_data` error, with each one's `submission_id` in its details), so you can find them in DocSpring. The other submissions aren't saved.
572
+ # @param body [CreateSubmissionBatchRequest] The submissions to create, and the settings they share.
629
573
  # @param [Hash] opts the optional parameters
630
- # @return [TemplatePreview]
631
- def create_html_template(data, opts = {})
632
- data, _status_code, _headers = create_html_template_with_http_info(data, opts)
574
+ # @option opts [Boolean] :wait Wait until every PDF in the batch has been generated before responding. Default true on sync.api hosts.
575
+ # @return [SubmissionBatch]
576
+ def create_submission_batch(body, opts = {})
577
+ data, _status_code, _headers = create_submission_batch_with_http_info(body, opts)
633
578
  data
634
579
  end
635
580
 
636
- # Create a new HTML template
637
- # Creates a new HTML template using HTML, CSS/SCSS, and Liquid templating. Allows complete control over PDF layout and styling. Supports headers, footers, and dynamic content using Liquid syntax for field values, conditions, loops, and filters.
638
- # @param data [CreateHtmlTemplate]
581
+ # Generate PDFs in a batch
582
+ # Creates up to 50 submissions in one request, from one template or several. The PDFs are only generated when every submission is valid. On sync.api hosts the request waits until every PDF has been generated (unless you pass `wait=false`), otherwise poll GET /submissions/batches/{submission_batch_id} until `processed_at` is set. When any submission is invalid, nothing is generated and the request returns a 422. Submissions whose data doesn't match their template's fields are still saved with their errors (an `invalid_data` error, with each one's `submission_id` in its details), so you can find them in DocSpring. The other submissions aren't saved.
583
+ # @param body [CreateSubmissionBatchRequest] The submissions to create, and the settings they share.
639
584
  # @param [Hash] opts the optional parameters
640
- # @return [Array<(TemplatePreview, Integer, Hash)>] TemplatePreview data, response status code and response headers
641
- def create_html_template_with_http_info(data, opts = {})
585
+ # @option opts [Boolean] :wait Wait until every PDF in the batch has been generated before responding. Default true on sync.api hosts.
586
+ # @return [Array<(SubmissionBatch, Integer, Hash)>] SubmissionBatch data, response status code and response headers
587
+ def create_submission_batch_with_http_info(body, opts = {})
642
588
  if @api_client.config.debugging
643
- @api_client.config.logger.debug 'Calling API: Client.create_html_template ...'
589
+ @api_client.config.logger.debug 'Calling API: Client.create_submission_batch ...'
644
590
  end
645
- # verify the required parameter 'data' is set
646
- if @api_client.config.client_side_validation && data.nil?
647
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.create_html_template"
591
+ # verify the required parameter 'body' is set
592
+ if @api_client.config.client_side_validation && body.nil?
593
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.create_submission_batch"
648
594
  end
649
595
  # resource path
650
- local_var_path = '/templates?endpoint_variant=create_html_template'
596
+ local_var_path = '/submissions/batches'
651
597
 
652
598
  # query parameters
653
599
  query_params = opts[:query_params] || {}
600
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
654
601
 
655
602
  # header parameters
656
603
  header_params = opts[:header_params] || {}
@@ -666,16 +613,16 @@ end
666
613
  form_params = opts[:form_params] || {}
667
614
 
668
615
  # http body (model)
669
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
616
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
670
617
 
671
618
  # return_type
672
- return_type = opts[:debug_return_type] || 'TemplatePreview'
619
+ return_type = opts[:debug_return_type] || 'SubmissionBatch'
673
620
 
674
621
  # auth_names
675
622
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
676
623
 
677
624
  new_options = opts.merge(
678
- :operation => :"Client.create_html_template",
625
+ :operation => :"Client.create_submission_batch",
679
626
  :header_params => header_params,
680
627
  :query_params => query_params,
681
628
  :form_params => form_params,
@@ -686,45 +633,35 @@ end
686
633
 
687
634
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
688
635
  if @api_client.config.debugging
689
- @api_client.config.logger.debug "API called: Client#create_html_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
636
+ @api_client.config.logger.debug "API called: Client#create_submission_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
690
637
  end
691
638
  return data, status_code, headers
692
639
  end
693
640
 
694
- # Create a new PDF template with a form POST file upload
695
- # Creates a new PDF template by uploading a PDF file. The uploaded PDF becomes the foundation for your template, and you can then add fillable fields using the template editor. Use the wait parameter to control whether the request waits for document processing to complete.
696
- # @param template_document [File]
697
- # @param template_name [String]
641
+ # Create a template
642
+ # Creates an HTML template, or a PDF template from a PDF you uploaded with the presigned upload (GET /uploads/presign): pass its `fields.key` as `cache_id`. To send the PDF with the request instead, use POST /templates/upload. A PDF template is ready to generate PDFs once DocSpring has processed its PDF (`ready` is true). On sync.api hosts the request waits for that unless you pass `wait=false`.
643
+ # @param body [CreateTemplateRequest] The template to create.
698
644
  # @param [Hash] opts the optional parameters
699
- # @option opts [Boolean] :wait Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (default to true)
700
- # @option opts [String] :template_description
701
- # @option opts [String] :template_parent_folder_id
702
- # @return [TemplatePreview]
703
- def create_pdf_template(template_document, template_name, opts = {})
704
- data, _status_code, _headers = create_pdf_template_with_http_info(template_document, template_name, opts)
645
+ # @option opts [Boolean] :wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
646
+ # @return [Template]
647
+ def create_template(body, opts = {})
648
+ data, _status_code, _headers = create_template_with_http_info(body, opts)
705
649
  data
706
650
  end
707
651
 
708
- # Create a new PDF template with a form POST file upload
709
- # Creates a new PDF template by uploading a PDF file. The uploaded PDF becomes the foundation for your template, and you can then add fillable fields using the template editor. Use the wait parameter to control whether the request waits for document processing to complete.
710
- # @param template_document [File]
711
- # @param template_name [String]
652
+ # Create a template
653
+ # Creates an HTML template, or a PDF template from a PDF you uploaded with the presigned upload (GET /uploads/presign): pass its `fields.key` as `cache_id`. To send the PDF with the request instead, use POST /templates/upload. A PDF template is ready to generate PDFs once DocSpring has processed its PDF (`ready` is true). On sync.api hosts the request waits for that unless you pass `wait=false`.
654
+ # @param body [CreateTemplateRequest] The template to create.
712
655
  # @param [Hash] opts the optional parameters
713
- # @option opts [Boolean] :wait Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (default to true)
714
- # @option opts [String] :template_description
715
- # @option opts [String] :template_parent_folder_id
716
- # @return [Array<(TemplatePreview, Integer, Hash)>] TemplatePreview data, response status code and response headers
717
- def create_pdf_template_with_http_info(template_document, template_name, opts = {})
656
+ # @option opts [Boolean] :wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
657
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
658
+ def create_template_with_http_info(body, opts = {})
718
659
  if @api_client.config.debugging
719
- @api_client.config.logger.debug 'Calling API: Client.create_pdf_template ...'
720
- end
721
- # verify the required parameter 'template_document' is set
722
- if @api_client.config.client_side_validation && template_document.nil?
723
- fail ArgumentError, "Missing the required parameter 'template_document' when calling Client.create_pdf_template"
660
+ @api_client.config.logger.debug 'Calling API: Client.create_template ...'
724
661
  end
725
- # verify the required parameter 'template_name' is set
726
- if @api_client.config.client_side_validation && template_name.nil?
727
- fail ArgumentError, "Missing the required parameter 'template_name' when calling Client.create_pdf_template"
662
+ # verify the required parameter 'body' is set
663
+ if @api_client.config.client_side_validation && body.nil?
664
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.create_template"
728
665
  end
729
666
  # resource path
730
667
  local_var_path = '/templates'
@@ -738,29 +675,25 @@ end
738
675
  # HTTP header 'Accept' (if needed)
739
676
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
740
677
  # HTTP header 'Content-Type'
741
- content_type = @api_client.select_header_content_type(['multipart/form-data'])
678
+ content_type = @api_client.select_header_content_type(['application/json'])
742
679
  if !content_type.nil?
743
680
  header_params['Content-Type'] = content_type
744
681
  end
745
682
 
746
683
  # form parameters
747
684
  form_params = opts[:form_params] || {}
748
- form_params['template[document]'] = template_document
749
- form_params['template[name]'] = template_name
750
- form_params['template[description]'] = opts[:'template_description'] if !opts[:'template_description'].nil?
751
- form_params['template[parent_folder_id]'] = opts[:'template_parent_folder_id'] if !opts[:'template_parent_folder_id'].nil?
752
685
 
753
686
  # http body (model)
754
- post_body = opts[:debug_body]
687
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
755
688
 
756
689
  # return_type
757
- return_type = opts[:debug_return_type] || 'TemplatePreview'
690
+ return_type = opts[:debug_return_type] || 'Template'
758
691
 
759
692
  # auth_names
760
693
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
761
694
 
762
695
  new_options = opts.merge(
763
- :operation => :"Client.create_pdf_template",
696
+ :operation => :"Client.create_template",
764
697
  :header_params => header_params,
765
698
  :query_params => query_params,
766
699
  :form_params => form_params,
@@ -771,36 +704,36 @@ end
771
704
 
772
705
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
773
706
  if @api_client.config.debugging
774
- @api_client.config.logger.debug "API called: Client#create_pdf_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
707
+ @api_client.config.logger.debug "API called: Client#create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
775
708
  end
776
709
  return data, status_code, headers
777
710
  end
778
711
 
779
- # Create a new PDF template from a cached S3 file upload
780
- # Creates a new PDF template from a file previously uploaded to S3 using a presigned URL. This two-step process allows for more reliable large file uploads by first uploading the file to S3, then creating the template using the cached upload ID.
781
- # @param data [CreatePdfTemplate]
712
+ # Create a webhook
713
+ # Creates a webhook that sends a POST request to your endpoint whenever a subscribed event happens. Scope it to API tokens, templates or folders to receive only their events.
714
+ # @param body [CreateWebhookRequest] The webhook to create.
782
715
  # @param [Hash] opts the optional parameters
783
- # @return [TemplatePreview]
784
- def create_pdf_template_from_upload(data, opts = {})
785
- data, _status_code, _headers = create_pdf_template_from_upload_with_http_info(data, opts)
716
+ # @return [Webhook]
717
+ def create_webhook(body, opts = {})
718
+ data, _status_code, _headers = create_webhook_with_http_info(body, opts)
786
719
  data
787
720
  end
788
721
 
789
- # Create a new PDF template from a cached S3 file upload
790
- # Creates a new PDF template from a file previously uploaded to S3 using a presigned URL. This two-step process allows for more reliable large file uploads by first uploading the file to S3, then creating the template using the cached upload ID.
791
- # @param data [CreatePdfTemplate]
722
+ # Create a webhook
723
+ # Creates a webhook that sends a POST request to your endpoint whenever a subscribed event happens. Scope it to API tokens, templates or folders to receive only their events.
724
+ # @param body [CreateWebhookRequest] The webhook to create.
792
725
  # @param [Hash] opts the optional parameters
793
- # @return [Array<(TemplatePreview, Integer, Hash)>] TemplatePreview data, response status code and response headers
794
- def create_pdf_template_from_upload_with_http_info(data, opts = {})
726
+ # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
727
+ def create_webhook_with_http_info(body, opts = {})
795
728
  if @api_client.config.debugging
796
- @api_client.config.logger.debug 'Calling API: Client.create_pdf_template_from_upload ...'
729
+ @api_client.config.logger.debug 'Calling API: Client.create_webhook ...'
797
730
  end
798
- # verify the required parameter 'data' is set
799
- if @api_client.config.client_side_validation && data.nil?
800
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.create_pdf_template_from_upload"
731
+ # verify the required parameter 'body' is set
732
+ if @api_client.config.client_side_validation && body.nil?
733
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.create_webhook"
801
734
  end
802
735
  # resource path
803
- local_var_path = '/templates?endpoint_variant=create_template_from_cached_upload'
736
+ local_var_path = '/webhooks'
804
737
 
805
738
  # query parameters
806
739
  query_params = opts[:query_params] || {}
@@ -819,16 +752,16 @@ end
819
752
  form_params = opts[:form_params] || {}
820
753
 
821
754
  # http body (model)
822
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
755
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
823
756
 
824
757
  # return_type
825
- return_type = opts[:debug_return_type] || 'TemplatePreview'
758
+ return_type = opts[:debug_return_type] || 'Webhook'
826
759
 
827
760
  # auth_names
828
761
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
829
762
 
830
763
  new_options = opts.merge(
831
- :operation => :"Client.create_pdf_template_from_upload",
764
+ :operation => :"Client.create_webhook",
832
765
  :header_params => header_params,
833
766
  :query_params => query_params,
834
767
  :form_params => form_params,
@@ -839,36 +772,36 @@ end
839
772
 
840
773
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
841
774
  if @api_client.config.debugging
842
- @api_client.config.logger.debug "API called: Client#create_pdf_template_from_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
775
+ @api_client.config.logger.debug "API called: Client#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
843
776
  end
844
777
  return data, status_code, headers
845
778
  end
846
779
 
847
- # Create a webhook
848
- # Creates a webhook that delivers a POST request to your endpoint whenever a subscribed event occurs. Optionally scope the webhook to specific API tokens, templates, or folders.
849
- # @param data [CreateWebhookData]
780
+ # Delete a custom file
781
+ # Deletes a custom file and returns it. Use a live API token: test tokens can't delete custom files.
782
+ # @param custom_file_id [String] The custom file's ID.
850
783
  # @param [Hash] opts the optional parameters
851
- # @return [Webhook]
852
- def create_webhook(data, opts = {})
853
- data, _status_code, _headers = create_webhook_with_http_info(data, opts)
784
+ # @return [CustomFile]
785
+ def delete_custom_file(custom_file_id, opts = {})
786
+ data, _status_code, _headers = delete_custom_file_with_http_info(custom_file_id, opts)
854
787
  data
855
788
  end
856
789
 
857
- # Create a webhook
858
- # Creates a webhook that delivers a POST request to your endpoint whenever a subscribed event occurs. Optionally scope the webhook to specific API tokens, templates, or folders.
859
- # @param data [CreateWebhookData]
790
+ # Delete a custom file
791
+ # Deletes a custom file and returns it. Use a live API token: test tokens can't delete custom files.
792
+ # @param custom_file_id [String] The custom file's ID.
860
793
  # @param [Hash] opts the optional parameters
861
- # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
862
- def create_webhook_with_http_info(data, opts = {})
794
+ # @return [Array<(CustomFile, Integer, Hash)>] CustomFile data, response status code and response headers
795
+ def delete_custom_file_with_http_info(custom_file_id, opts = {})
863
796
  if @api_client.config.debugging
864
- @api_client.config.logger.debug 'Calling API: Client.create_webhook ...'
797
+ @api_client.config.logger.debug 'Calling API: Client.delete_custom_file ...'
865
798
  end
866
- # verify the required parameter 'data' is set
867
- if @api_client.config.client_side_validation && data.nil?
868
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.create_webhook"
799
+ # verify the required parameter 'custom_file_id' is set
800
+ if @api_client.config.client_side_validation && custom_file_id.nil?
801
+ fail ArgumentError, "Missing the required parameter 'custom_file_id' when calling Client.delete_custom_file"
869
802
  end
870
803
  # resource path
871
- local_var_path = '/webhooks'
804
+ local_var_path = '/custom_files/{custom_file_id}'.sub('{custom_file_id}', CGI.escape(custom_file_id.to_s))
872
805
 
873
806
  # query parameters
874
807
  query_params = opts[:query_params] || {}
@@ -877,26 +810,21 @@ end
877
810
  header_params = opts[:header_params] || {}
878
811
  # HTTP header 'Accept' (if needed)
879
812
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
880
- # HTTP header 'Content-Type'
881
- content_type = @api_client.select_header_content_type(['application/json'])
882
- if !content_type.nil?
883
- header_params['Content-Type'] = content_type
884
- end
885
813
 
886
814
  # form parameters
887
815
  form_params = opts[:form_params] || {}
888
816
 
889
817
  # http body (model)
890
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
818
+ post_body = opts[:debug_body]
891
819
 
892
820
  # return_type
893
- return_type = opts[:debug_return_type] || 'Webhook'
821
+ return_type = opts[:debug_return_type] || 'CustomFile'
894
822
 
895
823
  # auth_names
896
824
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
897
825
 
898
826
  new_options = opts.merge(
899
- :operation => :"Client.create_webhook",
827
+ :operation => :"Client.delete_custom_file",
900
828
  :header_params => header_params,
901
829
  :query_params => query_params,
902
830
  :form_params => form_params,
@@ -905,16 +833,16 @@ end
905
833
  :return_type => return_type
906
834
  )
907
835
 
908
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
836
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
909
837
  if @api_client.config.debugging
910
- @api_client.config.logger.debug "API called: Client#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
838
+ @api_client.config.logger.debug "API called: Client#delete_custom_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
911
839
  end
912
840
  return data, status_code, headers
913
841
  end
914
842
 
915
843
  # Delete a folder
916
- # Deletes an empty folder. The folder must not contain any templates or subfolders. Move or delete all contents before attempting to delete the folder.
917
- # @param folder_id [String]
844
+ # Deletes an empty folder and returns it. A folder that still has templates or folders in it can't be deleted.
845
+ # @param folder_id [String] The folder's ID.
918
846
  # @param [Hash] opts the optional parameters
919
847
  # @return [Folder]
920
848
  def delete_folder(folder_id, opts = {})
@@ -923,8 +851,8 @@ end
923
851
  end
924
852
 
925
853
  # Delete a folder
926
- # Deletes an empty folder. The folder must not contain any templates or subfolders. Move or delete all contents before attempting to delete the folder.
927
- # @param folder_id [String]
854
+ # Deletes an empty folder and returns it. A folder that still has templates or folders in it can't be deleted.
855
+ # @param folder_id [String] The folder's ID.
928
856
  # @param [Hash] opts the optional parameters
929
857
  # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers
930
858
  def delete_folder_with_http_info(folder_id, opts = {})
@@ -936,7 +864,7 @@ end
936
864
  fail ArgumentError, "Missing the required parameter 'folder_id' when calling Client.delete_folder"
937
865
  end
938
866
  # resource path
939
- local_var_path = '/folders/{folder_id}'.sub('{' + 'folder_id' + '}', CGI.escape(folder_id.to_s))
867
+ local_var_path = '/folders/{folder_id}'.sub('{folder_id}', CGI.escape(folder_id.to_s))
940
868
 
941
869
  # query parameters
942
870
  query_params = opts[:query_params] || {}
@@ -976,22 +904,22 @@ end
976
904
  end
977
905
 
978
906
  # Delete a template
979
- # Deletes a template or a specific template version. When no version is specified, deletes the entire template including all versions. When a version is specified, deletes only that version while preserving others. Returns remaining version information.
980
- # @param template_id [String]
907
+ # Deletes a template's draft and all of its published versions, or one published version (`version`). Returns the template as it was before it was deleted.
908
+ # @param template_id [String] The template's ID.
981
909
  # @param [Hash] opts the optional parameters
982
- # @option opts [String] :version
983
- # @return [TemplateDeleteResponse]
910
+ # @option opts [String] :version Delete only this published version (`1.2.0`) or the draft (`draft`, when no version has been published). Without it, the draft and every published version are deleted.
911
+ # @return [Template]
984
912
  def delete_template(template_id, opts = {})
985
913
  data, _status_code, _headers = delete_template_with_http_info(template_id, opts)
986
914
  data
987
915
  end
988
916
 
989
917
  # Delete a template
990
- # Deletes a template or a specific template version. When no version is specified, deletes the entire template including all versions. When a version is specified, deletes only that version while preserving others. Returns remaining version information.
991
- # @param template_id [String]
918
+ # Deletes a template's draft and all of its published versions, or one published version (`version`). Returns the template as it was before it was deleted.
919
+ # @param template_id [String] The template's ID.
992
920
  # @param [Hash] opts the optional parameters
993
- # @option opts [String] :version
994
- # @return [Array<(TemplateDeleteResponse, Integer, Hash)>] TemplateDeleteResponse data, response status code and response headers
921
+ # @option opts [String] :version Delete only this published version (`1.2.0`) or the draft (`draft`, when no version has been published). Without it, the draft and every published version are deleted.
922
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
995
923
  def delete_template_with_http_info(template_id, opts = {})
996
924
  if @api_client.config.debugging
997
925
  @api_client.config.logger.debug 'Calling API: Client.delete_template ...'
@@ -1001,7 +929,7 @@ end
1001
929
  fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.delete_template"
1002
930
  end
1003
931
  # resource path
1004
- local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
932
+ local_var_path = '/templates/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s))
1005
933
 
1006
934
  # query parameters
1007
935
  query_params = opts[:query_params] || {}
@@ -1019,7 +947,7 @@ end
1019
947
  post_body = opts[:debug_body]
1020
948
 
1021
949
  # return_type
1022
- return_type = opts[:debug_return_type] || 'TemplateDeleteResponse'
950
+ return_type = opts[:debug_return_type] || 'Template'
1023
951
 
1024
952
  # auth_names
1025
953
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -1042,8 +970,8 @@ end
1042
970
  end
1043
971
 
1044
972
  # Delete a webhook
1045
- # Permanently deletes a webhook so it stops receiving events, and returns the deleted webhook.
1046
- # @param webhook_id [String]
973
+ # Deletes a webhook so it stops receiving events, and returns it.
974
+ # @param webhook_id [String] The webhook's ID.
1047
975
  # @param [Hash] opts the optional parameters
1048
976
  # @return [Webhook]
1049
977
  def delete_webhook(webhook_id, opts = {})
@@ -1052,8 +980,8 @@ end
1052
980
  end
1053
981
 
1054
982
  # Delete a webhook
1055
- # Permanently deletes a webhook so it stops receiving events, and returns the deleted webhook.
1056
- # @param webhook_id [String]
983
+ # Deletes a webhook so it stops receiving events, and returns it.
984
+ # @param webhook_id [String] The webhook's ID.
1057
985
  # @param [Hash] opts the optional parameters
1058
986
  # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
1059
987
  def delete_webhook_with_http_info(webhook_id, opts = {})
@@ -1065,7 +993,7 @@ end
1065
993
  fail ArgumentError, "Missing the required parameter 'webhook_id' when calling Client.delete_webhook"
1066
994
  end
1067
995
  # resource path
1068
- local_var_path = '/webhooks/{webhook_id}'.sub('{' + 'webhook_id' + '}', CGI.escape(webhook_id.to_s))
996
+ local_var_path = '/webhooks/{webhook_id}'.sub('{webhook_id}', CGI.escape(webhook_id.to_s))
1069
997
 
1070
998
  # query parameters
1071
999
  query_params = opts[:query_params] || {}
@@ -1104,31 +1032,31 @@ end
1104
1032
  return data, status_code, headers
1105
1033
  end
1106
1034
 
1107
- # Expire a combined submission
1108
- # Expiring a combined submission deletes the PDF from our system. This is useful for invalidating sensitive documents.
1109
- # @param combined_submission_id [String]
1035
+ # Expire a combined PDF
1036
+ # Deletes a combined PDF's PDF and returns the expired combined PDF.
1037
+ # @param combined_pdf_id [String] The combined PDF's ID.
1110
1038
  # @param [Hash] opts the optional parameters
1111
- # @return [CombinedSubmission]
1112
- def expire_combined_submission(combined_submission_id, opts = {})
1113
- data, _status_code, _headers = expire_combined_submission_with_http_info(combined_submission_id, opts)
1039
+ # @return [CombinedPdf]
1040
+ def expire_combined_pdf(combined_pdf_id, opts = {})
1041
+ data, _status_code, _headers = expire_combined_pdf_with_http_info(combined_pdf_id, opts)
1114
1042
  data
1115
1043
  end
1116
1044
 
1117
- # Expire a combined submission
1118
- # Expiring a combined submission deletes the PDF from our system. This is useful for invalidating sensitive documents.
1119
- # @param combined_submission_id [String]
1045
+ # Expire a combined PDF
1046
+ # Deletes a combined PDF's PDF and returns the expired combined PDF.
1047
+ # @param combined_pdf_id [String] The combined PDF's ID.
1120
1048
  # @param [Hash] opts the optional parameters
1121
- # @return [Array<(CombinedSubmission, Integer, Hash)>] CombinedSubmission data, response status code and response headers
1122
- def expire_combined_submission_with_http_info(combined_submission_id, opts = {})
1049
+ # @return [Array<(CombinedPdf, Integer, Hash)>] CombinedPdf data, response status code and response headers
1050
+ def expire_combined_pdf_with_http_info(combined_pdf_id, opts = {})
1123
1051
  if @api_client.config.debugging
1124
- @api_client.config.logger.debug 'Calling API: Client.expire_combined_submission ...'
1052
+ @api_client.config.logger.debug 'Calling API: Client.expire_combined_pdf ...'
1125
1053
  end
1126
- # verify the required parameter 'combined_submission_id' is set
1127
- if @api_client.config.client_side_validation && combined_submission_id.nil?
1128
- fail ArgumentError, "Missing the required parameter 'combined_submission_id' when calling Client.expire_combined_submission"
1054
+ # verify the required parameter 'combined_pdf_id' is set
1055
+ if @api_client.config.client_side_validation && combined_pdf_id.nil?
1056
+ fail ArgumentError, "Missing the required parameter 'combined_pdf_id' when calling Client.expire_combined_pdf"
1129
1057
  end
1130
1058
  # resource path
1131
- local_var_path = '/combined_submissions/{combined_submission_id}'.sub('{' + 'combined_submission_id' + '}', CGI.escape(combined_submission_id.to_s))
1059
+ local_var_path = '/combined_pdfs/{combined_pdf_id}'.sub('{combined_pdf_id}', CGI.escape(combined_pdf_id.to_s))
1132
1060
 
1133
1061
  # query parameters
1134
1062
  query_params = opts[:query_params] || {}
@@ -1145,13 +1073,13 @@ end
1145
1073
  post_body = opts[:debug_body]
1146
1074
 
1147
1075
  # return_type
1148
- return_type = opts[:debug_return_type] || 'CombinedSubmission'
1076
+ return_type = opts[:debug_return_type] || 'CombinedPdf'
1149
1077
 
1150
1078
  # auth_names
1151
1079
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
1152
1080
 
1153
1081
  new_options = opts.merge(
1154
- :operation => :"Client.expire_combined_submission",
1082
+ :operation => :"Client.expire_combined_pdf",
1155
1083
  :header_params => header_params,
1156
1084
  :query_params => query_params,
1157
1085
  :form_params => form_params,
@@ -1162,26 +1090,26 @@ end
1162
1090
 
1163
1091
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
1164
1092
  if @api_client.config.debugging
1165
- @api_client.config.logger.debug "API called: Client#expire_combined_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1093
+ @api_client.config.logger.debug "API called: Client#expire_combined_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1166
1094
  end
1167
1095
  return data, status_code, headers
1168
1096
  end
1169
1097
 
1170
- # Expire a PDF submission
1171
- # Expiring a PDF submission deletes the PDF and removes the data from our database. This is useful for invalidating sensitive documents after they've been downloaded. You can also [configure a data retention policy for your submissions](https://docspring.com/docs/template-editor/settings/#expire-submissions) so that they automatically expire.
1172
- # @param submission_id [String]
1098
+ # Expire a submission
1099
+ # Deletes a submission's data and PDF now, and returns the expired submission.
1100
+ # @param submission_id [String] The submission's ID.
1173
1101
  # @param [Hash] opts the optional parameters
1174
- # @return [SubmissionPreview]
1102
+ # @return [Submission]
1175
1103
  def expire_submission(submission_id, opts = {})
1176
1104
  data, _status_code, _headers = expire_submission_with_http_info(submission_id, opts)
1177
1105
  data
1178
1106
  end
1179
1107
 
1180
- # Expire a PDF submission
1181
- # Expiring a PDF submission deletes the PDF and removes the data from our database. This is useful for invalidating sensitive documents after they&#39;ve been downloaded. You can also [configure a data retention policy for your submissions](https://docspring.com/docs/template-editor/settings/#expire-submissions) so that they automatically expire.
1182
- # @param submission_id [String]
1108
+ # Expire a submission
1109
+ # Deletes a submission's data and PDF now, and returns the expired submission.
1110
+ # @param submission_id [String] The submission's ID.
1183
1111
  # @param [Hash] opts the optional parameters
1184
- # @return [Array<(SubmissionPreview, Integer, Hash)>] SubmissionPreview data, response status code and response headers
1112
+ # @return [Array<(Submission, Integer, Hash)>] Submission data, response status code and response headers
1185
1113
  def expire_submission_with_http_info(submission_id, opts = {})
1186
1114
  if @api_client.config.debugging
1187
1115
  @api_client.config.logger.debug 'Calling API: Client.expire_submission ...'
@@ -1191,7 +1119,7 @@ end
1191
1119
  fail ArgumentError, "Missing the required parameter 'submission_id' when calling Client.expire_submission"
1192
1120
  end
1193
1121
  # resource path
1194
- local_var_path = '/submissions/{submission_id}'.sub('{' + 'submission_id' + '}', CGI.escape(submission_id.to_s))
1122
+ local_var_path = '/submissions/{submission_id}'.sub('{submission_id}', CGI.escape(submission_id.to_s))
1195
1123
 
1196
1124
  # query parameters
1197
1125
  query_params = opts[:query_params] || {}
@@ -1208,7 +1136,7 @@ end
1208
1136
  post_body = opts[:debug_body]
1209
1137
 
1210
1138
  # return_type
1211
- return_type = opts[:debug_return_type] || 'SubmissionPreview'
1139
+ return_type = opts[:debug_return_type] || 'Submission'
1212
1140
 
1213
1141
  # auth_names
1214
1142
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -1230,68 +1158,54 @@ end
1230
1158
  return data, status_code, headers
1231
1159
  end
1232
1160
 
1233
- # Generate a PDF
1234
- # Creates a PDF submission by filling in a template with data. Supports both synchronous (default) and asynchronous processing. Add the `wait=false` query parameter to return immediately. Live PDFs use credits; test PDFs (`test: true`) are free and watermarked. If your balance can't cover a live PDF, the API returns 402 and the submission waits in the `insufficient_credits` state until you add credits. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/). See also: - [Customize the PDF Title and Filename](https://docspring.com/docs/api-guide/generate-pdfs/customize-pdf-title-and-filename/) - Set custom metadata - [Handling Truncated Text](https://docspring.com/docs/api-guide/generate-pdfs/handle-truncated-text/) - Handle text that doesn't fit in fields
1235
- # @param template_id [String]
1236
- # @param submission [CreatePdfSubmissionData]
1237
- # @param [Hash] opts the optional parameters
1238
- # @option opts [Boolean] :wait Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (default to true)
1239
- # @return [CreateSubmissionResponse]
1240
- def generate_pdf(template_id, submission, opts = {})
1241
- data, _status_code, _headers = generate_pdf_with_http_info(template_id, submission, opts)
1161
+ # Generate a preview PDF
1162
+ # Generates a preview of a submission's PDF in the background, such as for a submission still waiting for its signature requests. It's in `files.preview` once `preview_generated_at` changes.
1163
+ # @param submission_id [String] The submission's ID.
1164
+ # @param [Hash] opts the optional parameters
1165
+ # @return [Submission]
1166
+ def generate_submission_preview(submission_id, opts = {})
1167
+ data, _status_code, _headers = generate_submission_preview_with_http_info(submission_id, opts)
1242
1168
  data
1243
1169
  end
1244
1170
 
1245
- # Generate a PDF
1246
- # Creates a PDF submission by filling in a template with data. Supports both synchronous (default) and asynchronous processing. Add the &#x60;wait&#x3D;false&#x60; query parameter to return immediately. Live PDFs use credits; test PDFs (&#x60;test: true&#x60;) are free and watermarked. If your balance can&#39;t cover a live PDF, the API returns 402 and the submission waits in the &#x60;insufficient_credits&#x60; state until you add credits. See [Credits &amp; Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/). See also: - [Customize the PDF Title and Filename](https://docspring.com/docs/api-guide/generate-pdfs/customize-pdf-title-and-filename/) - Set custom metadata - [Handling Truncated Text](https://docspring.com/docs/api-guide/generate-pdfs/handle-truncated-text/) - Handle text that doesn&#39;t fit in fields
1247
- # @param template_id [String]
1248
- # @param submission [CreatePdfSubmissionData]
1171
+ # Generate a preview PDF
1172
+ # Generates a preview of a submission's PDF in the background, such as for a submission still waiting for its signature requests. It's in `files.preview` once `preview_generated_at` changes.
1173
+ # @param submission_id [String] The submission's ID.
1249
1174
  # @param [Hash] opts the optional parameters
1250
- # @option opts [Boolean] :wait Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (default to true)
1251
- # @return [Array<(CreateSubmissionResponse, Integer, Hash)>] CreateSubmissionResponse data, response status code and response headers
1252
- def generate_pdf_with_http_info(template_id, submission, opts = {})
1175
+ # @return [Array<(Submission, Integer, Hash)>] Submission data, response status code and response headers
1176
+ def generate_submission_preview_with_http_info(submission_id, opts = {})
1253
1177
  if @api_client.config.debugging
1254
- @api_client.config.logger.debug 'Calling API: Client.generate_pdf ...'
1255
- end
1256
- # verify the required parameter 'template_id' is set
1257
- if @api_client.config.client_side_validation && template_id.nil?
1258
- fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.generate_pdf"
1178
+ @api_client.config.logger.debug 'Calling API: Client.generate_submission_preview ...'
1259
1179
  end
1260
- # verify the required parameter 'submission' is set
1261
- if @api_client.config.client_side_validation && submission.nil?
1262
- fail ArgumentError, "Missing the required parameter 'submission' when calling Client.generate_pdf"
1180
+ # verify the required parameter 'submission_id' is set
1181
+ if @api_client.config.client_side_validation && submission_id.nil?
1182
+ fail ArgumentError, "Missing the required parameter 'submission_id' when calling Client.generate_submission_preview"
1263
1183
  end
1264
1184
  # resource path
1265
- local_var_path = '/templates/{template_id}/submissions'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
1185
+ local_var_path = '/submissions/{submission_id}/generate_preview'.sub('{submission_id}', CGI.escape(submission_id.to_s))
1266
1186
 
1267
1187
  # query parameters
1268
1188
  query_params = opts[:query_params] || {}
1269
- query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
1270
1189
 
1271
1190
  # header parameters
1272
1191
  header_params = opts[:header_params] || {}
1273
1192
  # HTTP header 'Accept' (if needed)
1274
1193
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1275
- # HTTP header 'Content-Type'
1276
- content_type = @api_client.select_header_content_type(['application/json'])
1277
- if !content_type.nil?
1278
- header_params['Content-Type'] = content_type
1279
- end
1280
1194
 
1281
1195
  # form parameters
1282
1196
  form_params = opts[:form_params] || {}
1283
1197
 
1284
1198
  # http body (model)
1285
- post_body = opts[:debug_body] || @api_client.object_to_http_body(submission)
1199
+ post_body = opts[:debug_body]
1286
1200
 
1287
1201
  # return_type
1288
- return_type = opts[:debug_return_type] || 'CreateSubmissionResponse'
1202
+ return_type = opts[:debug_return_type] || 'Submission'
1289
1203
 
1290
1204
  # auth_names
1291
1205
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
1292
1206
 
1293
1207
  new_options = opts.merge(
1294
- :operation => :"Client.generate_pdf",
1208
+ :operation => :"Client.generate_submission_preview",
1295
1209
  :header_params => header_params,
1296
1210
  :query_params => query_params,
1297
1211
  :form_params => form_params,
@@ -1302,36 +1216,36 @@ end
1302
1216
 
1303
1217
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1304
1218
  if @api_client.config.debugging
1305
- @api_client.config.logger.debug "API called: Client#generate_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1219
+ @api_client.config.logger.debug "API called: Client#generate_submission_preview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1306
1220
  end
1307
1221
  return data, status_code, headers
1308
1222
  end
1309
1223
 
1310
- # Generate a preview PDF for partially completed data requests
1311
- # Generates a preview PDF for a submission with partially completed data requests. Useful for showing users what the final document will look like before all signatures or data have been collected. The preview includes any data collected so far.
1312
- # @param submission_id [String]
1224
+ # Get a combined PDF
1225
+ # Returns a combined PDF, with a temporary link to download it once it has been generated.
1226
+ # @param combined_pdf_id [String] The combined PDF's ID.
1313
1227
  # @param [Hash] opts the optional parameters
1314
- # @return [SuccessErrorResponse]
1315
- def generate_preview(submission_id, opts = {})
1316
- data, _status_code, _headers = generate_preview_with_http_info(submission_id, opts)
1228
+ # @return [CombinedPdf]
1229
+ def get_combined_pdf(combined_pdf_id, opts = {})
1230
+ data, _status_code, _headers = get_combined_pdf_with_http_info(combined_pdf_id, opts)
1317
1231
  data
1318
1232
  end
1319
1233
 
1320
- # Generate a preview PDF for partially completed data requests
1321
- # Generates a preview PDF for a submission with partially completed data requests. Useful for showing users what the final document will look like before all signatures or data have been collected. The preview includes any data collected so far.
1322
- # @param submission_id [String]
1234
+ # Get a combined PDF
1235
+ # Returns a combined PDF, with a temporary link to download it once it has been generated.
1236
+ # @param combined_pdf_id [String] The combined PDF's ID.
1323
1237
  # @param [Hash] opts the optional parameters
1324
- # @return [Array<(SuccessErrorResponse, Integer, Hash)>] SuccessErrorResponse data, response status code and response headers
1325
- def generate_preview_with_http_info(submission_id, opts = {})
1238
+ # @return [Array<(CombinedPdf, Integer, Hash)>] CombinedPdf data, response status code and response headers
1239
+ def get_combined_pdf_with_http_info(combined_pdf_id, opts = {})
1326
1240
  if @api_client.config.debugging
1327
- @api_client.config.logger.debug 'Calling API: Client.generate_preview ...'
1241
+ @api_client.config.logger.debug 'Calling API: Client.get_combined_pdf ...'
1328
1242
  end
1329
- # verify the required parameter 'submission_id' is set
1330
- if @api_client.config.client_side_validation && submission_id.nil?
1331
- fail ArgumentError, "Missing the required parameter 'submission_id' when calling Client.generate_preview"
1243
+ # verify the required parameter 'combined_pdf_id' is set
1244
+ if @api_client.config.client_side_validation && combined_pdf_id.nil?
1245
+ fail ArgumentError, "Missing the required parameter 'combined_pdf_id' when calling Client.get_combined_pdf"
1332
1246
  end
1333
1247
  # resource path
1334
- local_var_path = '/submissions/{submission_id}/generate_preview'.sub('{' + 'submission_id' + '}', CGI.escape(submission_id.to_s))
1248
+ local_var_path = '/combined_pdfs/{combined_pdf_id}'.sub('{combined_pdf_id}', CGI.escape(combined_pdf_id.to_s))
1335
1249
 
1336
1250
  # query parameters
1337
1251
  query_params = opts[:query_params] || {}
@@ -1348,13 +1262,13 @@ end
1348
1262
  post_body = opts[:debug_body]
1349
1263
 
1350
1264
  # return_type
1351
- return_type = opts[:debug_return_type] || 'SuccessErrorResponse'
1265
+ return_type = opts[:debug_return_type] || 'CombinedPdf'
1352
1266
 
1353
1267
  # auth_names
1354
1268
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
1355
1269
 
1356
1270
  new_options = opts.merge(
1357
- :operation => :"Client.generate_preview",
1271
+ :operation => :"Client.get_combined_pdf",
1358
1272
  :header_params => header_params,
1359
1273
  :query_params => query_params,
1360
1274
  :form_params => form_params,
@@ -1363,38 +1277,38 @@ end
1363
1277
  :return_type => return_type
1364
1278
  )
1365
1279
 
1366
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1280
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1367
1281
  if @api_client.config.debugging
1368
- @api_client.config.logger.debug "API called: Client#generate_preview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1282
+ @api_client.config.logger.debug "API called: Client#get_combined_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1369
1283
  end
1370
1284
  return data, status_code, headers
1371
1285
  end
1372
1286
 
1373
- # Check the status of a combined submission (merged PDFs)
1374
- # Retrieves the details and status of a combined submission. Returns processing state, download URL (if processed), metadata, and information about any integrated actions (e.g., S3 uploads). `insufficient_credits` means the combined submission is waiting for credits and is processed once you add them. If it's still waiting after 30 days, it moves to `error`.
1375
- # @param combined_submission_id [String]
1287
+ # Get a custom file
1288
+ # Returns a custom file, with a temporary URL to download it.
1289
+ # @param custom_file_id [String] The custom file's ID.
1376
1290
  # @param [Hash] opts the optional parameters
1377
- # @return [CombinedSubmission]
1378
- def get_combined_submission(combined_submission_id, opts = {})
1379
- data, _status_code, _headers = get_combined_submission_with_http_info(combined_submission_id, opts)
1291
+ # @return [CustomFile]
1292
+ def get_custom_file(custom_file_id, opts = {})
1293
+ data, _status_code, _headers = get_custom_file_with_http_info(custom_file_id, opts)
1380
1294
  data
1381
1295
  end
1382
1296
 
1383
- # Check the status of a combined submission (merged PDFs)
1384
- # Retrieves the details and status of a combined submission. Returns processing state, download URL (if processed), metadata, and information about any integrated actions (e.g., S3 uploads). &#x60;insufficient_credits&#x60; means the combined submission is waiting for credits and is processed once you add them. If it&#39;s still waiting after 30 days, it moves to &#x60;error&#x60;.
1385
- # @param combined_submission_id [String]
1297
+ # Get a custom file
1298
+ # Returns a custom file, with a temporary URL to download it.
1299
+ # @param custom_file_id [String] The custom file's ID.
1386
1300
  # @param [Hash] opts the optional parameters
1387
- # @return [Array<(CombinedSubmission, Integer, Hash)>] CombinedSubmission data, response status code and response headers
1388
- def get_combined_submission_with_http_info(combined_submission_id, opts = {})
1301
+ # @return [Array<(CustomFile, Integer, Hash)>] CustomFile data, response status code and response headers
1302
+ def get_custom_file_with_http_info(custom_file_id, opts = {})
1389
1303
  if @api_client.config.debugging
1390
- @api_client.config.logger.debug 'Calling API: Client.get_combined_submission ...'
1304
+ @api_client.config.logger.debug 'Calling API: Client.get_custom_file ...'
1391
1305
  end
1392
- # verify the required parameter 'combined_submission_id' is set
1393
- if @api_client.config.client_side_validation && combined_submission_id.nil?
1394
- fail ArgumentError, "Missing the required parameter 'combined_submission_id' when calling Client.get_combined_submission"
1306
+ # verify the required parameter 'custom_file_id' is set
1307
+ if @api_client.config.client_side_validation && custom_file_id.nil?
1308
+ fail ArgumentError, "Missing the required parameter 'custom_file_id' when calling Client.get_custom_file"
1395
1309
  end
1396
1310
  # resource path
1397
- local_var_path = '/combined_submissions/{combined_submission_id}'.sub('{' + 'combined_submission_id' + '}', CGI.escape(combined_submission_id.to_s))
1311
+ local_var_path = '/custom_files/{custom_file_id}'.sub('{custom_file_id}', CGI.escape(custom_file_id.to_s))
1398
1312
 
1399
1313
  # query parameters
1400
1314
  query_params = opts[:query_params] || {}
@@ -1411,13 +1325,13 @@ end
1411
1325
  post_body = opts[:debug_body]
1412
1326
 
1413
1327
  # return_type
1414
- return_type = opts[:debug_return_type] || 'CombinedSubmission'
1328
+ return_type = opts[:debug_return_type] || 'CustomFile'
1415
1329
 
1416
1330
  # auth_names
1417
1331
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
1418
1332
 
1419
1333
  new_options = opts.merge(
1420
- :operation => :"Client.get_combined_submission",
1334
+ :operation => :"Client.get_custom_file",
1421
1335
  :header_params => header_params,
1422
1336
  :query_params => query_params,
1423
1337
  :form_params => form_params,
@@ -1428,36 +1342,36 @@ end
1428
1342
 
1429
1343
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1430
1344
  if @api_client.config.debugging
1431
- @api_client.config.logger.debug "API called: Client#get_combined_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1345
+ @api_client.config.logger.debug "API called: Client#get_custom_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1432
1346
  end
1433
1347
  return data, status_code, headers
1434
1348
  end
1435
1349
 
1436
- # Look up a submission data request
1437
- # Retrieves the details and status of a data request. Returns information about the request state (pending, viewed, completed), authentication details, and metadata. Includes audit information like IP address, browseruser agent, and timestamps. See also: - [Embedded Data Requests Guide](https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/) - Complete guide to data request workflow
1438
- # @param data_request_id [String]
1350
+ # Get a folder
1351
+ # Returns a folder.
1352
+ # @param folder_id [String] The folder's ID.
1439
1353
  # @param [Hash] opts the optional parameters
1440
- # @return [SubmissionDataRequestShow]
1441
- def get_data_request(data_request_id, opts = {})
1442
- data, _status_code, _headers = get_data_request_with_http_info(data_request_id, opts)
1354
+ # @return [Folder]
1355
+ def get_folder(folder_id, opts = {})
1356
+ data, _status_code, _headers = get_folder_with_http_info(folder_id, opts)
1443
1357
  data
1444
1358
  end
1445
1359
 
1446
- # Look up a submission data request
1447
- # Retrieves the details and status of a data request. Returns information about the request state (pending, viewed, completed), authentication details, and metadata. Includes audit information like IP address, browseruser agent, and timestamps. See also: - [Embedded Data Requests Guide](https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/) - Complete guide to data request workflow
1448
- # @param data_request_id [String]
1360
+ # Get a folder
1361
+ # Returns a folder.
1362
+ # @param folder_id [String] The folder's ID.
1449
1363
  # @param [Hash] opts the optional parameters
1450
- # @return [Array<(SubmissionDataRequestShow, Integer, Hash)>] SubmissionDataRequestShow data, response status code and response headers
1451
- def get_data_request_with_http_info(data_request_id, opts = {})
1364
+ # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers
1365
+ def get_folder_with_http_info(folder_id, opts = {})
1452
1366
  if @api_client.config.debugging
1453
- @api_client.config.logger.debug 'Calling API: Client.get_data_request ...'
1367
+ @api_client.config.logger.debug 'Calling API: Client.get_folder ...'
1454
1368
  end
1455
- # verify the required parameter 'data_request_id' is set
1456
- if @api_client.config.client_side_validation && data_request_id.nil?
1457
- fail ArgumentError, "Missing the required parameter 'data_request_id' when calling Client.get_data_request"
1369
+ # verify the required parameter 'folder_id' is set
1370
+ if @api_client.config.client_side_validation && folder_id.nil?
1371
+ fail ArgumentError, "Missing the required parameter 'folder_id' when calling Client.get_folder"
1458
1372
  end
1459
1373
  # resource path
1460
- local_var_path = '/data_requests/{data_request_id}'.sub('{' + 'data_request_id' + '}', CGI.escape(data_request_id.to_s))
1374
+ local_var_path = '/folders/{folder_id}'.sub('{folder_id}', CGI.escape(folder_id.to_s))
1461
1375
 
1462
1376
  # query parameters
1463
1377
  query_params = opts[:query_params] || {}
@@ -1474,13 +1388,13 @@ end
1474
1388
  post_body = opts[:debug_body]
1475
1389
 
1476
1390
  # return_type
1477
- return_type = opts[:debug_return_type] || 'SubmissionDataRequestShow'
1391
+ return_type = opts[:debug_return_type] || 'Folder'
1478
1392
 
1479
1393
  # auth_names
1480
1394
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
1481
1395
 
1482
1396
  new_options = opts.merge(
1483
- :operation => :"Client.get_data_request",
1397
+ :operation => :"Client.get_folder",
1484
1398
  :header_params => header_params,
1485
1399
  :query_params => query_params,
1486
1400
  :form_params => form_params,
@@ -1491,36 +1405,30 @@ end
1491
1405
 
1492
1406
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1493
1407
  if @api_client.config.debugging
1494
- @api_client.config.logger.debug "API called: Client#get_data_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1408
+ @api_client.config.logger.debug "API called: Client#get_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1495
1409
  end
1496
1410
  return data, status_code, headers
1497
1411
  end
1498
1412
 
1499
- # Fetch the full attributes for a PDF template
1500
- # Retrieves complete template information including fields, defaults, settings, and HTML/SCSS content. Use this to get all template data needed for automated updates or analysis. Returns more detailed information than the basic `getTemplate` endpoint.
1501
- # @param template_id [String]
1413
+ # Get a presigned URL to upload a file
1414
+ # Returns a presigned S3 form for uploading a file directly to DocSpring, for files too large to send in a request body. POST the `fields` and the file (as `file`) to `url` as multipart/form-data, then pass `fields.key` as the `cache_id` when you create a custom file.
1502
1415
  # @param [Hash] opts the optional parameters
1503
- # @return [Template]
1504
- def get_full_template(template_id, opts = {})
1505
- data, _status_code, _headers = get_full_template_with_http_info(template_id, opts)
1416
+ # @return [UploadPresign]
1417
+ def get_presign_url(opts = {})
1418
+ data, _status_code, _headers = get_presign_url_with_http_info(opts)
1506
1419
  data
1507
1420
  end
1508
1421
 
1509
- # Fetch the full attributes for a PDF template
1510
- # Retrieves complete template information including fields, defaults, settings, and HTML/SCSS content. Use this to get all template data needed for automated updates or analysis. Returns more detailed information than the basic &#x60;getTemplate&#x60; endpoint.
1511
- # @param template_id [String]
1422
+ # Get a presigned URL to upload a file
1423
+ # Returns a presigned S3 form for uploading a file directly to DocSpring, for files too large to send in a request body. POST the `fields` and the file (as `file`) to `url` as multipart/form-data, then pass `fields.key` as the `cache_id` when you create a custom file.
1512
1424
  # @param [Hash] opts the optional parameters
1513
- # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
1514
- def get_full_template_with_http_info(template_id, opts = {})
1425
+ # @return [Array<(UploadPresign, Integer, Hash)>] UploadPresign data, response status code and response headers
1426
+ def get_presign_url_with_http_info(opts = {})
1515
1427
  if @api_client.config.debugging
1516
- @api_client.config.logger.debug 'Calling API: Client.get_full_template ...'
1517
- end
1518
- # verify the required parameter 'template_id' is set
1519
- if @api_client.config.client_side_validation && template_id.nil?
1520
- fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.get_full_template"
1428
+ @api_client.config.logger.debug 'Calling API: Client.get_presign_url ...'
1521
1429
  end
1522
1430
  # resource path
1523
- local_var_path = '/templates/{template_id}?full=true'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
1431
+ local_var_path = '/uploads/presign'
1524
1432
 
1525
1433
  # query parameters
1526
1434
  query_params = opts[:query_params] || {}
@@ -1537,13 +1445,13 @@ end
1537
1445
  post_body = opts[:debug_body]
1538
1446
 
1539
1447
  # return_type
1540
- return_type = opts[:debug_return_type] || 'Template'
1448
+ return_type = opts[:debug_return_type] || 'UploadPresign'
1541
1449
 
1542
1450
  # auth_names
1543
1451
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
1544
1452
 
1545
1453
  new_options = opts.merge(
1546
- :operation => :"Client.get_full_template",
1454
+ :operation => :"Client.get_presign_url",
1547
1455
  :header_params => header_params,
1548
1456
  :query_params => query_params,
1549
1457
  :form_params => form_params,
@@ -1554,30 +1462,36 @@ end
1554
1462
 
1555
1463
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1556
1464
  if @api_client.config.debugging
1557
- @api_client.config.logger.debug "API called: Client#get_full_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1465
+ @api_client.config.logger.debug "API called: Client#get_presign_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1558
1466
  end
1559
1467
  return data, status_code, headers
1560
1468
  end
1561
1469
 
1562
- # Get a presigned S3 URL for direct file upload
1563
- # Returns a presigned S3 URL for uploading files directly to our S3 bucket. Use this endpoint to upload large files before creating templates or custom files. S3 will respond with a JSON object that you can include in your DocSpring API request. Uploaded files can be used to: - [Create templates](https://docspring.com/docs/api/#tag/templates/post/templates?endpoint_variant=create_template_from_cached_upload) - [Update templates](https://docspring.com/docs/api/#tag/templates/put/templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_upload) - [Create custom files](https://docspring.com/docs/api/#tag/custom-files/post/custom_files) and then [merge them with other PDFs](https://docspring.com/docs/api/#tag/combine-pdfs/post/combined_submissions)
1470
+ # Get a signature request
1471
+ # Returns a signature request, with the values the person has entered so far.
1472
+ # @param signature_request_id [String] The signature request's ID.
1564
1473
  # @param [Hash] opts the optional parameters
1565
- # @return [UploadPresignResponse]
1566
- def get_presign_url(opts = {})
1567
- data, _status_code, _headers = get_presign_url_with_http_info(opts)
1474
+ # @return [SignatureRequest]
1475
+ def get_signature_request(signature_request_id, opts = {})
1476
+ data, _status_code, _headers = get_signature_request_with_http_info(signature_request_id, opts)
1568
1477
  data
1569
1478
  end
1570
1479
 
1571
- # Get a presigned S3 URL for direct file upload
1572
- # Returns a presigned S3 URL for uploading files directly to our S3 bucket. Use this endpoint to upload large files before creating templates or custom files. S3 will respond with a JSON object that you can include in your DocSpring API request. Uploaded files can be used to: - [Create templates](https://docspring.com/docs/api/#tag/templates/post/templates?endpoint_variant&#x3D;create_template_from_cached_upload) - [Update templates](https://docspring.com/docs/api/#tag/templates/put/templates/{template_id}?endpoint_variant&#x3D;update_template_pdf_with_cached_upload) - [Create custom files](https://docspring.com/docs/api/#tag/custom-files/post/custom_files) and then [merge them with other PDFs](https://docspring.com/docs/api/#tag/combine-pdfs/post/combined_submissions)
1480
+ # Get a signature request
1481
+ # Returns a signature request, with the values the person has entered so far.
1482
+ # @param signature_request_id [String] The signature request's ID.
1573
1483
  # @param [Hash] opts the optional parameters
1574
- # @return [Array<(UploadPresignResponse, Integer, Hash)>] UploadPresignResponse data, response status code and response headers
1575
- def get_presign_url_with_http_info(opts = {})
1484
+ # @return [Array<(SignatureRequest, Integer, Hash)>] SignatureRequest data, response status code and response headers
1485
+ def get_signature_request_with_http_info(signature_request_id, opts = {})
1576
1486
  if @api_client.config.debugging
1577
- @api_client.config.logger.debug 'Calling API: Client.get_presign_url ...'
1487
+ @api_client.config.logger.debug 'Calling API: Client.get_signature_request ...'
1488
+ end
1489
+ # verify the required parameter 'signature_request_id' is set
1490
+ if @api_client.config.client_side_validation && signature_request_id.nil?
1491
+ fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling Client.get_signature_request"
1578
1492
  end
1579
1493
  # resource path
1580
- local_var_path = '/uploads/presign'
1494
+ local_var_path = '/signature_requests/{signature_request_id}'.sub('{signature_request_id}', CGI.escape(signature_request_id.to_s))
1581
1495
 
1582
1496
  # query parameters
1583
1497
  query_params = opts[:query_params] || {}
@@ -1594,13 +1508,13 @@ end
1594
1508
  post_body = opts[:debug_body]
1595
1509
 
1596
1510
  # return_type
1597
- return_type = opts[:debug_return_type] || 'UploadPresignResponse'
1511
+ return_type = opts[:debug_return_type] || 'SignatureRequest'
1598
1512
 
1599
1513
  # auth_names
1600
1514
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
1601
1515
 
1602
1516
  new_options = opts.merge(
1603
- :operation => :"Client.get_presign_url",
1517
+ :operation => :"Client.get_signature_request",
1604
1518
  :header_params => header_params,
1605
1519
  :query_params => query_params,
1606
1520
  :form_params => form_params,
@@ -1611,27 +1525,25 @@ end
1611
1525
 
1612
1526
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1613
1527
  if @api_client.config.debugging
1614
- @api_client.config.logger.debug "API called: Client#get_presign_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1528
+ @api_client.config.logger.debug "API called: Client#get_signature_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1615
1529
  end
1616
1530
  return data, status_code, headers
1617
1531
  end
1618
1532
 
1619
- # Check the status of a PDF
1620
- # Retrieves the details and status of a PDF submission. Returns processing state, download URL (if processed), metadata, submission data (optional), and information about any integrated actions. Use this to poll for completion when using asynchronous processing. `insufficient_credits` means the submission is waiting for credits and is processed once you add them. If it's still waiting after 30 days, it moves to `error`.
1621
- # @param submission_id [String]
1533
+ # Get a submission
1534
+ # Returns a submission, with its data and links to download its PDF.
1535
+ # @param submission_id [String] The submission's ID.
1622
1536
  # @param [Hash] opts the optional parameters
1623
- # @option opts [Boolean] :include_data
1624
1537
  # @return [Submission]
1625
1538
  def get_submission(submission_id, opts = {})
1626
1539
  data, _status_code, _headers = get_submission_with_http_info(submission_id, opts)
1627
1540
  data
1628
1541
  end
1629
1542
 
1630
- # Check the status of a PDF
1631
- # Retrieves the details and status of a PDF submission. Returns processing state, download URL (if processed), metadata, submission data (optional), and information about any integrated actions. Use this to poll for completion when using asynchronous processing. &#x60;insufficient_credits&#x60; means the submission is waiting for credits and is processed once you add them. If it&#39;s still waiting after 30 days, it moves to &#x60;error&#x60;.
1632
- # @param submission_id [String]
1543
+ # Get a submission
1544
+ # Returns a submission, with its data and links to download its PDF.
1545
+ # @param submission_id [String] The submission's ID.
1633
1546
  # @param [Hash] opts the optional parameters
1634
- # @option opts [Boolean] :include_data
1635
1547
  # @return [Array<(Submission, Integer, Hash)>] Submission data, response status code and response headers
1636
1548
  def get_submission_with_http_info(submission_id, opts = {})
1637
1549
  if @api_client.config.debugging
@@ -1642,11 +1554,10 @@ end
1642
1554
  fail ArgumentError, "Missing the required parameter 'submission_id' when calling Client.get_submission"
1643
1555
  end
1644
1556
  # resource path
1645
- local_var_path = '/submissions/{submission_id}'.sub('{' + 'submission_id' + '}', CGI.escape(submission_id.to_s))
1557
+ local_var_path = '/submissions/{submission_id}'.sub('{submission_id}', CGI.escape(submission_id.to_s))
1646
1558
 
1647
1559
  # query parameters
1648
1560
  query_params = opts[:query_params] || {}
1649
- query_params[:'include_data'] = opts[:'include_data'] if !opts[:'include_data'].nil?
1650
1561
 
1651
1562
  # header parameters
1652
1563
  header_params = opts[:header_params] || {}
@@ -1682,23 +1593,23 @@ end
1682
1593
  return data, status_code, headers
1683
1594
  end
1684
1595
 
1685
- # Check the status of a submission batch job
1686
- # Retrieves the status and results of a batch PDF generation job. Returns processing state, completion statistics, and optionally includes all individual submission details. Use this to poll for completion when using asynchronous batch processing. Submissions waiting for credits are in the `insufficient_credits` state and count as pending, so the batch stays `pending` until you add credits or they stop waiting after 30 days.
1687
- # @param submission_batch_id [String]
1596
+ # Get a batch
1597
+ # Returns a batch with its submissions. The batch has finished once `processed_at` is set: its `state` is `processed` when every PDF was generated, or `error` when any submission failed.
1598
+ # @param submission_batch_id [String] The batch's ID.
1688
1599
  # @param [Hash] opts the optional parameters
1689
- # @option opts [Boolean] :include_submissions
1690
- # @return [SubmissionBatchWithSubmissions]
1600
+ # @option opts [Boolean] :include_data Include each submission's `data` (null without it).
1601
+ # @return [SubmissionBatch]
1691
1602
  def get_submission_batch(submission_batch_id, opts = {})
1692
1603
  data, _status_code, _headers = get_submission_batch_with_http_info(submission_batch_id, opts)
1693
1604
  data
1694
1605
  end
1695
1606
 
1696
- # Check the status of a submission batch job
1697
- # Retrieves the status and results of a batch PDF generation job. Returns processing state, completion statistics, and optionally includes all individual submission details. Use this to poll for completion when using asynchronous batch processing. Submissions waiting for credits are in the &#x60;insufficient_credits&#x60; state and count as pending, so the batch stays &#x60;pending&#x60; until you add credits or they stop waiting after 30 days.
1698
- # @param submission_batch_id [String]
1607
+ # Get a batch
1608
+ # Returns a batch with its submissions. The batch has finished once `processed_at` is set: its `state` is `processed` when every PDF was generated, or `error` when any submission failed.
1609
+ # @param submission_batch_id [String] The batch's ID.
1699
1610
  # @param [Hash] opts the optional parameters
1700
- # @option opts [Boolean] :include_submissions
1701
- # @return [Array<(SubmissionBatchWithSubmissions, Integer, Hash)>] SubmissionBatchWithSubmissions data, response status code and response headers
1611
+ # @option opts [Boolean] :include_data Include each submission's `data` (null without it).
1612
+ # @return [Array<(SubmissionBatch, Integer, Hash)>] SubmissionBatch data, response status code and response headers
1702
1613
  def get_submission_batch_with_http_info(submission_batch_id, opts = {})
1703
1614
  if @api_client.config.debugging
1704
1615
  @api_client.config.logger.debug 'Calling API: Client.get_submission_batch ...'
@@ -1708,11 +1619,11 @@ end
1708
1619
  fail ArgumentError, "Missing the required parameter 'submission_batch_id' when calling Client.get_submission_batch"
1709
1620
  end
1710
1621
  # resource path
1711
- local_var_path = '/submissions/batches/{submission_batch_id}'.sub('{' + 'submission_batch_id' + '}', CGI.escape(submission_batch_id.to_s))
1622
+ local_var_path = '/submissions/batches/{submission_batch_id}'.sub('{submission_batch_id}', CGI.escape(submission_batch_id.to_s))
1712
1623
 
1713
1624
  # query parameters
1714
1625
  query_params = opts[:query_params] || {}
1715
- query_params[:'include_submissions'] = opts[:'include_submissions'] if !opts[:'include_submissions'].nil?
1626
+ query_params[:'include_data'] = opts[:'include_data'] if !opts[:'include_data'].nil?
1716
1627
 
1717
1628
  # header parameters
1718
1629
  header_params = opts[:header_params] || {}
@@ -1726,7 +1637,7 @@ end
1726
1637
  post_body = opts[:debug_body]
1727
1638
 
1728
1639
  # return_type
1729
- return_type = opts[:debug_return_type] || 'SubmissionBatchWithSubmissions'
1640
+ return_type = opts[:debug_return_type] || 'SubmissionBatch'
1730
1641
 
1731
1642
  # auth_names
1732
1643
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -1748,21 +1659,23 @@ end
1748
1659
  return data, status_code, headers
1749
1660
  end
1750
1661
 
1751
- # Check the status of an uploaded template
1752
- # Retrieves information about a template including processing status and document URL. Use this to check if template is ready to view in the template editor or generate PDFs.
1753
- # @param template_id [String]
1662
+ # Get a template
1663
+ # Returns a template: its draft, or one of its published versions.
1664
+ # @param template_id [String] The template's ID.
1754
1665
  # @param [Hash] opts the optional parameters
1755
- # @return [TemplatePreview]
1666
+ # @option opts [String] :version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1667
+ # @return [Template]
1756
1668
  def get_template(template_id, opts = {})
1757
1669
  data, _status_code, _headers = get_template_with_http_info(template_id, opts)
1758
1670
  data
1759
1671
  end
1760
1672
 
1761
- # Check the status of an uploaded template
1762
- # Retrieves information about a template including processing status and document URL. Use this to check if template is ready to view in the template editor or generate PDFs.
1763
- # @param template_id [String]
1673
+ # Get a template
1674
+ # Returns a template: its draft, or one of its published versions.
1675
+ # @param template_id [String] The template's ID.
1764
1676
  # @param [Hash] opts the optional parameters
1765
- # @return [Array<(TemplatePreview, Integer, Hash)>] TemplatePreview data, response status code and response headers
1677
+ # @option opts [String] :version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1678
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
1766
1679
  def get_template_with_http_info(template_id, opts = {})
1767
1680
  if @api_client.config.debugging
1768
1681
  @api_client.config.logger.debug 'Calling API: Client.get_template ...'
@@ -1772,10 +1685,11 @@ end
1772
1685
  fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.get_template"
1773
1686
  end
1774
1687
  # resource path
1775
- local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
1688
+ local_var_path = '/templates/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s))
1776
1689
 
1777
1690
  # query parameters
1778
1691
  query_params = opts[:query_params] || {}
1692
+ query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?
1779
1693
 
1780
1694
  # header parameters
1781
1695
  header_params = opts[:header_params] || {}
@@ -1789,7 +1703,7 @@ end
1789
1703
  post_body = opts[:debug_body]
1790
1704
 
1791
1705
  # return_type
1792
- return_type = opts[:debug_return_type] || 'TemplatePreview'
1706
+ return_type = opts[:debug_return_type] || 'Template'
1793
1707
 
1794
1708
  # auth_names
1795
1709
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -1811,23 +1725,25 @@ end
1811
1725
  return data, status_code, headers
1812
1726
  end
1813
1727
 
1814
- # Generate typed model code for a template
1815
- # Generates typed model code for a template's submission data from its JSON schema, in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or Go. Build your submission data with the generated types so your app catches mistakes before it calls the API. `root_type_name` is the type that describes the whole submission data object, qualified with its namespace or package where there is one. Java returns every class in `code`, each under a `// ClassName.java` comment: split them into one file per class. A template with no named fields returns 422, since there are no types to generate. See also: - [Generate Model Code](https://docspring.com/docs/template-editor/generate-model-code/) - Use the generated types
1816
- # @param template_id [String]
1817
- # @param lang [String] The language to generate code for
1728
+ # Generate typed code for a template's submission data
1729
+ # Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or Go, so your app catches mistakes before it calls the API. `root_type_name` is the type of the whole `data` object. Java returns every class in `code`, each under a `// ClassName.java` comment. A template with no named fields returns 422.
1730
+ # @param template_id [String] The template's ID.
1731
+ # @param lang [ModelCodeLanguage] The language to generate the code in.
1818
1732
  # @param [Hash] opts the optional parameters
1819
- # @return [TemplateModelCodeResponse]
1733
+ # @option opts [String] :version The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default.
1734
+ # @return [TemplateModelCode]
1820
1735
  def get_template_model_code(template_id, lang, opts = {})
1821
1736
  data, _status_code, _headers = get_template_model_code_with_http_info(template_id, lang, opts)
1822
1737
  data
1823
1738
  end
1824
1739
 
1825
- # Generate typed model code for a template
1826
- # Generates typed model code for a template&#39;s submission data from its JSON schema, in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or Go. Build your submission data with the generated types so your app catches mistakes before it calls the API. &#x60;root_type_name&#x60; is the type that describes the whole submission data object, qualified with its namespace or package where there is one. Java returns every class in &#x60;code&#x60;, each under a &#x60;// ClassName.java&#x60; comment: split them into one file per class. A template with no named fields returns 422, since there are no types to generate. See also: - [Generate Model Code](https://docspring.com/docs/template-editor/generate-model-code/) - Use the generated types
1827
- # @param template_id [String]
1828
- # @param lang [String] The language to generate code for
1740
+ # Generate typed code for a template's submission data
1741
+ # Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or Go, so your app catches mistakes before it calls the API. `root_type_name` is the type of the whole `data` object. Java returns every class in `code`, each under a `// ClassName.java` comment. A template with no named fields returns 422.
1742
+ # @param template_id [String] The template's ID.
1743
+ # @param lang [ModelCodeLanguage] The language to generate the code in.
1829
1744
  # @param [Hash] opts the optional parameters
1830
- # @return [Array<(TemplateModelCodeResponse, Integer, Hash)>] TemplateModelCodeResponse data, response status code and response headers
1745
+ # @option opts [String] :version The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default.
1746
+ # @return [Array<(TemplateModelCode, Integer, Hash)>] TemplateModelCode data, response status code and response headers
1831
1747
  def get_template_model_code_with_http_info(template_id, lang, opts = {})
1832
1748
  if @api_client.config.debugging
1833
1749
  @api_client.config.logger.debug 'Calling API: Client.get_template_model_code ...'
@@ -1840,17 +1756,13 @@ end
1840
1756
  if @api_client.config.client_side_validation && lang.nil?
1841
1757
  fail ArgumentError, "Missing the required parameter 'lang' when calling Client.get_template_model_code"
1842
1758
  end
1843
- # verify enum value
1844
- allowable_values = ["typescript", "javascript", "ruby", "python", "php", "java", "csharp", "elixir", "go"]
1845
- if @api_client.config.client_side_validation && !allowable_values.include?(lang)
1846
- fail ArgumentError, "invalid value for \"lang\", must be one of #{allowable_values}"
1847
- end
1848
1759
  # resource path
1849
- local_var_path = '/templates/{template_id}/model_code'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
1760
+ local_var_path = '/templates/{template_id}/model_code'.sub('{template_id}', CGI.escape(template_id.to_s))
1850
1761
 
1851
1762
  # query parameters
1852
1763
  query_params = opts[:query_params] || {}
1853
1764
  query_params[:'lang'] = lang
1765
+ query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?
1854
1766
 
1855
1767
  # header parameters
1856
1768
  header_params = opts[:header_params] || {}
@@ -1864,7 +1776,7 @@ end
1864
1776
  post_body = opts[:debug_body]
1865
1777
 
1866
1778
  # return_type
1867
- return_type = opts[:debug_return_type] || 'TemplateModelCodeResponse'
1779
+ return_type = opts[:debug_return_type] || 'TemplateModelCode'
1868
1780
 
1869
1781
  # auth_names
1870
1782
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -1886,21 +1798,23 @@ end
1886
1798
  return data, status_code, headers
1887
1799
  end
1888
1800
 
1889
- # Fetch the JSON schema for a template
1890
- # Retrieves the JSON Schema definition for a template's fields. Use this to validate data before submitting it for PDF generation, or to build dynamic forms that match the template's field structure and validation requirements. See also: - [Generate PDFs Guide](https://docspring.com/docs/api-guide/generate-pdfs/generate-pdfs-via-api/) - Use schema to validate submission data
1891
- # @param template_id [String]
1801
+ # Get the JSON Schema of a template's submission data
1802
+ # Returns the JSON Schema that a submission's `data` must match. Use it to check data before you create submissions, or to build a form for the template's fields.
1803
+ # @param template_id [String] The template's ID.
1892
1804
  # @param [Hash] opts the optional parameters
1893
- # @return [JsonSchema]
1805
+ # @option opts [String] :version The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default.
1806
+ # @return [Hash<String, Object>]
1894
1807
  def get_template_schema(template_id, opts = {})
1895
1808
  data, _status_code, _headers = get_template_schema_with_http_info(template_id, opts)
1896
1809
  data
1897
1810
  end
1898
1811
 
1899
- # Fetch the JSON schema for a template
1900
- # Retrieves the JSON Schema definition for a template&#39;s fields. Use this to validate data before submitting it for PDF generation, or to build dynamic forms that match the template&#39;s field structure and validation requirements. See also: - [Generate PDFs Guide](https://docspring.com/docs/api-guide/generate-pdfs/generate-pdfs-via-api/) - Use schema to validate submission data
1901
- # @param template_id [String]
1812
+ # Get the JSON Schema of a template's submission data
1813
+ # Returns the JSON Schema that a submission's `data` must match. Use it to check data before you create submissions, or to build a form for the template's fields.
1814
+ # @param template_id [String] The template's ID.
1902
1815
  # @param [Hash] opts the optional parameters
1903
- # @return [Array<(JsonSchema, Integer, Hash)>] JsonSchema data, response status code and response headers
1816
+ # @option opts [String] :version The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default.
1817
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
1904
1818
  def get_template_schema_with_http_info(template_id, opts = {})
1905
1819
  if @api_client.config.debugging
1906
1820
  @api_client.config.logger.debug 'Calling API: Client.get_template_schema ...'
@@ -1910,10 +1824,11 @@ end
1910
1824
  fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.get_template_schema"
1911
1825
  end
1912
1826
  # resource path
1913
- local_var_path = '/templates/{template_id}/schema'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
1827
+ local_var_path = '/templates/{template_id}/schema'.sub('{template_id}', CGI.escape(template_id.to_s))
1914
1828
 
1915
1829
  # query parameters
1916
1830
  query_params = opts[:query_params] || {}
1831
+ query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?
1917
1832
 
1918
1833
  # header parameters
1919
1834
  header_params = opts[:header_params] || {}
@@ -1927,7 +1842,7 @@ end
1927
1842
  post_body = opts[:debug_body]
1928
1843
 
1929
1844
  # return_type
1930
- return_type = opts[:debug_return_type] || 'JsonSchema'
1845
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
1931
1846
 
1932
1847
  # auth_names
1933
1848
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -1950,8 +1865,8 @@ end
1950
1865
  end
1951
1866
 
1952
1867
  # Get a webhook
1953
- # Retrieves a single webhook by its ID.
1954
- # @param webhook_id [String]
1868
+ # Returns a webhook.
1869
+ # @param webhook_id [String] The webhook's ID.
1955
1870
  # @param [Hash] opts the optional parameters
1956
1871
  # @return [Webhook]
1957
1872
  def get_webhook(webhook_id, opts = {})
@@ -1960,8 +1875,8 @@ end
1960
1875
  end
1961
1876
 
1962
1877
  # Get a webhook
1963
- # Retrieves a single webhook by its ID.
1964
- # @param webhook_id [String]
1878
+ # Returns a webhook.
1879
+ # @param webhook_id [String] The webhook's ID.
1965
1880
  # @param [Hash] opts the optional parameters
1966
1881
  # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
1967
1882
  def get_webhook_with_http_info(webhook_id, opts = {})
@@ -1973,7 +1888,7 @@ end
1973
1888
  fail ArgumentError, "Missing the required parameter 'webhook_id' when calling Client.get_webhook"
1974
1889
  end
1975
1890
  # resource path
1976
- local_var_path = '/webhooks/{webhook_id}'.sub('{' + 'webhook_id' + '}', CGI.escape(webhook_id.to_s))
1891
+ local_var_path = '/webhooks/{webhook_id}'.sub('{webhook_id}', CGI.escape(webhook_id.to_s))
1977
1892
 
1978
1893
  # query parameters
1979
1894
  query_params = opts[:query_params] || {}
@@ -2012,46 +1927,97 @@ end
2012
1927
  return data, status_code, headers
2013
1928
  end
2014
1929
 
2015
- # Get a list of all combined submissions
2016
- # Returns a paginated list of combined submissions (merged PDFs) for your account. Includes processing status, expiration details, and download URLs for processed PDFs.
1930
+ # List combined PDFs
1931
+ # Returns the combined PDFs in your account, newest first, one page at a time.
2017
1932
  # @param [Hash] opts the optional parameters
2018
- # @option opts [Integer] :page Default: 1
2019
- # @option opts [Integer] :per_page Default: 50
2020
- # @return [Array<CombinedSubmission>]
2021
- def list_combined_submissions(opts = {})
2022
- data, _status_code, _headers = list_combined_submissions_with_http_info(opts)
1933
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
1934
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
1935
+ # @return [CombinedPdfList]
1936
+ def list_combined_pdfs(opts = {})
1937
+ data, _status_code, _headers = list_combined_pdfs_with_http_info(opts)
2023
1938
  data
2024
1939
  end
2025
1940
 
2026
- # Get a list of all combined submissions
2027
- # Returns a paginated list of combined submissions (merged PDFs) for your account. Includes processing status, expiration details, and download URLs for processed PDFs.
1941
+ # List combined PDFs
1942
+ # Returns the combined PDFs in your account, newest first, one page at a time.
2028
1943
  # @param [Hash] opts the optional parameters
2029
- # @option opts [Integer] :page Default: 1
2030
- # @option opts [Integer] :per_page Default: 50
2031
- # @return [Array<(Array<CombinedSubmission>, Integer, Hash)>] Array<CombinedSubmission> data, response status code and response headers
2032
- def list_combined_submissions_with_http_info(opts = {})
1944
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
1945
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
1946
+ # @return [Array<(CombinedPdfList, Integer, Hash)>] CombinedPdfList data, response status code and response headers
1947
+ def list_combined_pdfs_with_http_info(opts = {})
2033
1948
  if @api_client.config.debugging
2034
- @api_client.config.logger.debug 'Calling API: Client.list_combined_submissions ...'
2035
- end
2036
- if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
2037
- fail ArgumentError, 'invalid value for "opts[:"page"]" when calling Client.list_combined_submissions, must be greater than or equal to 1.'
1949
+ @api_client.config.logger.debug 'Calling API: Client.list_combined_pdfs ...'
2038
1950
  end
1951
+ # resource path
1952
+ local_var_path = '/combined_pdfs'
2039
1953
 
2040
- if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 50
2041
- fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling Client.list_combined_submissions, must be smaller than or equal to 50.'
2042
- end
1954
+ # query parameters
1955
+ query_params = opts[:query_params] || {}
1956
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1957
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1958
+
1959
+ # header parameters
1960
+ header_params = opts[:header_params] || {}
1961
+ # HTTP header 'Accept' (if needed)
1962
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1963
+
1964
+ # form parameters
1965
+ form_params = opts[:form_params] || {}
1966
+
1967
+ # http body (model)
1968
+ post_body = opts[:debug_body]
1969
+
1970
+ # return_type
1971
+ return_type = opts[:debug_return_type] || 'CombinedPdfList'
1972
+
1973
+ # auth_names
1974
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
1975
+
1976
+ new_options = opts.merge(
1977
+ :operation => :"Client.list_combined_pdfs",
1978
+ :header_params => header_params,
1979
+ :query_params => query_params,
1980
+ :form_params => form_params,
1981
+ :body => post_body,
1982
+ :auth_names => auth_names,
1983
+ :return_type => return_type
1984
+ )
2043
1985
 
2044
- if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
2045
- fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling Client.list_combined_submissions, must be greater than or equal to 1.'
1986
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1987
+ if @api_client.config.debugging
1988
+ @api_client.config.logger.debug "API called: Client#list_combined_pdfs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2046
1989
  end
1990
+ return data, status_code, headers
1991
+ end
1992
+
1993
+ # List custom files
1994
+ # Returns the custom files in your account, newest first, one page at a time.
1995
+ # @param [Hash] opts the optional parameters
1996
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
1997
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
1998
+ # @return [CustomFileList]
1999
+ def list_custom_files(opts = {})
2000
+ data, _status_code, _headers = list_custom_files_with_http_info(opts)
2001
+ data
2002
+ end
2047
2003
 
2004
+ # List custom files
2005
+ # Returns the custom files in your account, newest first, one page at a time.
2006
+ # @param [Hash] opts the optional parameters
2007
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
2008
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
2009
+ # @return [Array<(CustomFileList, Integer, Hash)>] CustomFileList data, response status code and response headers
2010
+ def list_custom_files_with_http_info(opts = {})
2011
+ if @api_client.config.debugging
2012
+ @api_client.config.logger.debug 'Calling API: Client.list_custom_files ...'
2013
+ end
2048
2014
  # resource path
2049
- local_var_path = '/combined_submissions'
2015
+ local_var_path = '/custom_files'
2050
2016
 
2051
2017
  # query parameters
2052
2018
  query_params = opts[:query_params] || {}
2053
- query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
2054
- query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
2019
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2020
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2055
2021
 
2056
2022
  # header parameters
2057
2023
  header_params = opts[:header_params] || {}
@@ -2065,13 +2031,13 @@ end
2065
2031
  post_body = opts[:debug_body]
2066
2032
 
2067
2033
  # return_type
2068
- return_type = opts[:debug_return_type] || 'Array<CombinedSubmission>'
2034
+ return_type = opts[:debug_return_type] || 'CustomFileList'
2069
2035
 
2070
2036
  # auth_names
2071
2037
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
2072
2038
 
2073
2039
  new_options = opts.merge(
2074
- :operation => :"Client.list_combined_submissions",
2040
+ :operation => :"Client.list_custom_files",
2075
2041
  :header_params => header_params,
2076
2042
  :query_params => query_params,
2077
2043
  :form_params => form_params,
@@ -2082,36 +2048,42 @@ end
2082
2048
 
2083
2049
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2084
2050
  if @api_client.config.debugging
2085
- @api_client.config.logger.debug "API called: Client#list_combined_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2051
+ @api_client.config.logger.debug "API called: Client#list_custom_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2086
2052
  end
2087
2053
  return data, status_code, headers
2088
2054
  end
2089
2055
 
2090
- # Get a list of all folders
2091
- # Returns a list of folders in your account. Can be filtered by parent folder ID to retrieve subfolders. Folders help organize templates and maintain a hierarchical structure.
2056
+ # List folders
2057
+ # Returns the folders in your account, newest first, one page at a time. Pass `parent_folder_id` to list the folders in one folder.
2092
2058
  # @param [Hash] opts the optional parameters
2093
- # @option opts [String] :parent_folder_id Filter By Folder Id
2094
- # @return [Array<Folder>]
2059
+ # @option opts [String] :parent_folder_id Only list the folders in this folder. Without it, the list has every folder, at any depth.
2060
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
2061
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
2062
+ # @return [FolderList]
2095
2063
  def list_folders(opts = {})
2096
2064
  data, _status_code, _headers = list_folders_with_http_info(opts)
2097
2065
  data
2098
2066
  end
2099
2067
 
2100
- # Get a list of all folders
2101
- # Returns a list of folders in your account. Can be filtered by parent folder ID to retrieve subfolders. Folders help organize templates and maintain a hierarchical structure.
2068
+ # List folders
2069
+ # Returns the folders in your account, newest first, one page at a time. Pass `parent_folder_id` to list the folders in one folder.
2102
2070
  # @param [Hash] opts the optional parameters
2103
- # @option opts [String] :parent_folder_id Filter By Folder Id
2104
- # @return [Array<(Array<Folder>, Integer, Hash)>] Array<Folder> data, response status code and response headers
2071
+ # @option opts [String] :parent_folder_id Only list the folders in this folder. Without it, the list has every folder, at any depth.
2072
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
2073
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
2074
+ # @return [Array<(FolderList, Integer, Hash)>] FolderList data, response status code and response headers
2105
2075
  def list_folders_with_http_info(opts = {})
2106
2076
  if @api_client.config.debugging
2107
2077
  @api_client.config.logger.debug 'Calling API: Client.list_folders ...'
2108
2078
  end
2109
2079
  # resource path
2110
- local_var_path = '/folders/'
2080
+ local_var_path = '/folders'
2111
2081
 
2112
2082
  # query parameters
2113
2083
  query_params = opts[:query_params] || {}
2114
2084
  query_params[:'parent_folder_id'] = opts[:'parent_folder_id'] if !opts[:'parent_folder_id'].nil?
2085
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2086
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2115
2087
 
2116
2088
  # header parameters
2117
2089
  header_params = opts[:header_params] || {}
@@ -2125,7 +2097,7 @@ end
2125
2097
  post_body = opts[:debug_body]
2126
2098
 
2127
2099
  # return_type
2128
- return_type = opts[:debug_return_type] || 'Array<Folder>'
2100
+ return_type = opts[:debug_return_type] || 'FolderList'
2129
2101
 
2130
2102
  # auth_names
2131
2103
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -2147,31 +2119,33 @@ end
2147
2119
  return data, status_code, headers
2148
2120
  end
2149
2121
 
2150
- # List all submissions
2151
- # Returns a paginated list of all PDF submissions across all templates in your account. Can be filtered by date range and submission type (test/live). Supports cursor-based pagination and optionally includes submission data for each result.
2122
+ # List submissions
2123
+ # Returns the submissions in your account, newest first, one page at a time. Lists leave out each submission's `data` unless you pass `include_data=true`.
2152
2124
  # @param [Hash] opts the optional parameters
2153
- # @option opts [String] :cursor
2154
- # @option opts [Integer] :limit
2155
- # @option opts [String] :created_after
2156
- # @option opts [String] :created_before
2157
- # @option opts [String] :type
2158
- # @option opts [Boolean] :include_data
2159
- # @return [ListSubmissionsResponse]
2125
+ # @option opts [String] :template_id Only list this template's submissions.
2126
+ # @option opts [Boolean] :test Only list test submissions (true) or live submissions (false).
2127
+ # @option opts [Time] :created_after Only list submissions created after this time (RFC 3339, such as `2025-01-31T09:00:00Z`).
2128
+ # @option opts [Time] :created_before Only list submissions created before this time.
2129
+ # @option opts [Boolean] :include_data Include each submission's `data` (null without it).
2130
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
2131
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
2132
+ # @return [SubmissionList]
2160
2133
  def list_submissions(opts = {})
2161
2134
  data, _status_code, _headers = list_submissions_with_http_info(opts)
2162
2135
  data
2163
2136
  end
2164
2137
 
2165
- # List all submissions
2166
- # Returns a paginated list of all PDF submissions across all templates in your account. Can be filtered by date range and submission type (test/live). Supports cursor-based pagination and optionally includes submission data for each result.
2138
+ # List submissions
2139
+ # Returns the submissions in your account, newest first, one page at a time. Lists leave out each submission's `data` unless you pass `include_data=true`.
2167
2140
  # @param [Hash] opts the optional parameters
2168
- # @option opts [String] :cursor
2169
- # @option opts [Integer] :limit
2170
- # @option opts [String] :created_after
2171
- # @option opts [String] :created_before
2172
- # @option opts [String] :type
2173
- # @option opts [Boolean] :include_data
2174
- # @return [Array<(ListSubmissionsResponse, Integer, Hash)>] ListSubmissionsResponse data, response status code and response headers
2141
+ # @option opts [String] :template_id Only list this template's submissions.
2142
+ # @option opts [Boolean] :test Only list test submissions (true) or live submissions (false).
2143
+ # @option opts [Time] :created_after Only list submissions created after this time (RFC 3339, such as `2025-01-31T09:00:00Z`).
2144
+ # @option opts [Time] :created_before Only list submissions created before this time.
2145
+ # @option opts [Boolean] :include_data Include each submission's `data` (null without it).
2146
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
2147
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
2148
+ # @return [Array<(SubmissionList, Integer, Hash)>] SubmissionList data, response status code and response headers
2175
2149
  def list_submissions_with_http_info(opts = {})
2176
2150
  if @api_client.config.debugging
2177
2151
  @api_client.config.logger.debug 'Calling API: Client.list_submissions ...'
@@ -2181,12 +2155,13 @@ end
2181
2155
 
2182
2156
  # query parameters
2183
2157
  query_params = opts[:query_params] || {}
2184
- query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2185
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2158
+ query_params[:'template_id'] = opts[:'template_id'] if !opts[:'template_id'].nil?
2159
+ query_params[:'test'] = opts[:'test'] if !opts[:'test'].nil?
2186
2160
  query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
2187
2161
  query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
2188
- query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
2189
2162
  query_params[:'include_data'] = opts[:'include_data'] if !opts[:'include_data'].nil?
2163
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2164
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2190
2165
 
2191
2166
  # header parameters
2192
2167
  header_params = opts[:header_params] || {}
@@ -2200,7 +2175,7 @@ end
2200
2175
  post_body = opts[:debug_body]
2201
2176
 
2202
2177
  # return_type
2203
- return_type = opts[:debug_return_type] || 'ListSubmissionsResponse'
2178
+ return_type = opts[:debug_return_type] || 'SubmissionList'
2204
2179
 
2205
2180
  # auth_names
2206
2181
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -2222,33 +2197,33 @@ end
2222
2197
  return data, status_code, headers
2223
2198
  end
2224
2199
 
2225
- # List all submissions for a given template
2226
- # Returns a paginated list of all submissions for a specific template. Can be filtered by date range, submission type (test/live), and optionally include submission data. Supports cursor-based pagination for efficient retrieval of large result sets.
2227
- # @param template_id [String]
2200
+ # List a template's submissions
2201
+ # Returns a template's submissions (from every version of the template), newest first.
2202
+ # @param template_id [String] The template's ID.
2228
2203
  # @param [Hash] opts the optional parameters
2229
- # @option opts [String] :cursor
2230
- # @option opts [Integer] :limit
2231
- # @option opts [String] :created_after
2232
- # @option opts [String] :created_before
2233
- # @option opts [String] :type
2234
- # @option opts [Boolean] :include_data
2235
- # @return [ListSubmissionsResponse]
2204
+ # @option opts [Boolean] :test Only list test submissions (true) or live submissions (false).
2205
+ # @option opts [Time] :created_after Only list submissions created after this time (RFC 3339, such as `2025-01-31T09:00:00Z`).
2206
+ # @option opts [Time] :created_before Only list submissions created before this time.
2207
+ # @option opts [Boolean] :include_data Include each submission's `data` (null without it).
2208
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
2209
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
2210
+ # @return [SubmissionList]
2236
2211
  def list_template_submissions(template_id, opts = {})
2237
2212
  data, _status_code, _headers = list_template_submissions_with_http_info(template_id, opts)
2238
2213
  data
2239
2214
  end
2240
2215
 
2241
- # List all submissions for a given template
2242
- # Returns a paginated list of all submissions for a specific template. Can be filtered by date range, submission type (test/live), and optionally include submission data. Supports cursor-based pagination for efficient retrieval of large result sets.
2243
- # @param template_id [String]
2216
+ # List a template's submissions
2217
+ # Returns a template's submissions (from every version of the template), newest first.
2218
+ # @param template_id [String] The template's ID.
2244
2219
  # @param [Hash] opts the optional parameters
2245
- # @option opts [String] :cursor
2246
- # @option opts [Integer] :limit
2247
- # @option opts [String] :created_after
2248
- # @option opts [String] :created_before
2249
- # @option opts [String] :type
2250
- # @option opts [Boolean] :include_data
2251
- # @return [Array<(ListSubmissionsResponse, Integer, Hash)>] ListSubmissionsResponse data, response status code and response headers
2220
+ # @option opts [Boolean] :test Only list test submissions (true) or live submissions (false).
2221
+ # @option opts [Time] :created_after Only list submissions created after this time (RFC 3339, such as `2025-01-31T09:00:00Z`).
2222
+ # @option opts [Time] :created_before Only list submissions created before this time.
2223
+ # @option opts [Boolean] :include_data Include each submission's `data` (null without it).
2224
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
2225
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
2226
+ # @return [Array<(SubmissionList, Integer, Hash)>] SubmissionList data, response status code and response headers
2252
2227
  def list_template_submissions_with_http_info(template_id, opts = {})
2253
2228
  if @api_client.config.debugging
2254
2229
  @api_client.config.logger.debug 'Calling API: Client.list_template_submissions ...'
@@ -2258,16 +2233,16 @@ end
2258
2233
  fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.list_template_submissions"
2259
2234
  end
2260
2235
  # resource path
2261
- local_var_path = '/templates/{template_id}/submissions'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
2236
+ local_var_path = '/templates/{template_id}/submissions'.sub('{template_id}', CGI.escape(template_id.to_s))
2262
2237
 
2263
2238
  # query parameters
2264
2239
  query_params = opts[:query_params] || {}
2265
- query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2266
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2240
+ query_params[:'test'] = opts[:'test'] if !opts[:'test'].nil?
2267
2241
  query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
2268
2242
  query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
2269
- query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
2270
2243
  query_params[:'include_data'] = opts[:'include_data'] if !opts[:'include_data'].nil?
2244
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2245
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2271
2246
 
2272
2247
  # header parameters
2273
2248
  header_params = opts[:header_params] || {}
@@ -2281,7 +2256,7 @@ end
2281
2256
  post_body = opts[:debug_body]
2282
2257
 
2283
2258
  # return_type
2284
- return_type = opts[:debug_return_type] || 'ListSubmissionsResponse'
2259
+ return_type = opts[:debug_return_type] || 'SubmissionList'
2285
2260
 
2286
2261
  # auth_names
2287
2262
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -2303,43 +2278,31 @@ end
2303
2278
  return data, status_code, headers
2304
2279
  end
2305
2280
 
2306
- # Get a list of all templates
2307
- # Retrieves a list of your templates with search, filtering, and pagination options. Returns basic template information including ID, name, type (PDF or HTML), and folder location. Supports text search by name and filtering by parent folder.
2281
+ # List templates
2282
+ # Returns the templates in your account (their drafts), newest first, one page at a time. Get a template by its ID for its HTML, defaults and published versions.
2308
2283
  # @param [Hash] opts the optional parameters
2309
- # @option opts [String] :query Search By Name
2310
- # @option opts [String] :parent_folder_id Filter By Folder Id
2311
- # @option opts [Integer] :page Default: 1
2312
- # @option opts [Integer] :per_page Default: 50
2313
- # @return [Array<TemplatePreview>]
2284
+ # @option opts [String] :query Only list templates whose name contains this text (ignoring case).
2285
+ # @option opts [String] :parent_folder_id Only list the templates in this folder (not in its subfolders).
2286
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
2287
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
2288
+ # @return [TemplateSummaryList]
2314
2289
  def list_templates(opts = {})
2315
2290
  data, _status_code, _headers = list_templates_with_http_info(opts)
2316
2291
  data
2317
2292
  end
2318
2293
 
2319
- # Get a list of all templates
2320
- # Retrieves a list of your templates with search, filtering, and pagination options. Returns basic template information including ID, name, type (PDF or HTML), and folder location. Supports text search by name and filtering by parent folder.
2294
+ # List templates
2295
+ # Returns the templates in your account (their drafts), newest first, one page at a time. Get a template by its ID for its HTML, defaults and published versions.
2321
2296
  # @param [Hash] opts the optional parameters
2322
- # @option opts [String] :query Search By Name
2323
- # @option opts [String] :parent_folder_id Filter By Folder Id
2324
- # @option opts [Integer] :page Default: 1
2325
- # @option opts [Integer] :per_page Default: 50
2326
- # @return [Array<(Array<TemplatePreview>, Integer, Hash)>] Array<TemplatePreview> data, response status code and response headers
2297
+ # @option opts [String] :query Only list templates whose name contains this text (ignoring case).
2298
+ # @option opts [String] :parent_folder_id Only list the templates in this folder (not in its subfolders).
2299
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
2300
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
2301
+ # @return [Array<(TemplateSummaryList, Integer, Hash)>] TemplateSummaryList data, response status code and response headers
2327
2302
  def list_templates_with_http_info(opts = {})
2328
2303
  if @api_client.config.debugging
2329
2304
  @api_client.config.logger.debug 'Calling API: Client.list_templates ...'
2330
2305
  end
2331
- if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
2332
- fail ArgumentError, 'invalid value for "opts[:"page"]" when calling Client.list_templates, must be greater than or equal to 1.'
2333
- end
2334
-
2335
- if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 50
2336
- fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling Client.list_templates, must be smaller than or equal to 50.'
2337
- end
2338
-
2339
- if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
2340
- fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling Client.list_templates, must be greater than or equal to 1.'
2341
- end
2342
-
2343
2306
  # resource path
2344
2307
  local_var_path = '/templates'
2345
2308
 
@@ -2347,8 +2310,8 @@ end
2347
2310
  query_params = opts[:query_params] || {}
2348
2311
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
2349
2312
  query_params[:'parent_folder_id'] = opts[:'parent_folder_id'] if !opts[:'parent_folder_id'].nil?
2350
- query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
2351
- query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
2313
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2314
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2352
2315
 
2353
2316
  # header parameters
2354
2317
  header_params = opts[:header_params] || {}
@@ -2362,7 +2325,7 @@ end
2362
2325
  post_body = opts[:debug_body]
2363
2326
 
2364
2327
  # return_type
2365
- return_type = opts[:debug_return_type] || 'Array<TemplatePreview>'
2328
+ return_type = opts[:debug_return_type] || 'TemplateSummaryList'
2366
2329
 
2367
2330
  # auth_names
2368
2331
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -2384,61 +2347,49 @@ end
2384
2347
  return data, status_code, headers
2385
2348
  end
2386
2349
 
2387
- # Get a list of all webhooks
2388
- # Returns a list of the webhooks configured for your account. Supports pagination and filtering by event type, mode, and the API token, template, or folder a webhook is scoped to.
2350
+ # List webhooks
2351
+ # Returns the webhooks in your account, newest first, one page at a time. Filter them by event type, mode, or the API token, template or folder they're scoped to.
2389
2352
  # @param [Hash] opts the optional parameters
2390
- # @option opts [Integer] :page Default: 1
2391
- # @option opts [Integer] :per_page Default: 50
2392
- # @option opts [String] :event_type Filter by a subscribed event type
2393
- # @option opts [String] :mode Filter by mode (test or live)
2394
- # @option opts [String] :template_id Filter by a scoped template ID
2395
- # @option opts [String] :folder_id Filter by a scoped folder ID
2396
- # @option opts [String] :api_token_id Filter by a scoped API token ID
2397
- # @return [Array<Webhook>]
2353
+ # @option opts [WebhookEventType] :event_type Only list webhooks that subscribe to this event.
2354
+ # @option opts [WebhookMode] :mode Only list webhooks set to this mode.
2355
+ # @option opts [String] :template_id Only list webhooks scoped to this template.
2356
+ # @option opts [String] :folder_id Only list webhooks scoped to this folder.
2357
+ # @option opts [String] :api_token_id Only list webhooks scoped to this API token.
2358
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
2359
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
2360
+ # @return [WebhookList]
2398
2361
  def list_webhooks(opts = {})
2399
2362
  data, _status_code, _headers = list_webhooks_with_http_info(opts)
2400
2363
  data
2401
2364
  end
2402
2365
 
2403
- # Get a list of all webhooks
2404
- # Returns a list of the webhooks configured for your account. Supports pagination and filtering by event type, mode, and the API token, template, or folder a webhook is scoped to.
2366
+ # List webhooks
2367
+ # Returns the webhooks in your account, newest first, one page at a time. Filter them by event type, mode, or the API token, template or folder they're scoped to.
2405
2368
  # @param [Hash] opts the optional parameters
2406
- # @option opts [Integer] :page Default: 1
2407
- # @option opts [Integer] :per_page Default: 50
2408
- # @option opts [String] :event_type Filter by a subscribed event type
2409
- # @option opts [String] :mode Filter by mode (test or live)
2410
- # @option opts [String] :template_id Filter by a scoped template ID
2411
- # @option opts [String] :folder_id Filter by a scoped folder ID
2412
- # @option opts [String] :api_token_id Filter by a scoped API token ID
2413
- # @return [Array<(Array<Webhook>, Integer, Hash)>] Array<Webhook> data, response status code and response headers
2369
+ # @option opts [WebhookEventType] :event_type Only list webhooks that subscribe to this event.
2370
+ # @option opts [WebhookMode] :mode Only list webhooks set to this mode.
2371
+ # @option opts [String] :template_id Only list webhooks scoped to this template.
2372
+ # @option opts [String] :folder_id Only list webhooks scoped to this folder.
2373
+ # @option opts [String] :api_token_id Only list webhooks scoped to this API token.
2374
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
2375
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
2376
+ # @return [Array<(WebhookList, Integer, Hash)>] WebhookList data, response status code and response headers
2414
2377
  def list_webhooks_with_http_info(opts = {})
2415
2378
  if @api_client.config.debugging
2416
2379
  @api_client.config.logger.debug 'Calling API: Client.list_webhooks ...'
2417
2380
  end
2418
- if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
2419
- fail ArgumentError, 'invalid value for "opts[:"page"]" when calling Client.list_webhooks, must be greater than or equal to 1.'
2420
- end
2421
-
2422
- if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
2423
- fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling Client.list_webhooks, must be smaller than or equal to 100.'
2424
- end
2425
-
2426
- if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
2427
- fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling Client.list_webhooks, must be greater than or equal to 1.'
2428
- end
2429
-
2430
2381
  # resource path
2431
2382
  local_var_path = '/webhooks'
2432
2383
 
2433
2384
  # query parameters
2434
2385
  query_params = opts[:query_params] || {}
2435
- query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
2436
- query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
2437
2386
  query_params[:'event_type'] = opts[:'event_type'] if !opts[:'event_type'].nil?
2438
2387
  query_params[:'mode'] = opts[:'mode'] if !opts[:'mode'].nil?
2439
2388
  query_params[:'template_id'] = opts[:'template_id'] if !opts[:'template_id'].nil?
2440
2389
  query_params[:'folder_id'] = opts[:'folder_id'] if !opts[:'folder_id'].nil?
2441
2390
  query_params[:'api_token_id'] = opts[:'api_token_id'] if !opts[:'api_token_id'].nil?
2391
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2392
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2442
2393
 
2443
2394
  # header parameters
2444
2395
  header_params = opts[:header_params] || {}
@@ -2452,7 +2403,7 @@ end
2452
2403
  post_body = opts[:debug_body]
2453
2404
 
2454
2405
  # return_type
2455
- return_type = opts[:debug_return_type] || 'Array<Webhook>'
2406
+ return_type = opts[:debug_return_type] || 'WebhookList'
2456
2407
 
2457
2408
  # auth_names
2458
2409
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -2475,36 +2426,36 @@ end
2475
2426
  end
2476
2427
 
2477
2428
  # Move a folder
2478
- # Moves a folder to a new parent folder or to the root level. All templates and subfolders within the folder are moved together. Cannot move a folder into one of its own subfolders.
2479
- # @param folder_id [String]
2480
- # @param data [MoveFolderData]
2429
+ # Moves a folder into another folder, or to the root with `parent_folder_id: null`. Its templates and folders move with it. A folder can't move into itself or one of its own folders.
2430
+ # @param folder_id [String] The folder's ID.
2431
+ # @param body [MoveFolderRequest] Where to move the folder.
2481
2432
  # @param [Hash] opts the optional parameters
2482
2433
  # @return [Folder]
2483
- def move_folder_to_folder(folder_id, data, opts = {})
2484
- data, _status_code, _headers = move_folder_to_folder_with_http_info(folder_id, data, opts)
2434
+ def move_folder(folder_id, body, opts = {})
2435
+ data, _status_code, _headers = move_folder_with_http_info(folder_id, body, opts)
2485
2436
  data
2486
2437
  end
2487
2438
 
2488
2439
  # Move a folder
2489
- # Moves a folder to a new parent folder or to the root level. All templates and subfolders within the folder are moved together. Cannot move a folder into one of its own subfolders.
2490
- # @param folder_id [String]
2491
- # @param data [MoveFolderData]
2440
+ # Moves a folder into another folder, or to the root with `parent_folder_id: null`. Its templates and folders move with it. A folder can't move into itself or one of its own folders.
2441
+ # @param folder_id [String] The folder's ID.
2442
+ # @param body [MoveFolderRequest] Where to move the folder.
2492
2443
  # @param [Hash] opts the optional parameters
2493
2444
  # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers
2494
- def move_folder_to_folder_with_http_info(folder_id, data, opts = {})
2445
+ def move_folder_with_http_info(folder_id, body, opts = {})
2495
2446
  if @api_client.config.debugging
2496
- @api_client.config.logger.debug 'Calling API: Client.move_folder_to_folder ...'
2447
+ @api_client.config.logger.debug 'Calling API: Client.move_folder ...'
2497
2448
  end
2498
2449
  # verify the required parameter 'folder_id' is set
2499
2450
  if @api_client.config.client_side_validation && folder_id.nil?
2500
- fail ArgumentError, "Missing the required parameter 'folder_id' when calling Client.move_folder_to_folder"
2451
+ fail ArgumentError, "Missing the required parameter 'folder_id' when calling Client.move_folder"
2501
2452
  end
2502
- # verify the required parameter 'data' is set
2503
- if @api_client.config.client_side_validation && data.nil?
2504
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.move_folder_to_folder"
2453
+ # verify the required parameter 'body' is set
2454
+ if @api_client.config.client_side_validation && body.nil?
2455
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.move_folder"
2505
2456
  end
2506
2457
  # resource path
2507
- local_var_path = '/folders/{folder_id}/move'.sub('{' + 'folder_id' + '}', CGI.escape(folder_id.to_s))
2458
+ local_var_path = '/folders/{folder_id}/move'.sub('{folder_id}', CGI.escape(folder_id.to_s))
2508
2459
 
2509
2460
  # query parameters
2510
2461
  query_params = opts[:query_params] || {}
@@ -2523,7 +2474,7 @@ end
2523
2474
  form_params = opts[:form_params] || {}
2524
2475
 
2525
2476
  # http body (model)
2526
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
2477
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
2527
2478
 
2528
2479
  # return_type
2529
2480
  return_type = opts[:debug_return_type] || 'Folder'
@@ -2532,7 +2483,7 @@ end
2532
2483
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
2533
2484
 
2534
2485
  new_options = opts.merge(
2535
- :operation => :"Client.move_folder_to_folder",
2486
+ :operation => :"Client.move_folder",
2536
2487
  :header_params => header_params,
2537
2488
  :query_params => query_params,
2538
2489
  :form_params => form_params,
@@ -2543,42 +2494,42 @@ end
2543
2494
 
2544
2495
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2545
2496
  if @api_client.config.debugging
2546
- @api_client.config.logger.debug "API called: Client#move_folder_to_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2497
+ @api_client.config.logger.debug "API called: Client#move_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2547
2498
  end
2548
2499
  return data, status_code, headers
2549
2500
  end
2550
2501
 
2551
- # Move Template to folder
2552
- # Moves a template to a different folder or to the root level. Use this to organize templates within your folders. Provide a folder ID to move to a specific folder, or `null` to move to the root level.
2553
- # @param template_id [String]
2554
- # @param data [MoveTemplateData]
2502
+ # Move a template to a folder
2503
+ # Moves a template and all of its published versions to a folder, or to the root (`null`).
2504
+ # @param template_id [String] The template's ID.
2505
+ # @param body [MoveTemplateRequest] Where to move the template.
2555
2506
  # @param [Hash] opts the optional parameters
2556
- # @return [TemplatePreview]
2557
- def move_template_to_folder(template_id, data, opts = {})
2558
- data, _status_code, _headers = move_template_to_folder_with_http_info(template_id, data, opts)
2507
+ # @return [Template]
2508
+ def move_template(template_id, body, opts = {})
2509
+ data, _status_code, _headers = move_template_with_http_info(template_id, body, opts)
2559
2510
  data
2560
2511
  end
2561
2512
 
2562
- # Move Template to folder
2563
- # Moves a template to a different folder or to the root level. Use this to organize templates within your folders. Provide a folder ID to move to a specific folder, or &#x60;null&#x60; to move to the root level.
2564
- # @param template_id [String]
2565
- # @param data [MoveTemplateData]
2513
+ # Move a template to a folder
2514
+ # Moves a template and all of its published versions to a folder, or to the root (`null`).
2515
+ # @param template_id [String] The template's ID.
2516
+ # @param body [MoveTemplateRequest] Where to move the template.
2566
2517
  # @param [Hash] opts the optional parameters
2567
- # @return [Array<(TemplatePreview, Integer, Hash)>] TemplatePreview data, response status code and response headers
2568
- def move_template_to_folder_with_http_info(template_id, data, opts = {})
2518
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
2519
+ def move_template_with_http_info(template_id, body, opts = {})
2569
2520
  if @api_client.config.debugging
2570
- @api_client.config.logger.debug 'Calling API: Client.move_template_to_folder ...'
2521
+ @api_client.config.logger.debug 'Calling API: Client.move_template ...'
2571
2522
  end
2572
2523
  # verify the required parameter 'template_id' is set
2573
2524
  if @api_client.config.client_side_validation && template_id.nil?
2574
- fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.move_template_to_folder"
2525
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.move_template"
2575
2526
  end
2576
- # verify the required parameter 'data' is set
2577
- if @api_client.config.client_side_validation && data.nil?
2578
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.move_template_to_folder"
2527
+ # verify the required parameter 'body' is set
2528
+ if @api_client.config.client_side_validation && body.nil?
2529
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.move_template"
2579
2530
  end
2580
2531
  # resource path
2581
- local_var_path = '/templates/{template_id}/move'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
2532
+ local_var_path = '/templates/{template_id}/move'.sub('{template_id}', CGI.escape(template_id.to_s))
2582
2533
 
2583
2534
  # query parameters
2584
2535
  query_params = opts[:query_params] || {}
@@ -2597,16 +2548,16 @@ end
2597
2548
  form_params = opts[:form_params] || {}
2598
2549
 
2599
2550
  # http body (model)
2600
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
2551
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
2601
2552
 
2602
2553
  # return_type
2603
- return_type = opts[:debug_return_type] || 'TemplatePreview'
2554
+ return_type = opts[:debug_return_type] || 'Template'
2604
2555
 
2605
2556
  # auth_names
2606
2557
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
2607
2558
 
2608
2559
  new_options = opts.merge(
2609
- :operation => :"Client.move_template_to_folder",
2560
+ :operation => :"Client.move_template",
2610
2561
  :header_params => header_params,
2611
2562
  :query_params => query_params,
2612
2563
  :form_params => form_params,
@@ -2617,29 +2568,29 @@ end
2617
2568
 
2618
2569
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2619
2570
  if @api_client.config.debugging
2620
- @api_client.config.logger.debug "API called: Client#move_template_to_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2571
+ @api_client.config.logger.debug "API called: Client#move_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2621
2572
  end
2622
2573
  return data, status_code, headers
2623
2574
  end
2624
2575
 
2625
2576
  # Publish a template version
2626
- # Publishes the current draft version of a template and creates a new immutable version with semantic versioning (major.minor.patch).
2627
- # @param template_id [String]
2628
- # @param data [PublishVersionData]
2577
+ # Publishes the template's draft as a new version that doesn't change. `version_type` says which part of the latest version number goes up.
2578
+ # @param template_id [String] The template's ID.
2579
+ # @param body [PublishTemplateVersionRequest] The version to publish.
2629
2580
  # @param [Hash] opts the optional parameters
2630
- # @return [TemplatePublishVersionResponse]
2631
- def publish_template_version(template_id, data, opts = {})
2632
- data, _status_code, _headers = publish_template_version_with_http_info(template_id, data, opts)
2581
+ # @return [TemplateVersion]
2582
+ def publish_template_version(template_id, body, opts = {})
2583
+ data, _status_code, _headers = publish_template_version_with_http_info(template_id, body, opts)
2633
2584
  data
2634
2585
  end
2635
2586
 
2636
2587
  # Publish a template version
2637
- # Publishes the current draft version of a template and creates a new immutable version with semantic versioning (major.minor.patch).
2638
- # @param template_id [String]
2639
- # @param data [PublishVersionData]
2588
+ # Publishes the template's draft as a new version that doesn't change. `version_type` says which part of the latest version number goes up.
2589
+ # @param template_id [String] The template's ID.
2590
+ # @param body [PublishTemplateVersionRequest] The version to publish.
2640
2591
  # @param [Hash] opts the optional parameters
2641
- # @return [Array<(TemplatePublishVersionResponse, Integer, Hash)>] TemplatePublishVersionResponse data, response status code and response headers
2642
- def publish_template_version_with_http_info(template_id, data, opts = {})
2592
+ # @return [Array<(TemplateVersion, Integer, Hash)>] TemplateVersion data, response status code and response headers
2593
+ def publish_template_version_with_http_info(template_id, body, opts = {})
2643
2594
  if @api_client.config.debugging
2644
2595
  @api_client.config.logger.debug 'Calling API: Client.publish_template_version ...'
2645
2596
  end
@@ -2647,12 +2598,12 @@ end
2647
2598
  if @api_client.config.client_side_validation && template_id.nil?
2648
2599
  fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.publish_template_version"
2649
2600
  end
2650
- # verify the required parameter 'data' is set
2651
- if @api_client.config.client_side_validation && data.nil?
2652
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.publish_template_version"
2601
+ # verify the required parameter 'body' is set
2602
+ if @api_client.config.client_side_validation && body.nil?
2603
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.publish_template_version"
2653
2604
  end
2654
2605
  # resource path
2655
- local_var_path = '/templates/{template_id}/publish_version'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
2606
+ local_var_path = '/templates/{template_id}/publish_version'.sub('{template_id}', CGI.escape(template_id.to_s))
2656
2607
 
2657
2608
  # query parameters
2658
2609
  query_params = opts[:query_params] || {}
@@ -2671,10 +2622,10 @@ end
2671
2622
  form_params = opts[:form_params] || {}
2672
2623
 
2673
2624
  # http body (model)
2674
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
2625
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
2675
2626
 
2676
2627
  # return_type
2677
- return_type = opts[:debug_return_type] || 'TemplatePublishVersionResponse'
2628
+ return_type = opts[:debug_return_type] || 'TemplateVersion'
2678
2629
 
2679
2630
  # auth_names
2680
2631
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -2697,23 +2648,23 @@ end
2697
2648
  end
2698
2649
 
2699
2650
  # Rename a folder
2700
- # Renames an existing folder. The new name must be unique within the same parent folder. This operation only changes the folder name, not its location or contents.
2701
- # @param folder_id [String]
2702
- # @param data [RenameFolderData]
2651
+ # Renames a folder. The name must be unique within its parent folder.
2652
+ # @param folder_id [String] The folder's ID.
2653
+ # @param body [RenameFolderRequest] The folder's new name.
2703
2654
  # @param [Hash] opts the optional parameters
2704
2655
  # @return [Folder]
2705
- def rename_folder(folder_id, data, opts = {})
2706
- data, _status_code, _headers = rename_folder_with_http_info(folder_id, data, opts)
2656
+ def rename_folder(folder_id, body, opts = {})
2657
+ data, _status_code, _headers = rename_folder_with_http_info(folder_id, body, opts)
2707
2658
  data
2708
2659
  end
2709
2660
 
2710
2661
  # Rename a folder
2711
- # Renames an existing folder. The new name must be unique within the same parent folder. This operation only changes the folder name, not its location or contents.
2712
- # @param folder_id [String]
2713
- # @param data [RenameFolderData]
2662
+ # Renames a folder. The name must be unique within its parent folder.
2663
+ # @param folder_id [String] The folder's ID.
2664
+ # @param body [RenameFolderRequest] The folder's new name.
2714
2665
  # @param [Hash] opts the optional parameters
2715
2666
  # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers
2716
- def rename_folder_with_http_info(folder_id, data, opts = {})
2667
+ def rename_folder_with_http_info(folder_id, body, opts = {})
2717
2668
  if @api_client.config.debugging
2718
2669
  @api_client.config.logger.debug 'Calling API: Client.rename_folder ...'
2719
2670
  end
@@ -2721,12 +2672,12 @@ end
2721
2672
  if @api_client.config.client_side_validation && folder_id.nil?
2722
2673
  fail ArgumentError, "Missing the required parameter 'folder_id' when calling Client.rename_folder"
2723
2674
  end
2724
- # verify the required parameter 'data' is set
2725
- if @api_client.config.client_side_validation && data.nil?
2726
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.rename_folder"
2675
+ # verify the required parameter 'body' is set
2676
+ if @api_client.config.client_side_validation && body.nil?
2677
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.rename_folder"
2727
2678
  end
2728
2679
  # resource path
2729
- local_var_path = '/folders/{folder_id}/rename'.sub('{' + 'folder_id' + '}', CGI.escape(folder_id.to_s))
2680
+ local_var_path = '/folders/{folder_id}/rename'.sub('{folder_id}', CGI.escape(folder_id.to_s))
2730
2681
 
2731
2682
  # query parameters
2732
2683
  query_params = opts[:query_params] || {}
@@ -2745,7 +2696,7 @@ end
2745
2696
  form_params = opts[:form_params] || {}
2746
2697
 
2747
2698
  # http body (model)
2748
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
2699
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
2749
2700
 
2750
2701
  # return_type
2751
2702
  return_type = opts[:debug_return_type] || 'Folder'
@@ -2771,23 +2722,23 @@ end
2771
2722
  end
2772
2723
 
2773
2724
  # Restore a template version
2774
- # Restores your template to a previously published version, copying that version's content and configuration to the current draft. Use this to revert changes or recover from an unwanted modification.
2775
- # @param template_id [String]
2776
- # @param data [RestoreVersionData]
2725
+ # Replaces the template's draft with a copy of one of its published versions.
2726
+ # @param template_id [String] The template's ID.
2727
+ # @param body [RestoreTemplateVersionRequest] The version to restore.
2777
2728
  # @param [Hash] opts the optional parameters
2778
- # @return [SuccessErrorResponse]
2779
- def restore_template_version(template_id, data, opts = {})
2780
- data, _status_code, _headers = restore_template_version_with_http_info(template_id, data, opts)
2729
+ # @return [Template]
2730
+ def restore_template_version(template_id, body, opts = {})
2731
+ data, _status_code, _headers = restore_template_version_with_http_info(template_id, body, opts)
2781
2732
  data
2782
2733
  end
2783
2734
 
2784
2735
  # Restore a template version
2785
- # Restores your template to a previously published version, copying that version&#39;s content and configuration to the current draft. Use this to revert changes or recover from an unwanted modification.
2786
- # @param template_id [String]
2787
- # @param data [RestoreVersionData]
2736
+ # Replaces the template's draft with a copy of one of its published versions.
2737
+ # @param template_id [String] The template's ID.
2738
+ # @param body [RestoreTemplateVersionRequest] The version to restore.
2788
2739
  # @param [Hash] opts the optional parameters
2789
- # @return [Array<(SuccessErrorResponse, Integer, Hash)>] SuccessErrorResponse data, response status code and response headers
2790
- def restore_template_version_with_http_info(template_id, data, opts = {})
2740
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
2741
+ def restore_template_version_with_http_info(template_id, body, opts = {})
2791
2742
  if @api_client.config.debugging
2792
2743
  @api_client.config.logger.debug 'Calling API: Client.restore_template_version ...'
2793
2744
  end
@@ -2795,12 +2746,12 @@ end
2795
2746
  if @api_client.config.client_side_validation && template_id.nil?
2796
2747
  fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.restore_template_version"
2797
2748
  end
2798
- # verify the required parameter 'data' is set
2799
- if @api_client.config.client_side_validation && data.nil?
2800
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.restore_template_version"
2749
+ # verify the required parameter 'body' is set
2750
+ if @api_client.config.client_side_validation && body.nil?
2751
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.restore_template_version"
2801
2752
  end
2802
2753
  # resource path
2803
- local_var_path = '/templates/{template_id}/restore_version'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
2754
+ local_var_path = '/templates/{template_id}/restore_version'.sub('{template_id}', CGI.escape(template_id.to_s))
2804
2755
 
2805
2756
  # query parameters
2806
2757
  query_params = opts[:query_params] || {}
@@ -2819,10 +2770,10 @@ end
2819
2770
  form_params = opts[:form_params] || {}
2820
2771
 
2821
2772
  # http body (model)
2822
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
2773
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
2823
2774
 
2824
2775
  # return_type
2825
- return_type = opts[:debug_return_type] || 'SuccessErrorResponse'
2776
+ return_type = opts[:debug_return_type] || 'Template'
2826
2777
 
2827
2778
  # auth_names
2828
2779
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -2845,18 +2796,18 @@ end
2845
2796
  end
2846
2797
 
2847
2798
  # Test authentication
2848
- # Checks whether your API token is valid by making an authenticated request. Returns a success response if authentication passes. This endpoint is useful for verifying credentials during setup or troubleshooting issues.
2799
+ # Checks whether your API token is valid by making an authenticated request. This endpoint is useful for verifying credentials during setup or troubleshooting issues.
2849
2800
  # @param [Hash] opts the optional parameters
2850
- # @return [SuccessErrorResponse]
2801
+ # @return [AuthenticationCheck]
2851
2802
  def test_authentication(opts = {})
2852
2803
  data, _status_code, _headers = test_authentication_with_http_info(opts)
2853
2804
  data
2854
2805
  end
2855
2806
 
2856
2807
  # Test authentication
2857
- # Checks whether your API token is valid by making an authenticated request. Returns a success response if authentication passes. This endpoint is useful for verifying credentials during setup or troubleshooting issues.
2808
+ # Checks whether your API token is valid by making an authenticated request. This endpoint is useful for verifying credentials during setup or troubleshooting issues.
2858
2809
  # @param [Hash] opts the optional parameters
2859
- # @return [Array<(SuccessErrorResponse, Integer, Hash)>] SuccessErrorResponse data, response status code and response headers
2810
+ # @return [Array<(AuthenticationCheck, Integer, Hash)>] AuthenticationCheck data, response status code and response headers
2860
2811
  def test_authentication_with_http_info(opts = {})
2861
2812
  if @api_client.config.debugging
2862
2813
  @api_client.config.logger.debug 'Calling API: Client.test_authentication ...'
@@ -2879,7 +2830,7 @@ end
2879
2830
  post_body = opts[:debug_body]
2880
2831
 
2881
2832
  # return_type
2882
- return_type = opts[:debug_return_type] || 'SuccessErrorResponse'
2833
+ return_type = opts[:debug_return_type] || 'AuthenticationCheck'
2883
2834
 
2884
2835
  # auth_names
2885
2836
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -2901,37 +2852,37 @@ end
2901
2852
  return data, status_code, headers
2902
2853
  end
2903
2854
 
2904
- # Update a submission data request
2905
- # Updates authentication details for a data request. Use this when a user logs in to record their authentication method, provider, session information, and hashed identifiers. Updates metadata and tracks authentication state changes for auditing and compliance.
2906
- # @param data_request_id [String]
2907
- # @param data [UpdateSubmissionDataRequestData]
2855
+ # Update a signature request
2856
+ # Changes a pending signature request's metadata, or how your app authenticated the person (for the audit trail). Once the person has opened it, only its metadata can be changed, and a completed or declined signature request can't be changed.
2857
+ # @param signature_request_id [String] The signature request's ID.
2858
+ # @param body [UpdateSignatureRequestRequest] The settings to change. Properties left out keep their values.
2908
2859
  # @param [Hash] opts the optional parameters
2909
- # @return [CreateSubmissionDataRequestResponse]
2910
- def update_data_request(data_request_id, data, opts = {})
2911
- data, _status_code, _headers = update_data_request_with_http_info(data_request_id, data, opts)
2860
+ # @return [SignatureRequest]
2861
+ def update_signature_request(signature_request_id, body, opts = {})
2862
+ data, _status_code, _headers = update_signature_request_with_http_info(signature_request_id, body, opts)
2912
2863
  data
2913
2864
  end
2914
2865
 
2915
- # Update a submission data request
2916
- # Updates authentication details for a data request. Use this when a user logs in to record their authentication method, provider, session information, and hashed identifiers. Updates metadata and tracks authentication state changes for auditing and compliance.
2917
- # @param data_request_id [String]
2918
- # @param data [UpdateSubmissionDataRequestData]
2866
+ # Update a signature request
2867
+ # Changes a pending signature request's metadata, or how your app authenticated the person (for the audit trail). Once the person has opened it, only its metadata can be changed, and a completed or declined signature request can't be changed.
2868
+ # @param signature_request_id [String] The signature request's ID.
2869
+ # @param body [UpdateSignatureRequestRequest] The settings to change. Properties left out keep their values.
2919
2870
  # @param [Hash] opts the optional parameters
2920
- # @return [Array<(CreateSubmissionDataRequestResponse, Integer, Hash)>] CreateSubmissionDataRequestResponse data, response status code and response headers
2921
- def update_data_request_with_http_info(data_request_id, data, opts = {})
2871
+ # @return [Array<(SignatureRequest, Integer, Hash)>] SignatureRequest data, response status code and response headers
2872
+ def update_signature_request_with_http_info(signature_request_id, body, opts = {})
2922
2873
  if @api_client.config.debugging
2923
- @api_client.config.logger.debug 'Calling API: Client.update_data_request ...'
2874
+ @api_client.config.logger.debug 'Calling API: Client.update_signature_request ...'
2924
2875
  end
2925
- # verify the required parameter 'data_request_id' is set
2926
- if @api_client.config.client_side_validation && data_request_id.nil?
2927
- fail ArgumentError, "Missing the required parameter 'data_request_id' when calling Client.update_data_request"
2876
+ # verify the required parameter 'signature_request_id' is set
2877
+ if @api_client.config.client_side_validation && signature_request_id.nil?
2878
+ fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling Client.update_signature_request"
2928
2879
  end
2929
- # verify the required parameter 'data' is set
2930
- if @api_client.config.client_side_validation && data.nil?
2931
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.update_data_request"
2880
+ # verify the required parameter 'body' is set
2881
+ if @api_client.config.client_side_validation && body.nil?
2882
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.update_signature_request"
2932
2883
  end
2933
2884
  # resource path
2934
- local_var_path = '/data_requests/{data_request_id}'.sub('{' + 'data_request_id' + '}', CGI.escape(data_request_id.to_s))
2885
+ local_var_path = '/signature_requests/{signature_request_id}'.sub('{signature_request_id}', CGI.escape(signature_request_id.to_s))
2935
2886
 
2936
2887
  # query parameters
2937
2888
  query_params = opts[:query_params] || {}
@@ -2950,16 +2901,16 @@ end
2950
2901
  form_params = opts[:form_params] || {}
2951
2902
 
2952
2903
  # http body (model)
2953
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
2904
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
2954
2905
 
2955
2906
  # return_type
2956
- return_type = opts[:debug_return_type] || 'CreateSubmissionDataRequestResponse'
2907
+ return_type = opts[:debug_return_type] || 'SignatureRequest'
2957
2908
 
2958
2909
  # auth_names
2959
2910
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
2960
2911
 
2961
2912
  new_options = opts.merge(
2962
- :operation => :"Client.update_data_request",
2913
+ :operation => :"Client.update_signature_request",
2963
2914
  :header_params => header_params,
2964
2915
  :query_params => query_params,
2965
2916
  :form_params => form_params,
@@ -2970,29 +2921,29 @@ end
2970
2921
 
2971
2922
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
2972
2923
  if @api_client.config.debugging
2973
- @api_client.config.logger.debug "API called: Client#update_data_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2924
+ @api_client.config.logger.debug "API called: Client#update_signature_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2974
2925
  end
2975
2926
  return data, status_code, headers
2976
2927
  end
2977
2928
 
2978
- # Update a Template
2979
- # Updates template content and properties. For HTML templates, you can modify the HTML, SCSS, headers, footers, name, and description. Changes are applied to your draft template and do not affect published template versions. The exception is `parent_folder_id`: moving the template to another folder moves its published versions too.
2980
- # @param template_id [String]
2981
- # @param data [UpdateHtmlTemplate]
2929
+ # Update a template
2930
+ # Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object. Setting `parent_folder_id` moves the template and all of its published versions.
2931
+ # @param template_id [String] The template's ID.
2932
+ # @param body [UpdateTemplateRequest] The settings to change. Properties left out keep their values.
2982
2933
  # @param [Hash] opts the optional parameters
2983
- # @return [SuccessMultipleErrorsResponse]
2984
- def update_template(template_id, data, opts = {})
2985
- data, _status_code, _headers = update_template_with_http_info(template_id, data, opts)
2934
+ # @return [Template]
2935
+ def update_template(template_id, body, opts = {})
2936
+ data, _status_code, _headers = update_template_with_http_info(template_id, body, opts)
2986
2937
  data
2987
2938
  end
2988
2939
 
2989
- # Update a Template
2990
- # Updates template content and properties. For HTML templates, you can modify the HTML, SCSS, headers, footers, name, and description. Changes are applied to your draft template and do not affect published template versions. The exception is &#x60;parent_folder_id&#x60;: moving the template to another folder moves its published versions too.
2991
- # @param template_id [String]
2992
- # @param data [UpdateHtmlTemplate]
2940
+ # Update a template
2941
+ # Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object. Setting `parent_folder_id` moves the template and all of its published versions.
2942
+ # @param template_id [String] The template's ID.
2943
+ # @param body [UpdateTemplateRequest] The settings to change. Properties left out keep their values.
2993
2944
  # @param [Hash] opts the optional parameters
2994
- # @return [Array<(SuccessMultipleErrorsResponse, Integer, Hash)>] SuccessMultipleErrorsResponse data, response status code and response headers
2995
- def update_template_with_http_info(template_id, data, opts = {})
2945
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
2946
+ def update_template_with_http_info(template_id, body, opts = {})
2996
2947
  if @api_client.config.debugging
2997
2948
  @api_client.config.logger.debug 'Calling API: Client.update_template ...'
2998
2949
  end
@@ -3000,12 +2951,12 @@ end
3000
2951
  if @api_client.config.client_side_validation && template_id.nil?
3001
2952
  fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.update_template"
3002
2953
  end
3003
- # verify the required parameter 'data' is set
3004
- if @api_client.config.client_side_validation && data.nil?
3005
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.update_template"
2954
+ # verify the required parameter 'body' is set
2955
+ if @api_client.config.client_side_validation && body.nil?
2956
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.update_template"
3006
2957
  end
3007
2958
  # resource path
3008
- local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
2959
+ local_var_path = '/templates/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s))
3009
2960
 
3010
2961
  # query parameters
3011
2962
  query_params = opts[:query_params] || {}
@@ -3024,10 +2975,10 @@ end
3024
2975
  form_params = opts[:form_params] || {}
3025
2976
 
3026
2977
  # http body (model)
3027
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
2978
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
3028
2979
 
3029
2980
  # return_type
3030
- return_type = opts[:debug_return_type] || 'SuccessMultipleErrorsResponse'
2981
+ return_type = opts[:debug_return_type] || 'Template'
3031
2982
 
3032
2983
  # auth_names
3033
2984
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -3049,26 +3000,26 @@ end
3049
3000
  return data, status_code, headers
3050
3001
  end
3051
3002
 
3052
- # Update a template's document with a form POST file upload
3053
- # Upload a new PDF file to update a PDF template's document. This replaces the template's PDF while preserving all of the existing fields. If you upload a PDF with fewer pages than the current document, any fields on the removed pages will be deleted.
3054
- # @param template_id [String]
3055
- # @param template_document [File]
3003
+ # Replace a template's PDF
3004
+ # Replaces a PDF template's PDF with one you uploaded with the presigned upload (GET /uploads/presign). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields. To send the PDF with the request instead, use PUT /templates/{template_id}/document/upload.
3005
+ # @param template_id [String] The template's ID.
3006
+ # @param body [UpdateTemplateDocumentRequest] The new PDF.
3056
3007
  # @param [Hash] opts the optional parameters
3057
- # @option opts [String] :template_name
3058
- # @return [SuccessMultipleErrorsResponse]
3059
- def update_template_document(template_id, template_document, opts = {})
3060
- data, _status_code, _headers = update_template_document_with_http_info(template_id, template_document, opts)
3008
+ # @option opts [Boolean] :wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
3009
+ # @return [Template]
3010
+ def update_template_document(template_id, body, opts = {})
3011
+ data, _status_code, _headers = update_template_document_with_http_info(template_id, body, opts)
3061
3012
  data
3062
3013
  end
3063
3014
 
3064
- # Update a template&#39;s document with a form POST file upload
3065
- # Upload a new PDF file to update a PDF template&#39;s document. This replaces the template&#39;s PDF while preserving all of the existing fields. If you upload a PDF with fewer pages than the current document, any fields on the removed pages will be deleted.
3066
- # @param template_id [String]
3067
- # @param template_document [File]
3015
+ # Replace a template's PDF
3016
+ # Replaces a PDF template's PDF with one you uploaded with the presigned upload (GET /uploads/presign). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields. To send the PDF with the request instead, use PUT /templates/{template_id}/document/upload.
3017
+ # @param template_id [String] The template's ID.
3018
+ # @param body [UpdateTemplateDocumentRequest] The new PDF.
3068
3019
  # @param [Hash] opts the optional parameters
3069
- # @option opts [String] :template_name
3070
- # @return [Array<(SuccessMultipleErrorsResponse, Integer, Hash)>] SuccessMultipleErrorsResponse data, response status code and response headers
3071
- def update_template_document_with_http_info(template_id, template_document, opts = {})
3020
+ # @option opts [Boolean] :wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
3021
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
3022
+ def update_template_document_with_http_info(template_id, body, opts = {})
3072
3023
  if @api_client.config.debugging
3073
3024
  @api_client.config.logger.debug 'Calling API: Client.update_template_document ...'
3074
3025
  end
@@ -3076,36 +3027,35 @@ end
3076
3027
  if @api_client.config.client_side_validation && template_id.nil?
3077
3028
  fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.update_template_document"
3078
3029
  end
3079
- # verify the required parameter 'template_document' is set
3080
- if @api_client.config.client_side_validation && template_document.nil?
3081
- fail ArgumentError, "Missing the required parameter 'template_document' when calling Client.update_template_document"
3030
+ # verify the required parameter 'body' is set
3031
+ if @api_client.config.client_side_validation && body.nil?
3032
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.update_template_document"
3082
3033
  end
3083
3034
  # resource path
3084
- local_var_path = '/templates/{template_id}?endpoint_variant=update_template_pdf_with_form_post'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
3035
+ local_var_path = '/templates/{template_id}/document'.sub('{template_id}', CGI.escape(template_id.to_s))
3085
3036
 
3086
3037
  # query parameters
3087
3038
  query_params = opts[:query_params] || {}
3039
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
3088
3040
 
3089
3041
  # header parameters
3090
3042
  header_params = opts[:header_params] || {}
3091
3043
  # HTTP header 'Accept' (if needed)
3092
3044
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3093
3045
  # HTTP header 'Content-Type'
3094
- content_type = @api_client.select_header_content_type(['multipart/form-data'])
3046
+ content_type = @api_client.select_header_content_type(['application/json'])
3095
3047
  if !content_type.nil?
3096
3048
  header_params['Content-Type'] = content_type
3097
3049
  end
3098
3050
 
3099
3051
  # form parameters
3100
3052
  form_params = opts[:form_params] || {}
3101
- form_params['template[document]'] = template_document
3102
- form_params['template[name]'] = opts[:'template_name'] if !opts[:'template_name'].nil?
3103
3053
 
3104
3054
  # http body (model)
3105
- post_body = opts[:debug_body]
3055
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
3106
3056
 
3107
3057
  # return_type
3108
- return_type = opts[:debug_return_type] || 'SuccessMultipleErrorsResponse'
3058
+ return_type = opts[:debug_return_type] || 'Template'
3109
3059
 
3110
3060
  # auth_names
3111
3061
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
@@ -3127,37 +3077,37 @@ end
3127
3077
  return data, status_code, headers
3128
3078
  end
3129
3079
 
3130
- # Update a template's document with a cached S3 file upload
3131
- # Updates a PDF template's document using a cached file upload. This is a three-step process: First, request a presigned URL to upload your PDF file to our S3 bucket. Then, use that URL to upload your PDF file. Finally, submit the ID of the uploaded file to replace the template's document.
3132
- # @param template_id [String]
3133
- # @param data [UpdatePdfTemplate]
3080
+ # Update a webhook
3081
+ # Updates a webhook. Only the properties you send change.
3082
+ # @param webhook_id [String] The webhook's ID.
3083
+ # @param body [UpdateWebhookRequest] The settings to change. Properties left out keep their values.
3134
3084
  # @param [Hash] opts the optional parameters
3135
- # @return [SuccessMultipleErrorsResponse]
3136
- def update_template_document_from_upload(template_id, data, opts = {})
3137
- data, _status_code, _headers = update_template_document_from_upload_with_http_info(template_id, data, opts)
3085
+ # @return [Webhook]
3086
+ def update_webhook(webhook_id, body, opts = {})
3087
+ data, _status_code, _headers = update_webhook_with_http_info(webhook_id, body, opts)
3138
3088
  data
3139
3089
  end
3140
3090
 
3141
- # Update a template&#39;s document with a cached S3 file upload
3142
- # Updates a PDF template&#39;s document using a cached file upload. This is a three-step process: First, request a presigned URL to upload your PDF file to our S3 bucket. Then, use that URL to upload your PDF file. Finally, submit the ID of the uploaded file to replace the template&#39;s document.
3143
- # @param template_id [String]
3144
- # @param data [UpdatePdfTemplate]
3091
+ # Update a webhook
3092
+ # Updates a webhook. Only the properties you send change.
3093
+ # @param webhook_id [String] The webhook's ID.
3094
+ # @param body [UpdateWebhookRequest] The settings to change. Properties left out keep their values.
3145
3095
  # @param [Hash] opts the optional parameters
3146
- # @return [Array<(SuccessMultipleErrorsResponse, Integer, Hash)>] SuccessMultipleErrorsResponse data, response status code and response headers
3147
- def update_template_document_from_upload_with_http_info(template_id, data, opts = {})
3096
+ # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
3097
+ def update_webhook_with_http_info(webhook_id, body, opts = {})
3148
3098
  if @api_client.config.debugging
3149
- @api_client.config.logger.debug 'Calling API: Client.update_template_document_from_upload ...'
3099
+ @api_client.config.logger.debug 'Calling API: Client.update_webhook ...'
3150
3100
  end
3151
- # verify the required parameter 'template_id' is set
3152
- if @api_client.config.client_side_validation && template_id.nil?
3153
- fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.update_template_document_from_upload"
3101
+ # verify the required parameter 'webhook_id' is set
3102
+ if @api_client.config.client_side_validation && webhook_id.nil?
3103
+ fail ArgumentError, "Missing the required parameter 'webhook_id' when calling Client.update_webhook"
3154
3104
  end
3155
- # verify the required parameter 'data' is set
3156
- if @api_client.config.client_side_validation && data.nil?
3157
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.update_template_document_from_upload"
3105
+ # verify the required parameter 'body' is set
3106
+ if @api_client.config.client_side_validation && body.nil?
3107
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.update_webhook"
3158
3108
  end
3159
3109
  # resource path
3160
- local_var_path = '/templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_upload'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
3110
+ local_var_path = '/webhooks/{webhook_id}'.sub('{webhook_id}', CGI.escape(webhook_id.to_s))
3161
3111
 
3162
3112
  # query parameters
3163
3113
  query_params = opts[:query_params] || {}
@@ -3176,16 +3126,16 @@ end
3176
3126
  form_params = opts[:form_params] || {}
3177
3127
 
3178
3128
  # http body (model)
3179
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
3129
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
3180
3130
 
3181
3131
  # return_type
3182
- return_type = opts[:debug_return_type] || 'SuccessMultipleErrorsResponse'
3132
+ return_type = opts[:debug_return_type] || 'Webhook'
3183
3133
 
3184
3134
  # auth_names
3185
3135
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
3186
3136
 
3187
3137
  new_options = opts.merge(
3188
- :operation => :"Client.update_template_document_from_upload",
3138
+ :operation => :"Client.update_webhook",
3189
3139
  :header_params => header_params,
3190
3140
  :query_params => query_params,
3191
3141
  :form_params => form_params,
@@ -3196,70 +3146,173 @@ end
3196
3146
 
3197
3147
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
3198
3148
  if @api_client.config.debugging
3199
- @api_client.config.logger.debug "API called: Client#update_template_document_from_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3149
+ @api_client.config.logger.debug "API called: Client#update_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3200
3150
  end
3201
3151
  return data, status_code, headers
3202
3152
  end
3203
3153
 
3204
- # Update a webhook
3205
- # Updates the configuration of an existing webhook.
3206
- # @param webhook_id [String]
3207
- # @param data [UpdateWebhookData]
3154
+ # Create a PDF template from an uploaded PDF
3155
+ # Creates a PDF template from a PDF sent with the request (`multipart/form-data`). For large files, upload the PDF with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
3156
+ # @param document [File] The PDF.
3208
3157
  # @param [Hash] opts the optional parameters
3209
- # @return [Webhook]
3210
- def update_webhook(webhook_id, data, opts = {})
3211
- data, _status_code, _headers = update_webhook_with_http_info(webhook_id, data, opts)
3158
+ # @option opts [Boolean] :wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
3159
+ # @option opts [String] :name The template's name.
3160
+ # @option opts [String] :description The template's description.
3161
+ # @option opts [String] :parent_folder_id The folder to put the template in. Left out, it's created at the root.
3162
+ # @option opts [AiFieldNamingLanguage] :ai_field_naming_language The language AI field setup names fields in: `auto` uses the form's language when it's written in the Latin alphabet without accents, and English otherwise; `english` always uses English; `form_language` uses the form's language and script. Default: your account's template settings.
3163
+ # @option opts [Boolean] :detect_fields Set up the PDF's fields as DocSpring's "Automatically detect fields" upload option does: import or detect the fields, name them with AI, and set up conditional logic. `field_source`, `field_naming` and `field_logic` choose how. Default false. `document.page_processing_statuses` and `document.field_logic_status` show how it's going, and `document.state` becomes `processed` once every page's fields are set up.
3164
+ # @option opts [FieldSetupSource] :field_source With `detect_fields`, where the fields come from. `auto` (the default) imports the form fields of a fillable PDF and detects the fields of a PDF without them; `pdf_detection` detects the fields from the page layout, even on a fillable PDF; `pdf_form_fields` only imports the PDF's form fields.
3165
+ # @option opts [FieldSetupNaming] :field_naming With `detect_fields`, how the fields are named. `ai` (the default) names them and sets their types and settings with AI; `preserve` keeps the names of the PDF's form fields, and AI only names the fields it detected. `preserve` needs `field_source` `auto` or `pdf_form_fields`.
3166
+ # @option opts [FieldSetupLogic] :field_logic With `detect_fields`, whether AI reads the whole form once the fields are named and sets up conditional logic and required fields (`ai`) or not (`none`). Default: your account's template settings.
3167
+ # @return [Template]
3168
+ def upload_template(document, opts = {})
3169
+ data, _status_code, _headers = upload_template_with_http_info(document, opts)
3212
3170
  data
3213
3171
  end
3214
3172
 
3215
- # Update a webhook
3216
- # Updates the configuration of an existing webhook.
3217
- # @param webhook_id [String]
3218
- # @param data [UpdateWebhookData]
3173
+ # Create a PDF template from an uploaded PDF
3174
+ # Creates a PDF template from a PDF sent with the request (`multipart/form-data`). For large files, upload the PDF with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
3175
+ # @param document [File] The PDF.
3219
3176
  # @param [Hash] opts the optional parameters
3220
- # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
3221
- def update_webhook_with_http_info(webhook_id, data, opts = {})
3177
+ # @option opts [Boolean] :wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
3178
+ # @option opts [String] :name The template's name.
3179
+ # @option opts [String] :description The template's description.
3180
+ # @option opts [String] :parent_folder_id The folder to put the template in. Left out, it's created at the root.
3181
+ # @option opts [AiFieldNamingLanguage] :ai_field_naming_language The language AI field setup names fields in: `auto` uses the form's language when it's written in the Latin alphabet without accents, and English otherwise; `english` always uses English; `form_language` uses the form's language and script. Default: your account's template settings.
3182
+ # @option opts [Boolean] :detect_fields Set up the PDF's fields as DocSpring's "Automatically detect fields" upload option does: import or detect the fields, name them with AI, and set up conditional logic. `field_source`, `field_naming` and `field_logic` choose how. Default false. `document.page_processing_statuses` and `document.field_logic_status` show how it's going, and `document.state` becomes `processed` once every page's fields are set up.
3183
+ # @option opts [FieldSetupSource] :field_source With `detect_fields`, where the fields come from. `auto` (the default) imports the form fields of a fillable PDF and detects the fields of a PDF without them; `pdf_detection` detects the fields from the page layout, even on a fillable PDF; `pdf_form_fields` only imports the PDF's form fields.
3184
+ # @option opts [FieldSetupNaming] :field_naming With `detect_fields`, how the fields are named. `ai` (the default) names them and sets their types and settings with AI; `preserve` keeps the names of the PDF's form fields, and AI only names the fields it detected. `preserve` needs `field_source` `auto` or `pdf_form_fields`.
3185
+ # @option opts [FieldSetupLogic] :field_logic With `detect_fields`, whether AI reads the whole form once the fields are named and sets up conditional logic and required fields (`ai`) or not (`none`). Default: your account's template settings.
3186
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
3187
+ def upload_template_with_http_info(document, opts = {})
3222
3188
  if @api_client.config.debugging
3223
- @api_client.config.logger.debug 'Calling API: Client.update_webhook ...'
3189
+ @api_client.config.logger.debug 'Calling API: Client.upload_template ...'
3224
3190
  end
3225
- # verify the required parameter 'webhook_id' is set
3226
- if @api_client.config.client_side_validation && webhook_id.nil?
3227
- fail ArgumentError, "Missing the required parameter 'webhook_id' when calling Client.update_webhook"
3191
+ # verify the required parameter 'document' is set
3192
+ if @api_client.config.client_side_validation && document.nil?
3193
+ fail ArgumentError, "Missing the required parameter 'document' when calling Client.upload_template"
3228
3194
  end
3229
- # verify the required parameter 'data' is set
3230
- if @api_client.config.client_side_validation && data.nil?
3231
- fail ArgumentError, "Missing the required parameter 'data' when calling Client.update_webhook"
3195
+ # resource path
3196
+ local_var_path = '/templates/upload'
3197
+
3198
+ # query parameters
3199
+ query_params = opts[:query_params] || {}
3200
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
3201
+
3202
+ # header parameters
3203
+ header_params = opts[:header_params] || {}
3204
+ # HTTP header 'Accept' (if needed)
3205
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3206
+ # HTTP header 'Content-Type'
3207
+ content_type = @api_client.select_header_content_type(['multipart/form-data'])
3208
+ if !content_type.nil?
3209
+ header_params['Content-Type'] = content_type
3210
+ end
3211
+
3212
+ # form parameters
3213
+ form_params = opts[:form_params] || {}
3214
+ form_params['document'] = document
3215
+ form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
3216
+ form_params['description'] = opts[:'description'] if !opts[:'description'].nil?
3217
+ form_params['parent_folder_id'] = opts[:'parent_folder_id'] if !opts[:'parent_folder_id'].nil?
3218
+ form_params['ai_field_naming_language'] = opts[:'ai_field_naming_language'] if !opts[:'ai_field_naming_language'].nil?
3219
+ form_params['detect_fields'] = opts[:'detect_fields'] if !opts[:'detect_fields'].nil?
3220
+ form_params['field_source'] = opts[:'field_source'] if !opts[:'field_source'].nil?
3221
+ form_params['field_naming'] = opts[:'field_naming'] if !opts[:'field_naming'].nil?
3222
+ form_params['field_logic'] = opts[:'field_logic'] if !opts[:'field_logic'].nil?
3223
+
3224
+ # http body (model)
3225
+ post_body = opts[:debug_body]
3226
+
3227
+ # return_type
3228
+ return_type = opts[:debug_return_type] || 'Template'
3229
+
3230
+ # auth_names
3231
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
3232
+
3233
+ new_options = opts.merge(
3234
+ :operation => :"Client.upload_template",
3235
+ :header_params => header_params,
3236
+ :query_params => query_params,
3237
+ :form_params => form_params,
3238
+ :body => post_body,
3239
+ :auth_names => auth_names,
3240
+ :return_type => return_type
3241
+ )
3242
+
3243
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
3244
+ if @api_client.config.debugging
3245
+ @api_client.config.logger.debug "API called: Client#upload_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3246
+ end
3247
+ return data, status_code, headers
3248
+ end
3249
+
3250
+ # Replace a template's PDF with an uploaded PDF
3251
+ # Replaces a PDF template's PDF with one sent with the request (`multipart/form-data`). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields.
3252
+ # @param template_id [String] The template's ID.
3253
+ # @param document [File] The new PDF.
3254
+ # @param [Hash] opts the optional parameters
3255
+ # @option opts [Boolean] :wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
3256
+ # @option opts [Boolean] :reimport_fields Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (`document.field_reimport_state`). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields.
3257
+ # @return [Template]
3258
+ def upload_template_document(template_id, document, opts = {})
3259
+ data, _status_code, _headers = upload_template_document_with_http_info(template_id, document, opts)
3260
+ data
3261
+ end
3262
+
3263
+ # Replace a template's PDF with an uploaded PDF
3264
+ # Replaces a PDF template's PDF with one sent with the request (`multipart/form-data`). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields.
3265
+ # @param template_id [String] The template's ID.
3266
+ # @param document [File] The new PDF.
3267
+ # @param [Hash] opts the optional parameters
3268
+ # @option opts [Boolean] :wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
3269
+ # @option opts [Boolean] :reimport_fields Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (`document.field_reimport_state`). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields.
3270
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
3271
+ def upload_template_document_with_http_info(template_id, document, opts = {})
3272
+ if @api_client.config.debugging
3273
+ @api_client.config.logger.debug 'Calling API: Client.upload_template_document ...'
3274
+ end
3275
+ # verify the required parameter 'template_id' is set
3276
+ if @api_client.config.client_side_validation && template_id.nil?
3277
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.upload_template_document"
3278
+ end
3279
+ # verify the required parameter 'document' is set
3280
+ if @api_client.config.client_side_validation && document.nil?
3281
+ fail ArgumentError, "Missing the required parameter 'document' when calling Client.upload_template_document"
3232
3282
  end
3233
3283
  # resource path
3234
- local_var_path = '/webhooks/{webhook_id}'.sub('{' + 'webhook_id' + '}', CGI.escape(webhook_id.to_s))
3284
+ local_var_path = '/templates/{template_id}/document/upload'.sub('{template_id}', CGI.escape(template_id.to_s))
3235
3285
 
3236
3286
  # query parameters
3237
3287
  query_params = opts[:query_params] || {}
3288
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
3238
3289
 
3239
3290
  # header parameters
3240
3291
  header_params = opts[:header_params] || {}
3241
3292
  # HTTP header 'Accept' (if needed)
3242
3293
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3243
3294
  # HTTP header 'Content-Type'
3244
- content_type = @api_client.select_header_content_type(['application/json'])
3295
+ content_type = @api_client.select_header_content_type(['multipart/form-data'])
3245
3296
  if !content_type.nil?
3246
3297
  header_params['Content-Type'] = content_type
3247
3298
  end
3248
3299
 
3249
3300
  # form parameters
3250
3301
  form_params = opts[:form_params] || {}
3302
+ form_params['document'] = document
3303
+ form_params['reimport_fields'] = opts[:'reimport_fields'] if !opts[:'reimport_fields'].nil?
3251
3304
 
3252
3305
  # http body (model)
3253
- post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
3306
+ post_body = opts[:debug_body]
3254
3307
 
3255
3308
  # return_type
3256
- return_type = opts[:debug_return_type] || 'Webhook'
3309
+ return_type = opts[:debug_return_type] || 'Template'
3257
3310
 
3258
3311
  # auth_names
3259
3312
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
3260
3313
 
3261
3314
  new_options = opts.merge(
3262
- :operation => :"Client.update_webhook",
3315
+ :operation => :"Client.upload_template_document",
3263
3316
  :header_params => header_params,
3264
3317
  :query_params => query_params,
3265
3318
  :form_params => form_params,
@@ -3270,7 +3323,7 @@ end
3270
3323
 
3271
3324
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
3272
3325
  if @api_client.config.debugging
3273
- @api_client.config.logger.debug "API called: Client#update_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3326
+ @api_client.config.logger.debug "API called: Client#upload_template_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3274
3327
  end
3275
3328
  return data, status_code, headers
3276
3329
  end