docspring 4.1.0 → 4.3.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 (372) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +15 -0
  3. data/.travis.yml +1 -1
  4. data/AGENTS.md +5 -4
  5. data/CHANGELOG.md +67 -0
  6. data/Gemfile.lock +11 -10
  7. data/README.md +11 -6
  8. data/docs/Client.md +273 -105
  9. data/docs/CombinedPdf.md +1 -1
  10. data/docs/CreateCombinedPdfRequest.md +1 -1
  11. data/docs/CreateSubmissionRequest.md +5 -5
  12. data/docs/CreateTemplatePreviewRequest.md +18 -0
  13. data/docs/CreateTemplateRequest.md +14 -10
  14. data/docs/ErrorDetail.md +1 -1
  15. data/docs/ErrorInfo.md +4 -4
  16. data/docs/FieldGroup.md +2 -2
  17. data/docs/FieldGroupInput.md +1 -1
  18. data/docs/GenerateSubmissionFilesRequest.md +1 -1
  19. data/docs/GeneratedFile.md +2 -2
  20. data/docs/Submission.md +18 -18
  21. data/docs/SubmissionBatch.md +3 -3
  22. data/docs/SubmissionFiles.md +4 -0
  23. data/docs/SubmissionInput.md +5 -5
  24. data/docs/SubmissionList.md +1 -1
  25. data/docs/SubmissionSummary.md +54 -0
  26. data/docs/Template.md +21 -17
  27. data/docs/TemplateActor.md +1 -1
  28. data/docs/TemplateDiff.md +2 -2
  29. data/docs/TemplateDocument.md +12 -12
  30. data/docs/TemplateDocumentSummary.md +24 -0
  31. data/docs/TemplatePreview.md +32 -0
  32. data/docs/TemplatePreviewState.md +15 -0
  33. data/docs/TemplateSummary.md +5 -49
  34. data/docs/UpdateTemplateDocumentRequest.md +5 -5
  35. data/docs/UpdateTemplateRequest.md +10 -6
  36. data/docs/ValidateSubmissionRequest.md +5 -5
  37. data/docspring.gemspec +2 -2
  38. data/lib/docspring/api/client.rb +222 -49
  39. data/lib/docspring/api_client.rb +5 -3
  40. data/lib/docspring/api_error.rb +1 -1
  41. data/lib/docspring/api_model_base.rb +1 -1
  42. data/lib/docspring/configuration.rb +1 -1
  43. data/lib/docspring/date_time_values.rb +33 -0
  44. data/lib/docspring/models/add_template_fields_request.rb +1 -1
  45. data/lib/docspring/models/ai_field_naming_language.rb +1 -1
  46. data/lib/docspring/models/authentication_check.rb +1 -1
  47. data/lib/docspring/models/barcode_symbology.rb +1 -1
  48. data/lib/docspring/models/check_character.rb +1 -1
  49. data/lib/docspring/models/combined_field_type.rb +1 -1
  50. data/lib/docspring/models/combined_pdf.rb +2 -2
  51. data/lib/docspring/models/combined_pdf_files.rb +1 -1
  52. data/lib/docspring/models/combined_pdf_list.rb +1 -1
  53. data/lib/docspring/models/combined_pdf_source.rb +1 -1
  54. data/lib/docspring/models/combined_pdf_source_input.rb +1 -1
  55. data/lib/docspring/models/combined_pdf_source_pdf.rb +1 -1
  56. data/lib/docspring/models/combined_pdf_source_type.rb +1 -1
  57. data/lib/docspring/models/combined_pdf_state.rb +1 -1
  58. data/lib/docspring/models/copy_template_request.rb +1 -1
  59. data/lib/docspring/models/create_combined_pdf_request.rb +2 -2
  60. data/lib/docspring/models/create_custom_file_from_upload_request.rb +1 -1
  61. data/lib/docspring/models/create_folder_request.rb +1 -1
  62. data/lib/docspring/models/create_signature_request_event_request.rb +1 -1
  63. data/lib/docspring/models/create_signature_request_token_request.rb +1 -1
  64. data/lib/docspring/models/create_submission_batch_request.rb +1 -1
  65. data/lib/docspring/models/create_submission_request.rb +6 -6
  66. data/lib/docspring/models/create_template_preview_request.rb +187 -0
  67. data/lib/docspring/models/create_template_request.rb +32 -12
  68. data/lib/docspring/models/create_webhook_request.rb +1 -1
  69. data/lib/docspring/models/custom_file.rb +1 -1
  70. data/lib/docspring/models/custom_file_list.rb +1 -1
  71. data/lib/docspring/models/custom_file_source_pdf.rb +1 -1
  72. data/lib/docspring/models/error_code.rb +4 -2
  73. data/lib/docspring/models/error_detail.rb +2 -2
  74. data/lib/docspring/models/error_info.rb +5 -5
  75. data/lib/docspring/models/error_response.rb +1 -1
  76. data/lib/docspring/models/expiration_interval.rb +1 -1
  77. data/lib/docspring/models/field.rb +2 -2
  78. data/lib/docspring/models/field_comparison_condition.rb +1 -1
  79. data/lib/docspring/models/field_comparison_operator.rb +1 -1
  80. data/lib/docspring/models/field_dependency.rb +1 -1
  81. data/lib/docspring/models/field_dependency_input.rb +1 -1
  82. data/lib/docspring/models/field_display_type.rb +1 -1
  83. data/lib/docspring/models/field_equals_condition.rb +1 -1
  84. data/lib/docspring/models/field_equals_operator.rb +1 -1
  85. data/lib/docspring/models/field_group.rb +3 -3
  86. data/lib/docspring/models/field_group_input.rb +2 -2
  87. data/lib/docspring/models/field_group_type.rb +1 -1
  88. data/lib/docspring/models/field_in_condition.rb +1 -1
  89. data/lib/docspring/models/field_input.rb +2 -2
  90. data/lib/docspring/models/field_override.rb +1 -1
  91. data/lib/docspring/models/field_presence_condition.rb +1 -1
  92. data/lib/docspring/models/field_presence_operator.rb +1 -1
  93. data/lib/docspring/models/field_range_condition.rb +1 -1
  94. data/lib/docspring/models/field_reimport_state.rb +1 -1
  95. data/lib/docspring/models/field_setup_logic.rb +1 -1
  96. data/lib/docspring/models/field_setup_naming.rb +1 -1
  97. data/lib/docspring/models/field_setup_source.rb +1 -1
  98. data/lib/docspring/models/field_type.rb +1 -1
  99. data/lib/docspring/models/folder.rb +1 -1
  100. data/lib/docspring/models/folder_list.rb +1 -1
  101. data/lib/docspring/models/generate_files_format.rb +5 -2
  102. data/lib/docspring/models/generate_submission_files_request.rb +2 -2
  103. data/lib/docspring/models/generated_file.rb +4 -4
  104. data/lib/docspring/models/generated_file_state.rb +1 -1
  105. data/lib/docspring/models/html_engine_options.rb +1 -1
  106. data/lib/docspring/models/html_engine_options_input.rb +1 -1
  107. data/lib/docspring/models/image_gravity.rb +1 -1
  108. data/lib/docspring/models/image_scale_type.rb +1 -1
  109. data/lib/docspring/models/model_code_language.rb +3 -2
  110. data/lib/docspring/models/move_folder_request.rb +1 -1
  111. data/lib/docspring/models/move_template_request.rb +1 -1
  112. data/lib/docspring/models/number_condition_type.rb +1 -1
  113. data/lib/docspring/models/output_format.rb +4 -2
  114. data/lib/docspring/models/page_format.rb +1 -1
  115. data/lib/docspring/models/page_image.rb +1 -1
  116. data/lib/docspring/models/page_images.rb +1 -1
  117. data/lib/docspring/models/predefined_field.rb +1 -1
  118. data/lib/docspring/models/predefined_field_input.rb +1 -1
  119. data/lib/docspring/models/publish_template_version_request.rb +1 -1
  120. data/lib/docspring/models/remove_template_fields_request.rb +1 -1
  121. data/lib/docspring/models/rename_folder_request.rb +1 -1
  122. data/lib/docspring/models/reorder_template_fields_request.rb +1 -1
  123. data/lib/docspring/models/restore_template_version_request.rb +1 -1
  124. data/lib/docspring/models/shape_type.rb +1 -1
  125. data/lib/docspring/models/signature_request.rb +1 -1
  126. data/lib/docspring/models/signature_request_auth_second_factor_type.rb +1 -1
  127. data/lib/docspring/models/signature_request_auth_type.rb +1 -1
  128. data/lib/docspring/models/signature_request_event.rb +1 -1
  129. data/lib/docspring/models/signature_request_event_type.rb +1 -1
  130. data/lib/docspring/models/signature_request_input.rb +1 -1
  131. data/lib/docspring/models/signature_request_message_type.rb +1 -1
  132. data/lib/docspring/models/signature_request_state.rb +1 -1
  133. data/lib/docspring/models/signature_request_token.rb +1 -1
  134. data/lib/docspring/models/signature_request_token_type.rb +1 -1
  135. data/lib/docspring/models/string_condition_type.rb +1 -1
  136. data/lib/docspring/models/submission.rb +145 -145
  137. data/lib/docspring/models/submission_action.rb +1 -1
  138. data/lib/docspring/models/submission_action_state.rb +1 -1
  139. data/lib/docspring/models/submission_action_type.rb +1 -1
  140. data/lib/docspring/models/submission_batch.rb +5 -5
  141. data/lib/docspring/models/submission_batch_state.rb +1 -1
  142. data/lib/docspring/models/submission_files.rb +22 -2
  143. data/lib/docspring/models/submission_input.rb +6 -6
  144. data/lib/docspring/models/submission_list.rb +2 -2
  145. data/lib/docspring/models/submission_source.rb +1 -1
  146. data/lib/docspring/models/submission_source_pdf.rb +1 -1
  147. data/lib/docspring/models/submission_state.rb +1 -1
  148. data/lib/docspring/models/submission_summary.rb +601 -0
  149. data/lib/docspring/models/submission_validation.rb +1 -1
  150. data/lib/docspring/models/template.rb +131 -91
  151. data/lib/docspring/models/template_actor.rb +2 -2
  152. data/lib/docspring/models/template_actor_type.rb +1 -1
  153. data/lib/docspring/models/template_defaults.rb +1 -1
  154. data/lib/docspring/models/template_defaults_input.rb +1 -1
  155. data/lib/docspring/models/template_diff.rb +3 -3
  156. data/lib/docspring/models/template_diff_summary.rb +1 -1
  157. data/lib/docspring/models/template_document.rb +51 -51
  158. data/lib/docspring/models/template_document_state.rb +4 -2
  159. data/lib/docspring/models/template_document_summary.rb +260 -0
  160. data/lib/docspring/models/template_field_change.rb +1 -1
  161. data/lib/docspring/models/template_field_changes.rb +1 -1
  162. data/lib/docspring/models/template_field_dependency.rb +1 -1
  163. data/lib/docspring/models/template_field_dependency_action.rb +1 -1
  164. data/lib/docspring/models/template_field_dependency_condition.rb +1 -1
  165. data/lib/docspring/models/template_field_dependency_condition_input.rb +1 -1
  166. data/lib/docspring/models/template_field_dependency_input.rb +1 -1
  167. data/lib/docspring/models/template_field_dependency_match.rb +1 -1
  168. data/lib/docspring/models/template_field_dependency_operator.rb +1 -1
  169. data/lib/docspring/models/template_field_logic_status.rb +1 -1
  170. data/lib/docspring/models/template_field_move.rb +1 -1
  171. data/lib/docspring/models/template_fields.rb +1 -1
  172. data/lib/docspring/models/template_form_mode.rb +1 -1
  173. data/lib/docspring/models/template_model_code.rb +1 -1
  174. data/lib/docspring/models/template_page_ai_error.rb +1 -1
  175. data/lib/docspring/models/template_page_ai_naming_status.rb +1 -1
  176. data/lib/docspring/models/template_page_fields_status.rb +1 -1
  177. data/lib/docspring/models/template_page_image_status.rb +1 -1
  178. data/lib/docspring/models/template_page_images.rb +1 -1
  179. data/lib/docspring/models/template_page_processing_status.rb +1 -1
  180. data/lib/docspring/models/template_preview.rb +356 -0
  181. data/lib/docspring/models/template_preview_state.rb +42 -0
  182. data/lib/docspring/models/template_source_pdf.rb +1 -1
  183. data/lib/docspring/models/template_summary.rb +34 -574
  184. data/lib/docspring/models/template_summary_list.rb +1 -1
  185. data/lib/docspring/models/template_type.rb +3 -2
  186. data/lib/docspring/models/template_version.rb +1 -1
  187. data/lib/docspring/models/template_version_type.rb +1 -1
  188. data/lib/docspring/models/text_alignment.rb +1 -1
  189. data/lib/docspring/models/text_overflow.rb +1 -1
  190. data/lib/docspring/models/text_vertical_alignment.rb +1 -1
  191. data/lib/docspring/models/typeface.rb +1 -1
  192. data/lib/docspring/models/update_signature_request_request.rb +1 -1
  193. data/lib/docspring/models/update_template_document_request.rb +7 -7
  194. data/lib/docspring/models/update_template_fields_request.rb +1 -1
  195. data/lib/docspring/models/update_template_request.rb +31 -11
  196. data/lib/docspring/models/update_webhook_request.rb +1 -1
  197. data/lib/docspring/models/upload_method.rb +1 -1
  198. data/lib/docspring/models/upload_presign.rb +1 -1
  199. data/lib/docspring/models/url_source_pdf.rb +1 -1
  200. data/lib/docspring/models/validate_submission_request.rb +6 -6
  201. data/lib/docspring/models/webhook.rb +1 -1
  202. data/lib/docspring/models/webhook_event_type.rb +1 -1
  203. data/lib/docspring/models/webhook_list.rb +1 -1
  204. data/lib/docspring/models/webhook_mode.rb +1 -1
  205. data/lib/docspring/request_schemas.json +144 -10
  206. data/lib/docspring/version.rb +2 -2
  207. data/lib/docspring/webhook_signature.rb +45 -0
  208. data/lib/docspring.rb +7 -1
  209. data/spec/api/client_spec.rb +61 -25
  210. data/spec/models/add_template_fields_request_spec.rb +1 -1
  211. data/spec/models/ai_field_naming_language_spec.rb +1 -1
  212. data/spec/models/authentication_check_spec.rb +1 -1
  213. data/spec/models/barcode_symbology_spec.rb +1 -1
  214. data/spec/models/check_character_spec.rb +1 -1
  215. data/spec/models/combined_field_type_spec.rb +1 -1
  216. data/spec/models/combined_pdf_files_spec.rb +1 -1
  217. data/spec/models/combined_pdf_list_spec.rb +1 -1
  218. data/spec/models/combined_pdf_source_input_spec.rb +1 -1
  219. data/spec/models/combined_pdf_source_pdf_spec.rb +1 -1
  220. data/spec/models/combined_pdf_source_spec.rb +1 -1
  221. data/spec/models/combined_pdf_source_type_spec.rb +1 -1
  222. data/spec/models/combined_pdf_spec.rb +1 -1
  223. data/spec/models/combined_pdf_state_spec.rb +1 -1
  224. data/spec/models/copy_template_request_spec.rb +1 -1
  225. data/spec/models/create_combined_pdf_request_spec.rb +1 -1
  226. data/spec/models/create_custom_file_from_upload_request_spec.rb +1 -1
  227. data/spec/models/create_folder_request_spec.rb +1 -1
  228. data/spec/models/create_signature_request_event_request_spec.rb +1 -1
  229. data/spec/models/create_signature_request_token_request_spec.rb +1 -1
  230. data/spec/models/create_submission_batch_request_spec.rb +1 -1
  231. data/spec/models/create_submission_request_spec.rb +1 -1
  232. data/spec/models/create_template_preview_request_spec.rb +36 -0
  233. data/spec/models/create_template_request_spec.rb +13 -1
  234. data/spec/models/create_webhook_request_spec.rb +1 -1
  235. data/spec/models/custom_file_list_spec.rb +1 -1
  236. data/spec/models/custom_file_source_pdf_spec.rb +1 -1
  237. data/spec/models/custom_file_spec.rb +1 -1
  238. data/spec/models/error_code_spec.rb +1 -1
  239. data/spec/models/error_detail_spec.rb +1 -1
  240. data/spec/models/error_info_spec.rb +1 -1
  241. data/spec/models/error_response_spec.rb +1 -1
  242. data/spec/models/expiration_interval_spec.rb +1 -1
  243. data/spec/models/field_comparison_condition_spec.rb +1 -1
  244. data/spec/models/field_comparison_operator_spec.rb +1 -1
  245. data/spec/models/field_dependency_input_spec.rb +1 -1
  246. data/spec/models/field_dependency_spec.rb +1 -1
  247. data/spec/models/field_display_type_spec.rb +1 -1
  248. data/spec/models/field_equals_condition_spec.rb +1 -1
  249. data/spec/models/field_equals_operator_spec.rb +1 -1
  250. data/spec/models/field_group_input_spec.rb +1 -1
  251. data/spec/models/field_group_spec.rb +1 -1
  252. data/spec/models/field_group_type_spec.rb +1 -1
  253. data/spec/models/field_in_condition_spec.rb +1 -1
  254. data/spec/models/field_input_spec.rb +1 -1
  255. data/spec/models/field_override_spec.rb +1 -1
  256. data/spec/models/field_presence_condition_spec.rb +1 -1
  257. data/spec/models/field_presence_operator_spec.rb +1 -1
  258. data/spec/models/field_range_condition_spec.rb +1 -1
  259. data/spec/models/field_reimport_state_spec.rb +1 -1
  260. data/spec/models/field_setup_logic_spec.rb +1 -1
  261. data/spec/models/field_setup_naming_spec.rb +1 -1
  262. data/spec/models/field_setup_source_spec.rb +1 -1
  263. data/spec/models/field_spec.rb +1 -1
  264. data/spec/models/field_type_spec.rb +1 -1
  265. data/spec/models/folder_list_spec.rb +1 -1
  266. data/spec/models/folder_spec.rb +1 -1
  267. data/spec/models/generate_files_format_spec.rb +1 -1
  268. data/spec/models/generate_submission_files_request_spec.rb +1 -1
  269. data/spec/models/generated_file_spec.rb +1 -1
  270. data/spec/models/generated_file_state_spec.rb +1 -1
  271. data/spec/models/html_engine_options_input_spec.rb +1 -1
  272. data/spec/models/html_engine_options_spec.rb +1 -1
  273. data/spec/models/image_gravity_spec.rb +1 -1
  274. data/spec/models/image_scale_type_spec.rb +1 -1
  275. data/spec/models/model_code_language_spec.rb +1 -1
  276. data/spec/models/move_folder_request_spec.rb +1 -1
  277. data/spec/models/move_template_request_spec.rb +1 -1
  278. data/spec/models/number_condition_type_spec.rb +1 -1
  279. data/spec/models/output_format_spec.rb +1 -1
  280. data/spec/models/page_format_spec.rb +1 -1
  281. data/spec/models/page_image_spec.rb +1 -1
  282. data/spec/models/page_images_spec.rb +1 -1
  283. data/spec/models/predefined_field_input_spec.rb +1 -1
  284. data/spec/models/predefined_field_spec.rb +1 -1
  285. data/spec/models/publish_template_version_request_spec.rb +1 -1
  286. data/spec/models/remove_template_fields_request_spec.rb +1 -1
  287. data/spec/models/rename_folder_request_spec.rb +1 -1
  288. data/spec/models/reorder_template_fields_request_spec.rb +1 -1
  289. data/spec/models/restore_template_version_request_spec.rb +1 -1
  290. data/spec/models/shape_type_spec.rb +1 -1
  291. data/spec/models/signature_request_auth_second_factor_type_spec.rb +1 -1
  292. data/spec/models/signature_request_auth_type_spec.rb +1 -1
  293. data/spec/models/signature_request_event_spec.rb +1 -1
  294. data/spec/models/signature_request_event_type_spec.rb +1 -1
  295. data/spec/models/signature_request_input_spec.rb +1 -1
  296. data/spec/models/signature_request_message_type_spec.rb +1 -1
  297. data/spec/models/signature_request_spec.rb +1 -1
  298. data/spec/models/signature_request_state_spec.rb +1 -1
  299. data/spec/models/signature_request_token_spec.rb +1 -1
  300. data/spec/models/signature_request_token_type_spec.rb +1 -1
  301. data/spec/models/string_condition_type_spec.rb +1 -1
  302. data/spec/models/submission_action_spec.rb +1 -1
  303. data/spec/models/submission_action_state_spec.rb +1 -1
  304. data/spec/models/submission_action_type_spec.rb +1 -1
  305. data/spec/models/submission_batch_spec.rb +1 -1
  306. data/spec/models/submission_batch_state_spec.rb +1 -1
  307. data/spec/models/submission_files_spec.rb +13 -1
  308. data/spec/models/submission_input_spec.rb +1 -1
  309. data/spec/models/submission_list_spec.rb +1 -1
  310. data/spec/models/submission_source_pdf_spec.rb +1 -1
  311. data/spec/models/submission_source_spec.rb +1 -1
  312. data/spec/models/submission_spec.rb +13 -13
  313. data/spec/models/submission_state_spec.rb +1 -1
  314. data/spec/models/submission_summary_spec.rb +144 -0
  315. data/spec/models/submission_validation_spec.rb +1 -1
  316. data/spec/models/template_actor_spec.rb +1 -1
  317. data/spec/models/template_actor_type_spec.rb +1 -1
  318. data/spec/models/template_defaults_input_spec.rb +1 -1
  319. data/spec/models/template_defaults_spec.rb +1 -1
  320. data/spec/models/template_diff_spec.rb +1 -1
  321. data/spec/models/template_diff_summary_spec.rb +1 -1
  322. data/spec/models/template_document_spec.rb +6 -6
  323. data/spec/models/template_document_state_spec.rb +1 -1
  324. data/spec/models/template_document_summary_spec.rb +54 -0
  325. data/spec/models/template_field_change_spec.rb +1 -1
  326. data/spec/models/template_field_changes_spec.rb +1 -1
  327. data/spec/models/template_field_dependency_action_spec.rb +1 -1
  328. data/spec/models/template_field_dependency_condition_input_spec.rb +1 -1
  329. data/spec/models/template_field_dependency_condition_spec.rb +1 -1
  330. data/spec/models/template_field_dependency_input_spec.rb +1 -1
  331. data/spec/models/template_field_dependency_match_spec.rb +1 -1
  332. data/spec/models/template_field_dependency_operator_spec.rb +1 -1
  333. data/spec/models/template_field_dependency_spec.rb +1 -1
  334. data/spec/models/template_field_logic_status_spec.rb +1 -1
  335. data/spec/models/template_field_move_spec.rb +1 -1
  336. data/spec/models/template_fields_spec.rb +1 -1
  337. data/spec/models/template_form_mode_spec.rb +1 -1
  338. data/spec/models/template_model_code_spec.rb +1 -1
  339. data/spec/models/template_page_ai_error_spec.rb +1 -1
  340. data/spec/models/template_page_ai_naming_status_spec.rb +1 -1
  341. data/spec/models/template_page_fields_status_spec.rb +1 -1
  342. data/spec/models/template_page_image_status_spec.rb +1 -1
  343. data/spec/models/template_page_images_spec.rb +1 -1
  344. data/spec/models/template_page_processing_status_spec.rb +1 -1
  345. data/spec/models/template_preview_spec.rb +78 -0
  346. data/spec/models/template_preview_state_spec.rb +30 -0
  347. data/spec/models/template_source_pdf_spec.rb +1 -1
  348. data/spec/models/template_spec.rb +35 -23
  349. data/spec/models/template_summary_list_spec.rb +1 -1
  350. data/spec/models/template_summary_spec.rb +6 -138
  351. data/spec/models/template_type_spec.rb +1 -1
  352. data/spec/models/template_version_spec.rb +1 -1
  353. data/spec/models/template_version_type_spec.rb +1 -1
  354. data/spec/models/text_alignment_spec.rb +1 -1
  355. data/spec/models/text_overflow_spec.rb +1 -1
  356. data/spec/models/text_vertical_alignment_spec.rb +1 -1
  357. data/spec/models/typeface_spec.rb +1 -1
  358. data/spec/models/update_signature_request_request_spec.rb +1 -1
  359. data/spec/models/update_template_document_request_spec.rb +1 -1
  360. data/spec/models/update_template_fields_request_spec.rb +1 -1
  361. data/spec/models/update_template_request_spec.rb +13 -1
  362. data/spec/models/update_webhook_request_spec.rb +1 -1
  363. data/spec/models/upload_method_spec.rb +1 -1
  364. data/spec/models/upload_presign_spec.rb +1 -1
  365. data/spec/models/url_source_pdf_spec.rb +1 -1
  366. data/spec/models/validate_submission_request_spec.rb +1 -1
  367. data/spec/models/webhook_event_type_spec.rb +1 -1
  368. data/spec/models/webhook_list_spec.rb +1 -1
  369. data/spec/models/webhook_mode_spec.rb +1 -1
  370. data/spec/models/webhook_spec.rb +1 -1
  371. data/spec/spec_helper.rb +1 -1
  372. metadata +25 -2
data/docs/Client.md CHANGED
@@ -14,6 +14,7 @@ All URIs are relative to *https://sync.api.docspring.com/api/v2*
14
14
  | [**create_submission**](Client.md#create_submission) | **POST** /templates/{template_id}/submissions | Generate a PDF |
15
15
  | [**create_submission_batch**](Client.md#create_submission_batch) | **POST** /submissions/batches | Generate PDFs in a batch |
16
16
  | [**create_template**](Client.md#create_template) | **POST** /templates | Create a template |
17
+ | [**create_template_preview**](Client.md#create_template_preview) | **POST** /templates/{template_id}/previews | Preview a template with data |
17
18
  | [**create_webhook**](Client.md#create_webhook) | **POST** /webhooks | Create a webhook |
18
19
  | [**delete_custom_file**](Client.md#delete_custom_file) | **DELETE** /custom_files/{custom_file_id} | Delete a custom file |
19
20
  | [**delete_folder**](Client.md#delete_folder) | **DELETE** /folders/{folder_id} | Delete a folder |
@@ -34,6 +35,7 @@ All URIs are relative to *https://sync.api.docspring.com/api/v2*
34
35
  | [**get_template_diff**](Client.md#get_template_diff) | **GET** /templates/{template_id}/diff | Compare a version of a template with the one before it |
35
36
  | [**get_template_model_code**](Client.md#get_template_model_code) | **GET** /templates/{template_id}/model_code | Generate typed code for a template's submission data |
36
37
  | [**get_template_page_images**](Client.md#get_template_page_images) | **GET** /templates/{template_id}/page_images | Get images of a template's pages |
38
+ | [**get_template_preview**](Client.md#get_template_preview) | **GET** /templates/{template_id}/previews/{preview_id} | Get a template preview |
37
39
  | [**get_template_schema**](Client.md#get_template_schema) | **GET** /templates/{template_id}/schema | Get the JSON Schema of a template's submission data |
38
40
  | [**get_webhook**](Client.md#get_webhook) | **GET** /webhooks/{webhook_id} | Get a webhook |
39
41
  | [**list_combined_pdfs**](Client.md#list_combined_pdfs) | **GET** /combined_pdfs | List combined PDFs |
@@ -54,11 +56,11 @@ All URIs are relative to *https://sync.api.docspring.com/api/v2*
54
56
  | [**test_authentication**](Client.md#test_authentication) | **GET** /authentication | Test authentication |
55
57
  | [**update_signature_request**](Client.md#update_signature_request) | **PUT** /signature_requests/{signature_request_id} | Update a signature request |
56
58
  | [**update_template**](Client.md#update_template) | **PUT** /templates/{template_id} | Update a template |
57
- | [**update_template_document**](Client.md#update_template_document) | **PUT** /templates/{template_id}/document | Replace a template's PDF |
59
+ | [**update_template_document**](Client.md#update_template_document) | **PUT** /templates/{template_id}/document | Replace a template's document |
58
60
  | [**update_template_fields**](Client.md#update_template_fields) | **PUT** /templates/{template_id}/fields | Update a template's fields |
59
61
  | [**update_webhook**](Client.md#update_webhook) | **PUT** /webhooks/{webhook_id} | Update a webhook |
60
- | [**upload_template**](Client.md#upload_template) | **POST** /templates/upload | Create a PDF template from an uploaded PDF |
61
- | [**upload_template_document**](Client.md#upload_template_document) | **PUT** /templates/{template_id}/document/upload | Replace a template's PDF with an uploaded PDF |
62
+ | [**upload_template**](Client.md#upload_template) | **POST** /templates/upload | Create a template from an uploaded PDF or Word document |
63
+ | [**upload_template_document**](Client.md#upload_template_document) | **PUT** /templates/{template_id}/document/upload | Replace a template's document with an uploaded file |
62
64
  | [**validate_submission**](Client.md#validate_submission) | **POST** /templates/{template_id}/submissions/validate | Check a submission without creating it |
63
65
 
64
66
 
@@ -126,7 +128,7 @@ end
126
128
 
127
129
  ### Authorization
128
130
 
129
- [api_token_basic](../README.md#api_token_basic)
131
+ [api_token_basic](../README.md#install-and-configure)
130
132
 
131
133
  ### HTTP request headers
132
134
 
@@ -200,7 +202,7 @@ end
200
202
 
201
203
  ### Authorization
202
204
 
203
- [api_token_basic](../README.md#api_token_basic)
205
+ [api_token_basic](../README.md#install-and-configure)
204
206
 
205
207
  ### HTTP request headers
206
208
 
@@ -231,7 +233,8 @@ end
231
233
  api_instance = DocSpring::Client.new
232
234
  body = DocSpring::CreateCombinedPdfRequest.new({source_pdfs: [DocSpring::CombinedPdfSourcePdf.new({type: 'type_example', id: 'id_example'})]}) # CreateCombinedPdfRequest | The PDFs to merge, and the combined PDF's settings.
233
235
  opts = {
234
- wait: true # Boolean | Wait until the PDF has been generated before responding. Default true on sync.api hosts.
236
+ wait: true, # Boolean | Wait until the PDF has been generated before responding. Default true on sync.api hosts.
237
+ idempotency_key: 'idempotency_key_example' # String | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another combined PDF. Send a new key with each new combined PDF, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
235
238
  }
236
239
 
237
240
  begin
@@ -267,6 +270,7 @@ end
267
270
  | ---- | ---- | ----------- | ----- |
268
271
  | **body** | [**CreateCombinedPdfRequest**](CreateCombinedPdfRequest.md) | The PDFs to merge, and the combined PDF's settings. | |
269
272
  | **wait** | **Boolean** | Wait until the PDF has been generated before responding. Default true on sync.api hosts. | [optional] |
273
+ | **idempotency_key** | **String** | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another combined PDF. Send a new key with each new combined PDF, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds. | [optional] |
270
274
 
271
275
  ### Return type
272
276
 
@@ -274,7 +278,7 @@ end
274
278
 
275
279
  ### Authorization
276
280
 
277
- [api_token_basic](../README.md#api_token_basic)
281
+ [api_token_basic](../README.md#install-and-configure)
278
282
 
279
283
  ### HTTP request headers
280
284
 
@@ -344,7 +348,7 @@ end
344
348
 
345
349
  ### Authorization
346
350
 
347
- [api_token_basic](../README.md#api_token_basic)
351
+ [api_token_basic](../README.md#install-and-configure)
348
352
 
349
353
  ### HTTP request headers
350
354
 
@@ -414,7 +418,7 @@ end
414
418
 
415
419
  ### Authorization
416
420
 
417
- [api_token_basic](../README.md#api_token_basic)
421
+ [api_token_basic](../README.md#install-and-configure)
418
422
 
419
423
  ### HTTP request headers
420
424
 
@@ -428,7 +432,7 @@ end
428
432
 
429
433
  Record a signature request event
430
434
 
431
- 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.
435
+ 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. A finished (completed, declined or expired) signature request's audit trail takes no more events, and a test API token can't record one for a live signature request.
432
436
 
433
437
  ### Examples
434
438
 
@@ -486,7 +490,7 @@ end
486
490
 
487
491
  ### Authorization
488
492
 
489
- [api_token_basic](../README.md#api_token_basic)
493
+ [api_token_basic](../README.md#install-and-configure)
490
494
 
491
495
  ### HTTP request headers
492
496
 
@@ -560,7 +564,7 @@ end
560
564
 
561
565
  ### Authorization
562
566
 
563
- [api_token_basic](../README.md#api_token_basic)
567
+ [api_token_basic](../README.md#install-and-configure)
564
568
 
565
569
  ### HTTP request headers
566
570
 
@@ -593,7 +597,8 @@ template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
593
597
  body = DocSpring::CreateSubmissionRequest.new # CreateSubmissionRequest | The submission's data and settings.
594
598
  opts = {
595
599
  version: 'version_example', # String | 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).
596
- wait: true # Boolean | Wait until the files have been generated before responding. Default true on sync.api hosts.
600
+ wait: true, # Boolean | Wait until the files have been generated before responding. Default true on sync.api hosts.
601
+ idempotency_key: 'idempotency_key_example' # String | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another submission. Send a new key with each new submission, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
597
602
  }
598
603
 
599
604
  begin
@@ -631,6 +636,7 @@ end
631
636
  | **body** | [**CreateSubmissionRequest**](CreateSubmissionRequest.md) | The submission's data and settings. | |
632
637
  | **version** | **String** | 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). | [optional] |
633
638
  | **wait** | **Boolean** | Wait until the files have been generated before responding. Default true on sync.api hosts. | [optional] |
639
+ | **idempotency_key** | **String** | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another submission. Send a new key with each new submission, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds. | [optional] |
634
640
 
635
641
  ### Return type
636
642
 
@@ -638,7 +644,7 @@ end
638
644
 
639
645
  ### Authorization
640
646
 
641
- [api_token_basic](../README.md#api_token_basic)
647
+ [api_token_basic](../README.md#install-and-configure)
642
648
 
643
649
  ### HTTP request headers
644
650
 
@@ -669,7 +675,8 @@ end
669
675
  api_instance = DocSpring::Client.new
670
676
  body = DocSpring::CreateSubmissionBatchRequest.new({submissions: [DocSpring::SubmissionInput.new]}) # CreateSubmissionBatchRequest | The submissions to create, and the settings they share.
671
677
  opts = {
672
- wait: true # Boolean | Wait until every PDF in the batch has been generated before responding. Default true on sync.api hosts.
678
+ wait: true, # Boolean | Wait until every file in the batch has been generated before responding. Default true on sync.api hosts.
679
+ idempotency_key: 'idempotency_key_example' # String | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another batch. Send a new key with each new batch, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
673
680
  }
674
681
 
675
682
  begin
@@ -704,7 +711,8 @@ end
704
711
  | Name | Type | Description | Notes |
705
712
  | ---- | ---- | ----------- | ----- |
706
713
  | **body** | [**CreateSubmissionBatchRequest**](CreateSubmissionBatchRequest.md) | The submissions to create, and the settings they share. | |
707
- | **wait** | **Boolean** | Wait until every PDF in the batch has been generated before responding. Default true on sync.api hosts. | [optional] |
714
+ | **wait** | **Boolean** | Wait until every file in the batch has been generated before responding. Default true on sync.api hosts. | [optional] |
715
+ | **idempotency_key** | **String** | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another batch. Send a new key with each new batch, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds. | [optional] |
708
716
 
709
717
  ### Return type
710
718
 
@@ -712,7 +720,7 @@ end
712
720
 
713
721
  ### Authorization
714
722
 
715
- [api_token_basic](../README.md#api_token_basic)
723
+ [api_token_basic](../README.md#install-and-configure)
716
724
 
717
725
  ### HTTP request headers
718
726
 
@@ -726,7 +734,7 @@ end
726
734
 
727
735
  Create a template
728
736
 
729
- 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`.
737
+ Creates an HTML template, or a PDF or Word template from a file you uploaded with the presigned upload (GET /uploads/presign): pass its `fields.key` as `cache_id`. You can send a link to the file (`document_url`) or the file in base64 (`document_base64`) instead, or send the file with the request with POST /templates/upload. A Word template is made from a Word document (.docx) or an OpenDocument text file (.odt), which DocSpring converts to a Word document. It needs its `output_format`: what each submission makes, a Word document (`docx`), an OpenDocument file (`odt`) or a PDF. A PDF template is ready to generate PDFs once DocSpring has processed its PDF, a template created from a `document_url` once its document has been downloaded, and one created from an .odt once it has been converted (`ready` is true). On sync.api hosts the request waits for that unless you pass `wait=false`.
730
738
 
731
739
  ### Examples
732
740
 
@@ -743,7 +751,7 @@ end
743
751
  api_instance = DocSpring::Client.new
744
752
  body = DocSpring::CreateTemplateRequest.new({template_type: DocSpring::TemplateType::PDF}) # CreateTemplateRequest | The template to create.
745
753
  opts = {
746
- wait: true # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
754
+ wait: true # Boolean | Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
747
755
  }
748
756
 
749
757
  begin
@@ -778,7 +786,7 @@ end
778
786
  | Name | Type | Description | Notes |
779
787
  | ---- | ---- | ----------- | ----- |
780
788
  | **body** | [**CreateTemplateRequest**](CreateTemplateRequest.md) | The template to create. | |
781
- | **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
789
+ | **wait** | **Boolean** | Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts. | [optional] |
782
790
 
783
791
  ### Return type
784
792
 
@@ -786,7 +794,83 @@ end
786
794
 
787
795
  ### Authorization
788
796
 
789
- [api_token_basic](../README.md#api_token_basic)
797
+ [api_token_basic](../README.md#install-and-configure)
798
+
799
+ ### HTTP request headers
800
+
801
+ - **Content-Type**: application/json
802
+ - **Accept**: application/json
803
+
804
+
805
+ ## create_template_preview
806
+
807
+ > <TemplatePreview> create_template_preview(template_id, body, opts)
808
+
809
+ Preview a template with data
810
+
811
+ Makes PNG images of a template's pages filled in with the data you send (not a PDF), so you can check how an HTML, PDF or Word template prints with your data before you publish a version or send live data. A Word template's pages are its PDF's, whatever its `output_format`. It renders the template's draft, or the published `version` you ask for. A preview makes no submission and uses no credits, and its pages are watermarked like a test submission's PDF. It's `pending` while it renders: get it with GET /templates/{template_id}/previews/{preview_id} until it's `processed`, with an image of each page, or `error`.
812
+
813
+ ### Examples
814
+
815
+ ```ruby
816
+ require 'time'
817
+ require 'docspring'
818
+ # setup authorization
819
+ DocSpring.configure do |config|
820
+ # Configure HTTP basic authorization: api_token_basic
821
+ config.username = 'YOUR USERNAME'
822
+ config.password = 'YOUR PASSWORD'
823
+ end
824
+
825
+ api_instance = DocSpring::Client.new
826
+ template_id = 'tpl_1234567890abcdef02' # String | The template's ID.
827
+ body = DocSpring::CreateTemplatePreviewRequest.new({data: { key: 3.56}}) # CreateTemplatePreviewRequest | The data to render the template with.
828
+ opts = {
829
+ version: 'version_example' # String | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
830
+ }
831
+
832
+ begin
833
+ # Preview a template with data
834
+ result = api_instance.create_template_preview(template_id, body, opts)
835
+ p result
836
+ rescue DocSpring::ApiError => e
837
+ puts "Error when calling Client->create_template_preview: #{e}"
838
+ end
839
+ ```
840
+
841
+ #### Using the create_template_preview_with_http_info variant
842
+
843
+ This returns an Array which contains the response data, status code and headers.
844
+
845
+ > <Array(<TemplatePreview>, Integer, Hash)> create_template_preview_with_http_info(template_id, body, opts)
846
+
847
+ ```ruby
848
+ begin
849
+ # Preview a template with data
850
+ data, status_code, headers = api_instance.create_template_preview_with_http_info(template_id, body, opts)
851
+ p status_code # => 2xx
852
+ p headers # => { ... }
853
+ p data # => <TemplatePreview>
854
+ rescue DocSpring::ApiError => e
855
+ puts "Error when calling Client->create_template_preview_with_http_info: #{e}"
856
+ end
857
+ ```
858
+
859
+ ### Parameters
860
+
861
+ | Name | Type | Description | Notes |
862
+ | ---- | ---- | ----------- | ----- |
863
+ | **template_id** | **String** | The template's ID. | |
864
+ | **body** | [**CreateTemplatePreviewRequest**](CreateTemplatePreviewRequest.md) | The data to render the template with. | |
865
+ | **version** | **String** | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`. | [optional] |
866
+
867
+ ### Return type
868
+
869
+ [**TemplatePreview**](TemplatePreview.md)
870
+
871
+ ### Authorization
872
+
873
+ [api_token_basic](../README.md#install-and-configure)
790
874
 
791
875
  ### HTTP request headers
792
876
 
@@ -856,7 +940,7 @@ end
856
940
 
857
941
  ### Authorization
858
942
 
859
- [api_token_basic](../README.md#api_token_basic)
943
+ [api_token_basic](../README.md#install-and-configure)
860
944
 
861
945
  ### HTTP request headers
862
946
 
@@ -926,7 +1010,7 @@ end
926
1010
 
927
1011
  ### Authorization
928
1012
 
929
- [api_token_basic](../README.md#api_token_basic)
1013
+ [api_token_basic](../README.md#install-and-configure)
930
1014
 
931
1015
  ### HTTP request headers
932
1016
 
@@ -996,7 +1080,7 @@ end
996
1080
 
997
1081
  ### Authorization
998
1082
 
999
- [api_token_basic](../README.md#api_token_basic)
1083
+ [api_token_basic](../README.md#install-and-configure)
1000
1084
 
1001
1085
  ### HTTP request headers
1002
1086
 
@@ -1070,7 +1154,7 @@ end
1070
1154
 
1071
1155
  ### Authorization
1072
1156
 
1073
- [api_token_basic](../README.md#api_token_basic)
1157
+ [api_token_basic](../README.md#install-and-configure)
1074
1158
 
1075
1159
  ### HTTP request headers
1076
1160
 
@@ -1140,7 +1224,7 @@ end
1140
1224
 
1141
1225
  ### Authorization
1142
1226
 
1143
- [api_token_basic](../README.md#api_token_basic)
1227
+ [api_token_basic](../README.md#install-and-configure)
1144
1228
 
1145
1229
  ### HTTP request headers
1146
1230
 
@@ -1210,7 +1294,7 @@ end
1210
1294
 
1211
1295
  ### Authorization
1212
1296
 
1213
- [api_token_basic](../README.md#api_token_basic)
1297
+ [api_token_basic](../README.md#install-and-configure)
1214
1298
 
1215
1299
  ### HTTP request headers
1216
1300
 
@@ -1280,7 +1364,7 @@ end
1280
1364
 
1281
1365
  ### Authorization
1282
1366
 
1283
- [api_token_basic](../README.md#api_token_basic)
1367
+ [api_token_basic](../README.md#install-and-configure)
1284
1368
 
1285
1369
  ### HTTP request headers
1286
1370
 
@@ -1294,7 +1378,7 @@ end
1294
1378
 
1295
1379
  Generate more files
1296
1380
 
1297
- Adds formats to a processed submission's files, in the background: `png`, a PNG image of each page of the PDF (up to 100 pages). To make them with the submission, add them to `output_formats` when you create it. Each new file is listed in `files` while it's made: on sync.api hosts the request waits for them (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until none of their `state` is `pending`. A file that couldn't be made has the state `error` and an `error_message`, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
1381
+ Adds formats to a processed submission's files, in the background, without using credits again: `pdf`, the PDF of a Word template's submission that made only its Word document (converted from that document), `docx`, the Word document of a Word template's submission that made only its PDF (made again from its data and the template version it used), `odt`, a Word template's submission's OpenDocument file (converted from its Word document, or from one made again when it didn't keep one), and `png`, a PNG image of each page of the PDF (up to 100 pages), which makes the PDF first when the submission doesn't have one. To make them with the submission, add them to `output_formats` when you create it. Each new file is listed in `files` while it's made: on sync.api hosts the request waits for them (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until none of their `state` is `pending`. A file that couldn't be made has the state `error` and an `error_message`, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
1298
1382
 
1299
1383
  ### Examples
1300
1384
 
@@ -1310,7 +1394,7 @@ end
1310
1394
 
1311
1395
  api_instance = DocSpring::Client.new
1312
1396
  submission_id = 'sub_1234567890abcdef01' # String | The submission's ID.
1313
- body = DocSpring::GenerateSubmissionFilesRequest.new({formats: [DocSpring::GenerateFilesFormat::PNG]}) # GenerateSubmissionFilesRequest | The formats to make.
1397
+ body = DocSpring::GenerateSubmissionFilesRequest.new({formats: [DocSpring::GenerateFilesFormat::PDF]}) # GenerateSubmissionFilesRequest | The formats to make.
1314
1398
  opts = {
1315
1399
  wait: true # Boolean | Wait until the files have been generated before responding. Default true on sync.api hosts.
1316
1400
  }
@@ -1356,7 +1440,7 @@ end
1356
1440
 
1357
1441
  ### Authorization
1358
1442
 
1359
- [api_token_basic](../README.md#api_token_basic)
1443
+ [api_token_basic](../README.md#install-and-configure)
1360
1444
 
1361
1445
  ### HTTP request headers
1362
1446
 
@@ -1426,7 +1510,7 @@ end
1426
1510
 
1427
1511
  ### Authorization
1428
1512
 
1429
- [api_token_basic](../README.md#api_token_basic)
1513
+ [api_token_basic](../README.md#install-and-configure)
1430
1514
 
1431
1515
  ### HTTP request headers
1432
1516
 
@@ -1496,7 +1580,7 @@ end
1496
1580
 
1497
1581
  ### Authorization
1498
1582
 
1499
- [api_token_basic](../README.md#api_token_basic)
1583
+ [api_token_basic](../README.md#install-and-configure)
1500
1584
 
1501
1585
  ### HTTP request headers
1502
1586
 
@@ -1566,7 +1650,7 @@ end
1566
1650
 
1567
1651
  ### Authorization
1568
1652
 
1569
- [api_token_basic](../README.md#api_token_basic)
1653
+ [api_token_basic](../README.md#install-and-configure)
1570
1654
 
1571
1655
  ### HTTP request headers
1572
1656
 
@@ -1636,7 +1720,7 @@ end
1636
1720
 
1637
1721
  ### Authorization
1638
1722
 
1639
- [api_token_basic](../README.md#api_token_basic)
1723
+ [api_token_basic](../README.md#install-and-configure)
1640
1724
 
1641
1725
  ### HTTP request headers
1642
1726
 
@@ -1703,7 +1787,7 @@ This endpoint does not need any parameter.
1703
1787
 
1704
1788
  ### Authorization
1705
1789
 
1706
- [api_token_basic](../README.md#api_token_basic)
1790
+ [api_token_basic](../README.md#install-and-configure)
1707
1791
 
1708
1792
  ### HTTP request headers
1709
1793
 
@@ -1773,7 +1857,7 @@ end
1773
1857
 
1774
1858
  ### Authorization
1775
1859
 
1776
- [api_token_basic](../README.md#api_token_basic)
1860
+ [api_token_basic](../README.md#install-and-configure)
1777
1861
 
1778
1862
  ### HTTP request headers
1779
1863
 
@@ -1843,7 +1927,7 @@ end
1843
1927
 
1844
1928
  ### Authorization
1845
1929
 
1846
- [api_token_basic](../README.md#api_token_basic)
1930
+ [api_token_basic](../README.md#install-and-configure)
1847
1931
 
1848
1932
  ### HTTP request headers
1849
1933
 
@@ -1917,7 +2001,7 @@ end
1917
2001
 
1918
2002
  ### Authorization
1919
2003
 
1920
- [api_token_basic](../README.md#api_token_basic)
2004
+ [api_token_basic](../README.md#install-and-configure)
1921
2005
 
1922
2006
  ### HTTP request headers
1923
2007
 
@@ -1991,7 +2075,7 @@ end
1991
2075
 
1992
2076
  ### Authorization
1993
2077
 
1994
- [api_token_basic](../README.md#api_token_basic)
2078
+ [api_token_basic](../README.md#install-and-configure)
1995
2079
 
1996
2080
  ### HTTP request headers
1997
2081
 
@@ -2065,7 +2149,7 @@ end
2065
2149
 
2066
2150
  ### Authorization
2067
2151
 
2068
- [api_token_basic](../README.md#api_token_basic)
2152
+ [api_token_basic](../README.md#install-and-configure)
2069
2153
 
2070
2154
  ### HTTP request headers
2071
2155
 
@@ -2079,7 +2163,7 @@ end
2079
2163
 
2080
2164
  Generate typed code for a template's submission data
2081
2165
 
2082
- 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.
2166
+ Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir, Go or Rust, so your app catches mistakes before it calls the API. `root_type_name` is the type of the whole `data` object, and `just_types=true` leaves out the code that converts JSON to and from the types. Java returns every class in `code`, each under a `// ClassName.java` comment. A template with no named fields returns 422.
2083
2167
 
2084
2168
  ### Examples
2085
2169
 
@@ -2097,7 +2181,8 @@ api_instance = DocSpring::Client.new
2097
2181
  template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
2098
2182
  lang = DocSpring::ModelCodeLanguage::TYPESCRIPT # ModelCodeLanguage | The language to generate the code in.
2099
2183
  opts = {
2100
- version: 'draft' # String | 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.
2184
+ version: 'draft', # String | 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.
2185
+ just_types: true # Boolean | Return only the types (interfaces, classes or structs), without the code that converts JSON to and from them. Default false. JavaScript has no types, PHP has no types-only code, and Rust's code is only types (serde converts the JSON), so theirs is the same either way.
2101
2186
  }
2102
2187
 
2103
2188
  begin
@@ -2134,6 +2219,7 @@ end
2134
2219
  | **template_id** | **String** | The template's ID. | |
2135
2220
  | **lang** | [**ModelCodeLanguage**](.md) | The language to generate the code in. | |
2136
2221
  | **version** | **String** | 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. | [optional] |
2222
+ | **just_types** | **Boolean** | Return only the types (interfaces, classes or structs), without the code that converts JSON to and from them. Default false. JavaScript has no types, PHP has no types-only code, and Rust's code is only types (serde converts the JSON), so theirs is the same either way. | [optional] |
2137
2223
 
2138
2224
  ### Return type
2139
2225
 
@@ -2141,7 +2227,7 @@ end
2141
2227
 
2142
2228
  ### Authorization
2143
2229
 
2144
- [api_token_basic](../README.md#api_token_basic)
2230
+ [api_token_basic](../README.md#install-and-configure)
2145
2231
 
2146
2232
  ### HTTP request headers
2147
2233
 
@@ -2215,7 +2301,79 @@ end
2215
2301
 
2216
2302
  ### Authorization
2217
2303
 
2218
- [api_token_basic](../README.md#api_token_basic)
2304
+ [api_token_basic](../README.md#install-and-configure)
2305
+
2306
+ ### HTTP request headers
2307
+
2308
+ - **Content-Type**: Not defined
2309
+ - **Accept**: application/json
2310
+
2311
+
2312
+ ## get_template_preview
2313
+
2314
+ > <TemplatePreview> get_template_preview(template_id, preview_id)
2315
+
2316
+ Get a template preview
2317
+
2318
+ Returns a preview made with POST /templates/{template_id}/previews. Once it's `processed`, `pages` has a PNG image of each page with a temporary link to download it: a preview has no PDF. Previews are deleted an hour after they're created.
2319
+
2320
+ ### Examples
2321
+
2322
+ ```ruby
2323
+ require 'time'
2324
+ require 'docspring'
2325
+ # setup authorization
2326
+ DocSpring.configure do |config|
2327
+ # Configure HTTP basic authorization: api_token_basic
2328
+ config.username = 'YOUR USERNAME'
2329
+ config.password = 'YOUR PASSWORD'
2330
+ end
2331
+
2332
+ api_instance = DocSpring::Client.new
2333
+ template_id = 'tpl_1234567890abcdef02' # String | The template's ID.
2334
+ preview_id = 'tpv_1234567890abcdef0123' # String | The preview's ID.
2335
+
2336
+ begin
2337
+ # Get a template preview
2338
+ result = api_instance.get_template_preview(template_id, preview_id)
2339
+ p result
2340
+ rescue DocSpring::ApiError => e
2341
+ puts "Error when calling Client->get_template_preview: #{e}"
2342
+ end
2343
+ ```
2344
+
2345
+ #### Using the get_template_preview_with_http_info variant
2346
+
2347
+ This returns an Array which contains the response data, status code and headers.
2348
+
2349
+ > <Array(<TemplatePreview>, Integer, Hash)> get_template_preview_with_http_info(template_id, preview_id)
2350
+
2351
+ ```ruby
2352
+ begin
2353
+ # Get a template preview
2354
+ data, status_code, headers = api_instance.get_template_preview_with_http_info(template_id, preview_id)
2355
+ p status_code # => 2xx
2356
+ p headers # => { ... }
2357
+ p data # => <TemplatePreview>
2358
+ rescue DocSpring::ApiError => e
2359
+ puts "Error when calling Client->get_template_preview_with_http_info: #{e}"
2360
+ end
2361
+ ```
2362
+
2363
+ ### Parameters
2364
+
2365
+ | Name | Type | Description | Notes |
2366
+ | ---- | ---- | ----------- | ----- |
2367
+ | **template_id** | **String** | The template's ID. | |
2368
+ | **preview_id** | **String** | The preview's ID. | |
2369
+
2370
+ ### Return type
2371
+
2372
+ [**TemplatePreview**](TemplatePreview.md)
2373
+
2374
+ ### Authorization
2375
+
2376
+ [api_token_basic](../README.md#install-and-configure)
2219
2377
 
2220
2378
  ### HTTP request headers
2221
2379
 
@@ -2289,7 +2447,7 @@ end
2289
2447
 
2290
2448
  ### Authorization
2291
2449
 
2292
- [api_token_basic](../README.md#api_token_basic)
2450
+ [api_token_basic](../README.md#install-and-configure)
2293
2451
 
2294
2452
  ### HTTP request headers
2295
2453
 
@@ -2359,7 +2517,7 @@ end
2359
2517
 
2360
2518
  ### Authorization
2361
2519
 
2362
- [api_token_basic](../README.md#api_token_basic)
2520
+ [api_token_basic](../README.md#install-and-configure)
2363
2521
 
2364
2522
  ### HTTP request headers
2365
2523
 
@@ -2433,7 +2591,7 @@ end
2433
2591
 
2434
2592
  ### Authorization
2435
2593
 
2436
- [api_token_basic](../README.md#api_token_basic)
2594
+ [api_token_basic](../README.md#install-and-configure)
2437
2595
 
2438
2596
  ### HTTP request headers
2439
2597
 
@@ -2507,7 +2665,7 @@ end
2507
2665
 
2508
2666
  ### Authorization
2509
2667
 
2510
- [api_token_basic](../README.md#api_token_basic)
2668
+ [api_token_basic](../README.md#install-and-configure)
2511
2669
 
2512
2670
  ### HTTP request headers
2513
2671
 
@@ -2583,7 +2741,7 @@ end
2583
2741
 
2584
2742
  ### Authorization
2585
2743
 
2586
- [api_token_basic](../README.md#api_token_basic)
2744
+ [api_token_basic](../README.md#install-and-configure)
2587
2745
 
2588
2746
  ### HTTP request headers
2589
2747
 
@@ -2597,7 +2755,7 @@ end
2597
2755
 
2598
2756
  List submissions
2599
2757
 
2600
- 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`.
2758
+ Returns the submissions in your account, newest first, one page at a time. Each one is a summary: its `data` is null unless you pass `include_data=true`, and its `files` are empty unless you pass `include_files=true`. Get a submission by its ID for its signature requests, uploads and page images.
2601
2759
 
2602
2760
  ### Examples
2603
2761
 
@@ -2619,7 +2777,9 @@ opts = {
2619
2777
  created_before: Time.parse('2018-10-20T09:00:00Z'), # Time | Only list submissions created before this time.
2620
2778
  include_data: true, # Boolean | Include each submission's `data` (null without it).
2621
2779
  limit: 56, # Integer | How many items to return (1-100, default 50).
2622
- cursor: 'cursor_example' # String | 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.
2780
+ cursor: 'cursor_example', # String | 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.
2781
+ state: DocSpring::SubmissionState::PENDING, # SubmissionState | Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
2782
+ include_files: true # Boolean | Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
2623
2783
  }
2624
2784
 
2625
2785
  begin
@@ -2660,6 +2820,8 @@ end
2660
2820
  | **include_data** | **Boolean** | Include each submission's `data` (null without it). | [optional] |
2661
2821
  | **limit** | **Integer** | How many items to return (1-100, default 50). | [optional][default to 50] |
2662
2822
  | **cursor** | **String** | 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. | [optional] |
2823
+ | **state** | [**SubmissionState**](.md) | Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck. | [optional] |
2824
+ | **include_files** | **Boolean** | Include each submission's generated files and their download links (`files`, empty without it), without the page images' links. | [optional] |
2663
2825
 
2664
2826
  ### Return type
2665
2827
 
@@ -2667,7 +2829,7 @@ end
2667
2829
 
2668
2830
  ### Authorization
2669
2831
 
2670
- [api_token_basic](../README.md#api_token_basic)
2832
+ [api_token_basic](../README.md#install-and-configure)
2671
2833
 
2672
2834
  ### HTTP request headers
2673
2835
 
@@ -2741,7 +2903,7 @@ end
2741
2903
 
2742
2904
  ### Authorization
2743
2905
 
2744
- [api_token_basic](../README.md#api_token_basic)
2906
+ [api_token_basic](../README.md#install-and-configure)
2745
2907
 
2746
2908
  ### HTTP request headers
2747
2909
 
@@ -2777,7 +2939,9 @@ opts = {
2777
2939
  created_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Only list submissions created before this time.
2778
2940
  include_data: true, # Boolean | Include each submission's `data` (null without it).
2779
2941
  limit: 56, # Integer | How many items to return (1-100, default 50).
2780
- cursor: 'cursor_example' # String | 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.
2942
+ cursor: 'cursor_example', # String | 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.
2943
+ state: DocSpring::SubmissionState::PENDING, # SubmissionState | Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
2944
+ include_files: true # Boolean | Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
2781
2945
  }
2782
2946
 
2783
2947
  begin
@@ -2818,6 +2982,8 @@ end
2818
2982
  | **include_data** | **Boolean** | Include each submission's `data` (null without it). | [optional] |
2819
2983
  | **limit** | **Integer** | How many items to return (1-100, default 50). | [optional][default to 50] |
2820
2984
  | **cursor** | **String** | 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. | [optional] |
2985
+ | **state** | [**SubmissionState**](.md) | Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck. | [optional] |
2986
+ | **include_files** | **Boolean** | Include each submission's generated files and their download links (`files`, empty without it), without the page images' links. | [optional] |
2821
2987
 
2822
2988
  ### Return type
2823
2989
 
@@ -2825,7 +2991,7 @@ end
2825
2991
 
2826
2992
  ### Authorization
2827
2993
 
2828
- [api_token_basic](../README.md#api_token_basic)
2994
+ [api_token_basic](../README.md#install-and-configure)
2829
2995
 
2830
2996
  ### HTTP request headers
2831
2997
 
@@ -2839,7 +3005,7 @@ end
2839
3005
 
2840
3006
  List templates
2841
3007
 
2842
- 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.
3008
+ Returns the templates in your account (their drafts), newest first, one page at a time. Each one is a summary: get a template by its ID for its settings, its PDF in full, its HTML, defaults and published versions.
2843
3009
 
2844
3010
  ### Examples
2845
3011
 
@@ -2903,7 +3069,7 @@ end
2903
3069
 
2904
3070
  ### Authorization
2905
3071
 
2906
- [api_token_basic](../README.md#api_token_basic)
3072
+ [api_token_basic](../README.md#install-and-configure)
2907
3073
 
2908
3074
  ### HTTP request headers
2909
3075
 
@@ -2987,7 +3153,7 @@ end
2987
3153
 
2988
3154
  ### Authorization
2989
3155
 
2990
- [api_token_basic](../README.md#api_token_basic)
3156
+ [api_token_basic](../README.md#install-and-configure)
2991
3157
 
2992
3158
  ### HTTP request headers
2993
3159
 
@@ -3059,7 +3225,7 @@ end
3059
3225
 
3060
3226
  ### Authorization
3061
3227
 
3062
- [api_token_basic](../README.md#api_token_basic)
3228
+ [api_token_basic](../README.md#install-and-configure)
3063
3229
 
3064
3230
  ### HTTP request headers
3065
3231
 
@@ -3131,7 +3297,7 @@ end
3131
3297
 
3132
3298
  ### Authorization
3133
3299
 
3134
- [api_token_basic](../README.md#api_token_basic)
3300
+ [api_token_basic](../README.md#install-and-configure)
3135
3301
 
3136
3302
  ### HTTP request headers
3137
3303
 
@@ -3145,7 +3311,7 @@ end
3145
3311
 
3146
3312
  Publish a template version
3147
3313
 
3148
- 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. While the template's PDF is downloading or being processed, or DocSpring is setting up its fields, it returns a 409 that says so.
3314
+ Publishes the template's draft as a new version. Its content (the PDF or HTML, fields, name and description) never changes, while settings such as `webhook_url` and `public_submissions` keep following the draft. `version_type` says which part of the latest version number goes up. While the template's PDF is downloading or being processed, or DocSpring is setting up its fields, it returns a 409 that says so.
3149
3315
 
3150
3316
  ### Examples
3151
3317
 
@@ -3203,7 +3369,7 @@ end
3203
3369
 
3204
3370
  ### Authorization
3205
3371
 
3206
- [api_token_basic](../README.md#api_token_basic)
3372
+ [api_token_basic](../README.md#install-and-configure)
3207
3373
 
3208
3374
  ### HTTP request headers
3209
3375
 
@@ -3275,7 +3441,7 @@ end
3275
3441
 
3276
3442
  ### Authorization
3277
3443
 
3278
- [api_token_basic](../README.md#api_token_basic)
3444
+ [api_token_basic](../README.md#install-and-configure)
3279
3445
 
3280
3446
  ### HTTP request headers
3281
3447
 
@@ -3347,7 +3513,7 @@ end
3347
3513
 
3348
3514
  ### Authorization
3349
3515
 
3350
- [api_token_basic](../README.md#api_token_basic)
3516
+ [api_token_basic](../README.md#install-and-configure)
3351
3517
 
3352
3518
  ### HTTP request headers
3353
3519
 
@@ -3419,7 +3585,7 @@ end
3419
3585
 
3420
3586
  ### Authorization
3421
3587
 
3422
- [api_token_basic](../README.md#api_token_basic)
3588
+ [api_token_basic](../README.md#install-and-configure)
3423
3589
 
3424
3590
  ### HTTP request headers
3425
3591
 
@@ -3433,7 +3599,7 @@ end
3433
3599
 
3434
3600
  Restore a template version
3435
3601
 
3436
- Replaces the template's draft with a copy of one of its published versions.
3602
+ Replaces the template's draft with a copy of one of its published versions. The draft keeps its settings that apply to every version, such as `webhook_url`.
3437
3603
 
3438
3604
  ### Examples
3439
3605
 
@@ -3491,7 +3657,7 @@ end
3491
3657
 
3492
3658
  ### Authorization
3493
3659
 
3494
- [api_token_basic](../README.md#api_token_basic)
3660
+ [api_token_basic](../README.md#install-and-configure)
3495
3661
 
3496
3662
  ### HTTP request headers
3497
3663
 
@@ -3558,7 +3724,7 @@ This endpoint does not need any parameter.
3558
3724
 
3559
3725
  ### Authorization
3560
3726
 
3561
- [api_token_basic](../README.md#api_token_basic)
3727
+ [api_token_basic](../README.md#install-and-configure)
3562
3728
 
3563
3729
  ### HTTP request headers
3564
3730
 
@@ -3630,7 +3796,7 @@ end
3630
3796
 
3631
3797
  ### Authorization
3632
3798
 
3633
- [api_token_basic](../README.md#api_token_basic)
3799
+ [api_token_basic](../README.md#install-and-configure)
3634
3800
 
3635
3801
  ### HTTP request headers
3636
3802
 
@@ -3644,7 +3810,7 @@ end
3644
3810
 
3645
3811
  Update a template
3646
3812
 
3647
- Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object, and `field_groups` changes only the groups it lists. Setting `parent_folder_id` moves the template and all of its published versions.
3813
+ Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object, and `field_groups` changes only the groups it lists. Settings such as `webhook_url`, `public_submissions` and `expire_after` apply to every published version too, and setting `parent_folder_id` moves the template and all of its published versions.
3648
3814
 
3649
3815
  ### Examples
3650
3816
 
@@ -3702,7 +3868,7 @@ end
3702
3868
 
3703
3869
  ### Authorization
3704
3870
 
3705
- [api_token_basic](../README.md#api_token_basic)
3871
+ [api_token_basic](../README.md#install-and-configure)
3706
3872
 
3707
3873
  ### HTTP request headers
3708
3874
 
@@ -3714,9 +3880,9 @@ end
3714
3880
 
3715
3881
  > <Template> update_template_document(template_id, body, opts)
3716
3882
 
3717
- Replace a template's PDF
3883
+ Replace a template's document
3718
3884
 
3719
- Replaces a PDF template's PDF with one you uploaded with the presigned upload (GET /uploads/presign) (`cache_id`), a link to download it from (`document_url`), or the file in base64 (`document_base64`). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields. To send the PDF as `multipart/form-data` instead, use PUT /templates/{template_id}/document/upload.
3885
+ Replaces a PDF template's PDF, or a Word template's Word document (from a .docx or an .odt), with one you uploaded with the presigned upload (GET /uploads/presign) (`cache_id`), a link to download it from (`document_url`), or the file in base64 (`document_base64`). A PDF template's fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag. To send the file as `multipart/form-data` instead, use PUT /templates/{template_id}/document/upload.
3720
3886
 
3721
3887
  ### Examples
3722
3888
 
@@ -3732,13 +3898,13 @@ end
3732
3898
 
3733
3899
  api_instance = DocSpring::Client.new
3734
3900
  template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
3735
- body = DocSpring::UpdateTemplateDocumentRequest.new # UpdateTemplateDocumentRequest | The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
3901
+ body = DocSpring::UpdateTemplateDocumentRequest.new # UpdateTemplateDocumentRequest | The new PDF, or a Word template's new Word document, as one of `cache_id`, `document_url` and `document_base64`.
3736
3902
  opts = {
3737
- wait: true # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
3903
+ wait: true # Boolean | Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
3738
3904
  }
3739
3905
 
3740
3906
  begin
3741
- # Replace a template's PDF
3907
+ # Replace a template's document
3742
3908
  result = api_instance.update_template_document(template_id, body, opts)
3743
3909
  p result
3744
3910
  rescue DocSpring::ApiError => e
@@ -3754,7 +3920,7 @@ This returns an Array which contains the response data, status code and headers.
3754
3920
 
3755
3921
  ```ruby
3756
3922
  begin
3757
- # Replace a template's PDF
3923
+ # Replace a template's document
3758
3924
  data, status_code, headers = api_instance.update_template_document_with_http_info(template_id, body, opts)
3759
3925
  p status_code # => 2xx
3760
3926
  p headers # => { ... }
@@ -3769,8 +3935,8 @@ end
3769
3935
  | Name | Type | Description | Notes |
3770
3936
  | ---- | ---- | ----------- | ----- |
3771
3937
  | **template_id** | **String** | The template's ID. | |
3772
- | **body** | [**UpdateTemplateDocumentRequest**](UpdateTemplateDocumentRequest.md) | The new PDF, as one of `cache_id`, `document_url` and `document_base64`. | |
3773
- | **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
3938
+ | **body** | [**UpdateTemplateDocumentRequest**](UpdateTemplateDocumentRequest.md) | The new PDF, or a Word template's new Word document, as one of `cache_id`, `document_url` and `document_base64`. | |
3939
+ | **wait** | **Boolean** | Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts. | [optional] |
3774
3940
 
3775
3941
  ### Return type
3776
3942
 
@@ -3778,7 +3944,7 @@ end
3778
3944
 
3779
3945
  ### Authorization
3780
3946
 
3781
- [api_token_basic](../README.md#api_token_basic)
3947
+ [api_token_basic](../README.md#install-and-configure)
3782
3948
 
3783
3949
  ### HTTP request headers
3784
3950
 
@@ -3850,7 +4016,7 @@ end
3850
4016
 
3851
4017
  ### Authorization
3852
4018
 
3853
- [api_token_basic](../README.md#api_token_basic)
4019
+ [api_token_basic](../README.md#install-and-configure)
3854
4020
 
3855
4021
  ### HTTP request headers
3856
4022
 
@@ -3922,7 +4088,7 @@ end
3922
4088
 
3923
4089
  ### Authorization
3924
4090
 
3925
- [api_token_basic](../README.md#api_token_basic)
4091
+ [api_token_basic](../README.md#install-and-configure)
3926
4092
 
3927
4093
  ### HTTP request headers
3928
4094
 
@@ -3934,9 +4100,9 @@ end
3934
4100
 
3935
4101
  > <Template> upload_template(document, opts)
3936
4102
 
3937
- Create a PDF template from an uploaded PDF
4103
+ Create a template from an uploaded PDF or Word document
3938
4104
 
3939
- 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.
4105
+ Creates a PDF template from a PDF, or a Word template from a Word document (.docx) or an OpenDocument text file (.odt), sent with the request (`multipart/form-data`). A Word template needs its `output_format`. For large files, upload the file with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
3940
4106
 
3941
4107
  ### Examples
3942
4108
 
@@ -3951,9 +4117,9 @@ DocSpring.configure do |config|
3951
4117
  end
3952
4118
 
3953
4119
  api_instance = DocSpring::Client.new
3954
- document = File.new('/path/to/some/file') # File | The PDF.
4120
+ document = File.new('/path/to/some/file') # File | A PDF (for a PDF template) or a Word document (.docx or .odt, for a Word template). DocSpring converts an OpenDocument text file (.odt) to a Word document after responding: the template's `document.state` is `converting` until then (sync.api hosts wait for it).
3955
4121
  opts = {
3956
- wait: true, # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
4122
+ wait: true, # Boolean | Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
3957
4123
  name: 'name_example', # String | The template's name.
3958
4124
  description: 'description_example', # String | The template's description.
3959
4125
  parent_folder_id: 'parent_folder_id_example', # String | The folder to put the template in. Left out, it's created at the root.
@@ -3961,11 +4127,12 @@ opts = {
3961
4127
  detect_fields: true, # Boolean | 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.
3962
4128
  field_source: DocSpring::FieldSetupSource::AUTO, # FieldSetupSource | 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.
3963
4129
  field_naming: DocSpring::FieldSetupNaming::AI, # FieldSetupNaming | 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`.
3964
- field_logic: DocSpring::FieldSetupLogic::AI # FieldSetupLogic | 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.
4130
+ field_logic: DocSpring::FieldSetupLogic::AI, # FieldSetupLogic | 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.
4131
+ output_format: DocSpring::OutputFormat::PDF # OutputFormat | What each submission of a Word template makes unless its request sets `output_formats`: `docx` (a Word document), `odt` (an OpenDocument file, converted from the Word document) or `pdf`. Required when `document` is a Word document.
3965
4132
  }
3966
4133
 
3967
4134
  begin
3968
- # Create a PDF template from an uploaded PDF
4135
+ # Create a template from an uploaded PDF or Word document
3969
4136
  result = api_instance.upload_template(document, opts)
3970
4137
  p result
3971
4138
  rescue DocSpring::ApiError => e
@@ -3981,7 +4148,7 @@ This returns an Array which contains the response data, status code and headers.
3981
4148
 
3982
4149
  ```ruby
3983
4150
  begin
3984
- # Create a PDF template from an uploaded PDF
4151
+ # Create a template from an uploaded PDF or Word document
3985
4152
  data, status_code, headers = api_instance.upload_template_with_http_info(document, opts)
3986
4153
  p status_code # => 2xx
3987
4154
  p headers # => { ... }
@@ -3995,8 +4162,8 @@ end
3995
4162
 
3996
4163
  | Name | Type | Description | Notes |
3997
4164
  | ---- | ---- | ----------- | ----- |
3998
- | **document** | **File** | The PDF. | |
3999
- | **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
4165
+ | **document** | **File** | A PDF (for a PDF template) or a Word document (.docx or .odt, for a Word template). DocSpring converts an OpenDocument text file (.odt) to a Word document after responding: the template's `document.state` is `converting` until then (sync.api hosts wait for it). | |
4166
+ | **wait** | **Boolean** | Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts. | [optional] |
4000
4167
  | **name** | **String** | The template's name. | [optional] |
4001
4168
  | **description** | **String** | The template's description. | [optional] |
4002
4169
  | **parent_folder_id** | **String** | The folder to put the template in. Left out, it's created at the root. | [optional] |
@@ -4005,6 +4172,7 @@ end
4005
4172
  | **field_source** | [**FieldSetupSource**](FieldSetupSource.md) | 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. | [optional] |
4006
4173
  | **field_naming** | [**FieldSetupNaming**](FieldSetupNaming.md) | 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`. | [optional] |
4007
4174
  | **field_logic** | [**FieldSetupLogic**](FieldSetupLogic.md) | 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. | [optional] |
4175
+ | **output_format** | [**OutputFormat**](OutputFormat.md) | What each submission of a Word template makes unless its request sets `output_formats`: `docx` (a Word document), `odt` (an OpenDocument file, converted from the Word document) or `pdf`. Required when `document` is a Word document. | [optional] |
4008
4176
 
4009
4177
  ### Return type
4010
4178
 
@@ -4012,7 +4180,7 @@ end
4012
4180
 
4013
4181
  ### Authorization
4014
4182
 
4015
- [api_token_basic](../README.md#api_token_basic)
4183
+ [api_token_basic](../README.md#install-and-configure)
4016
4184
 
4017
4185
  ### HTTP request headers
4018
4186
 
@@ -4024,9 +4192,9 @@ end
4024
4192
 
4025
4193
  > <Template> upload_template_document(template_id, document, opts)
4026
4194
 
4027
- Replace a template's PDF with an uploaded PDF
4195
+ Replace a template's document with an uploaded file
4028
4196
 
4029
- 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.
4197
+ Replaces a PDF template's PDF, or a Word template's Word document, with one sent with the request (`multipart/form-data`). A PDF template's fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag.
4030
4198
 
4031
4199
  ### Examples
4032
4200
 
@@ -4042,14 +4210,14 @@ end
4042
4210
 
4043
4211
  api_instance = DocSpring::Client.new
4044
4212
  template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
4045
- document = File.new('/path/to/some/file') # File | The new PDF.
4213
+ document = File.new('/path/to/some/file') # File | The new PDF, or the new Word document (.docx or .odt) of a Word template.
4046
4214
  opts = {
4047
- wait: true, # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
4048
- reimport_fields: true # Boolean | 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.
4215
+ wait: true, # Boolean | Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
4216
+ reimport_fields: true # Boolean | 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. Only for PDF templates: a Word template adds a field for each new tag.
4049
4217
  }
4050
4218
 
4051
4219
  begin
4052
- # Replace a template's PDF with an uploaded PDF
4220
+ # Replace a template's document with an uploaded file
4053
4221
  result = api_instance.upload_template_document(template_id, document, opts)
4054
4222
  p result
4055
4223
  rescue DocSpring::ApiError => e
@@ -4065,7 +4233,7 @@ This returns an Array which contains the response data, status code and headers.
4065
4233
 
4066
4234
  ```ruby
4067
4235
  begin
4068
- # Replace a template's PDF with an uploaded PDF
4236
+ # Replace a template's document with an uploaded file
4069
4237
  data, status_code, headers = api_instance.upload_template_document_with_http_info(template_id, document, opts)
4070
4238
  p status_code # => 2xx
4071
4239
  p headers # => { ... }
@@ -4080,9 +4248,9 @@ end
4080
4248
  | Name | Type | Description | Notes |
4081
4249
  | ---- | ---- | ----------- | ----- |
4082
4250
  | **template_id** | **String** | The template's ID. | |
4083
- | **document** | **File** | The new PDF. | |
4084
- | **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
4085
- | **reimport_fields** | **Boolean** | 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. | [optional] |
4251
+ | **document** | **File** | The new PDF, or the new Word document (.docx or .odt) of a Word template. | |
4252
+ | **wait** | **Boolean** | Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts. | [optional] |
4253
+ | **reimport_fields** | **Boolean** | 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. Only for PDF templates: a Word template adds a field for each new tag. | [optional] |
4086
4254
 
4087
4255
  ### Return type
4088
4256
 
@@ -4090,7 +4258,7 @@ end
4090
4258
 
4091
4259
  ### Authorization
4092
4260
 
4093
- [api_token_basic](../README.md#api_token_basic)
4261
+ [api_token_basic](../README.md#install-and-configure)
4094
4262
 
4095
4263
  ### HTTP request headers
4096
4264
 
@@ -4166,7 +4334,7 @@ end
4166
4334
 
4167
4335
  ### Authorization
4168
4336
 
4169
- [api_token_basic](../README.md#api_token_basic)
4337
+ [api_token_basic](../README.md#install-and-configure)
4170
4338
 
4171
4339
  ### HTTP request headers
4172
4340