docspring 3.5.0 → 4.1.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 (588) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +445 -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 +147 -0
  8. data/Gemfile.lock +7 -7
  9. data/README.md +69 -53
  10. data/docs/AddTemplateFieldsRequest.md +18 -0
  11. data/docs/{RenameFolderData.md → AiFieldNamingLanguage.md} +2 -5
  12. data/docs/AuthenticationCheck.md +18 -0
  13. data/docs/{CreateFolderData.md → BarcodeSymbology.md} +2 -5
  14. data/docs/{CreateWebhookData.md → CheckCharacter.md} +2 -5
  15. data/docs/Client.md +1570 -786
  16. data/docs/{UpdateWebhookData.md → CombinedFieldType.md} +2 -5
  17. data/docs/CombinedPdf.md +44 -0
  18. data/docs/CombinedPdfFiles.md +18 -0
  19. data/docs/CombinedPdfList.md +20 -0
  20. data/docs/CombinedPdfSource.md +26 -0
  21. data/docs/CombinedPdfSourceInput.md +88 -0
  22. data/docs/CombinedPdfSourcePdf.md +20 -0
  23. data/docs/CombinedPdfSourceType.md +15 -0
  24. data/docs/CombinedPdfState.md +15 -0
  25. data/docs/CopyTemplateRequest.md +22 -0
  26. data/docs/CreateCombinedPdfRequest.md +26 -0
  27. data/docs/CreateCustomFileFromUploadRequest.md +18 -0
  28. data/docs/CreateFolderRequest.md +20 -0
  29. data/docs/CreateSignatureRequestEventRequest.md +24 -0
  30. data/docs/CreateSignatureRequestTokenRequest.md +18 -0
  31. data/docs/CreateSubmissionBatchRequest.md +28 -0
  32. data/docs/CreateSubmissionRequest.md +38 -0
  33. data/docs/CreateTemplateRequest.md +102 -0
  34. data/docs/CreateWebhookRequest.md +38 -0
  35. data/docs/CustomFile.md +11 -3
  36. data/docs/CustomFileList.md +20 -0
  37. data/docs/CustomFileSourcePdf.md +20 -0
  38. data/docs/ErrorCode.md +15 -0
  39. data/docs/ErrorDetail.md +26 -0
  40. data/docs/ErrorInfo.md +32 -0
  41. data/docs/ErrorResponse.md +1 -3
  42. data/docs/ExpirationInterval.md +15 -0
  43. data/docs/Field.md +198 -0
  44. data/docs/FieldComparisonCondition.md +22 -0
  45. data/docs/FieldComparisonOperator.md +15 -0
  46. data/docs/FieldDependency.md +22 -0
  47. data/docs/FieldDependencyInput.md +22 -0
  48. data/docs/FieldDisplayType.md +15 -0
  49. data/docs/FieldEqualsCondition.md +22 -0
  50. data/docs/FieldEqualsOperator.md +15 -0
  51. data/docs/FieldGroup.md +32 -0
  52. data/docs/FieldGroupInput.md +30 -0
  53. data/docs/FieldGroupType.md +15 -0
  54. data/docs/FieldInCondition.md +22 -0
  55. data/docs/FieldInput.md +196 -0
  56. data/docs/FieldOverride.md +142 -0
  57. data/docs/FieldPresenceCondition.md +20 -0
  58. data/docs/FieldPresenceOperator.md +15 -0
  59. data/docs/FieldRangeCondition.md +24 -0
  60. data/docs/FieldReimportState.md +15 -0
  61. data/docs/FieldSetupLogic.md +15 -0
  62. data/docs/FieldSetupNaming.md +15 -0
  63. data/docs/FieldSetupSource.md +15 -0
  64. data/docs/FieldType.md +15 -0
  65. data/docs/Folder.md +9 -5
  66. data/docs/FolderList.md +20 -0
  67. data/docs/GenerateFilesFormat.md +15 -0
  68. data/docs/GenerateSubmissionFilesRequest.md +18 -0
  69. data/docs/GeneratedFile.md +32 -0
  70. data/docs/GeneratedFileState.md +15 -0
  71. data/docs/HtmlEngineOptions.md +36 -0
  72. data/docs/HtmlEngineOptionsInput.md +36 -0
  73. data/docs/ImageGravity.md +15 -0
  74. data/docs/ImageScaleType.md +15 -0
  75. data/docs/ModelCodeLanguage.md +15 -0
  76. data/docs/MoveFolderRequest.md +18 -0
  77. data/docs/MoveTemplateRequest.md +18 -0
  78. data/docs/NumberConditionType.md +15 -0
  79. data/docs/OutputFormat.md +15 -0
  80. data/docs/PageFormat.md +15 -0
  81. data/docs/PageImage.md +34 -0
  82. data/docs/PageImages.md +24 -0
  83. data/docs/PredefinedField.md +30 -0
  84. data/docs/PredefinedFieldInput.md +30 -0
  85. data/docs/PublishTemplateVersionRequest.md +20 -0
  86. data/docs/RemoveTemplateFieldsRequest.md +18 -0
  87. data/docs/RenameFolderRequest.md +18 -0
  88. data/docs/ReorderTemplateFieldsRequest.md +18 -0
  89. data/docs/RestoreTemplateVersionRequest.md +18 -0
  90. data/docs/ShapeType.md +15 -0
  91. data/docs/SignatureRequest.md +66 -0
  92. data/docs/SignatureRequestAuthSecondFactorType.md +15 -0
  93. data/docs/SignatureRequestAuthType.md +15 -0
  94. data/docs/SignatureRequestEvent.md +32 -0
  95. data/docs/SignatureRequestEventType.md +15 -0
  96. data/docs/SignatureRequestInput.md +46 -0
  97. data/docs/SignatureRequestMessageType.md +15 -0
  98. data/docs/SignatureRequestState.md +15 -0
  99. data/docs/SignatureRequestToken.md +30 -0
  100. data/docs/SignatureRequestTokenType.md +15 -0
  101. data/docs/StringConditionType.md +15 -0
  102. data/docs/Submission.md +43 -47
  103. data/docs/SubmissionAction.md +6 -8
  104. data/docs/SubmissionActionState.md +15 -0
  105. data/docs/SubmissionActionType.md +15 -0
  106. data/docs/SubmissionBatch.md +16 -10
  107. data/docs/SubmissionBatchState.md +15 -0
  108. data/docs/SubmissionFiles.md +24 -0
  109. data/docs/SubmissionInput.md +40 -0
  110. data/docs/SubmissionList.md +20 -0
  111. data/docs/SubmissionSource.md +15 -0
  112. data/docs/SubmissionSourcePdf.md +20 -0
  113. data/docs/SubmissionState.md +15 -0
  114. data/docs/SubmissionValidation.md +24 -0
  115. data/docs/Template.md +79 -107
  116. data/docs/TemplateActor.md +26 -0
  117. data/docs/TemplateActorType.md +15 -0
  118. data/docs/TemplateDefaults.md +56 -0
  119. data/docs/TemplateDefaultsInput.md +56 -0
  120. data/docs/TemplateDiff.md +30 -0
  121. data/docs/TemplateDiffSummary.md +28 -0
  122. data/docs/TemplateDocument.md +40 -0
  123. data/docs/TemplateDocumentState.md +15 -0
  124. data/docs/TemplateFieldChange.md +24 -0
  125. data/docs/TemplateFieldChanges.md +24 -0
  126. data/docs/TemplateFieldDependency.md +26 -0
  127. data/docs/TemplateFieldDependencyAction.md +15 -0
  128. data/docs/TemplateFieldDependencyCondition.md +24 -0
  129. data/docs/TemplateFieldDependencyConditionInput.md +93 -0
  130. data/docs/TemplateFieldDependencyInput.md +26 -0
  131. data/docs/TemplateFieldDependencyMatch.md +15 -0
  132. data/docs/TemplateFieldDependencyOperator.md +15 -0
  133. data/docs/TemplateFieldLogicStatus.md +15 -0
  134. data/docs/TemplateFieldMove.md +22 -0
  135. data/docs/TemplateFields.md +22 -0
  136. data/docs/TemplateFormMode.md +15 -0
  137. data/docs/TemplateModelCode.md +22 -0
  138. data/docs/TemplatePageAiError.md +15 -0
  139. data/docs/TemplatePageAiNamingStatus.md +15 -0
  140. data/docs/TemplatePageFieldsStatus.md +15 -0
  141. data/docs/TemplatePageImageStatus.md +15 -0
  142. data/docs/TemplatePageImages.md +24 -0
  143. data/docs/TemplatePageProcessingStatus.md +26 -0
  144. data/docs/TemplateSourcePdf.md +24 -0
  145. data/docs/TemplateSummary.md +90 -0
  146. data/docs/TemplateSummaryList.md +20 -0
  147. data/docs/TemplateType.md +15 -0
  148. data/docs/TemplateVersion.md +24 -0
  149. data/docs/TemplateVersionType.md +15 -0
  150. data/docs/TextAlignment.md +15 -0
  151. data/docs/TextOverflow.md +15 -0
  152. data/docs/TextVerticalAlignment.md +15 -0
  153. data/docs/Typeface.md +15 -0
  154. data/docs/UpdateSignatureRequestRequest.md +34 -0
  155. data/docs/UpdateTemplateDocumentRequest.md +26 -0
  156. data/docs/UpdateTemplateFieldsRequest.md +18 -0
  157. data/docs/UpdateTemplateRequest.md +86 -0
  158. data/docs/UpdateWebhookRequest.md +38 -0
  159. data/docs/UploadMethod.md +15 -0
  160. data/docs/UploadPresign.md +24 -0
  161. data/docs/UrlSourcePdf.md +20 -0
  162. data/docs/ValidateSubmissionRequest.md +38 -0
  163. data/docs/Webhook.md +20 -20
  164. data/docs/WebhookEventType.md +15 -0
  165. data/docs/WebhookList.md +20 -0
  166. data/docs/WebhookMode.md +15 -0
  167. data/docspring.gemspec +3 -3
  168. data/lib/docspring/api/client.rb +1606 -905
  169. data/lib/docspring/api_client.rb +14 -6
  170. data/lib/docspring/api_error.rb +3 -3
  171. data/lib/docspring/api_model_base.rb +88 -0
  172. data/lib/docspring/configuration.rb +12 -7
  173. data/lib/docspring/models/add_template_fields_request.rb +187 -0
  174. data/lib/docspring/models/ai_field_naming_language.rb +42 -0
  175. data/lib/docspring/models/authentication_check.rb +185 -0
  176. data/lib/docspring/models/barcode_symbology.rb +47 -0
  177. data/lib/docspring/models/check_character.rb +44 -0
  178. data/lib/docspring/models/combined_field_type.rb +41 -0
  179. data/lib/docspring/models/{combined_submission.rb → combined_pdf.rb} +228 -206
  180. data/lib/docspring/models/combined_pdf_files.rb +167 -0
  181. data/lib/docspring/models/combined_pdf_list.rb +200 -0
  182. data/lib/docspring/models/{create_webhook_data.rb → combined_pdf_source.rb} +107 -103
  183. data/lib/docspring/models/combined_pdf_source_input.rb +62 -0
  184. data/lib/docspring/models/combined_pdf_source_pdf.rb +212 -0
  185. data/lib/docspring/models/combined_pdf_source_type.rb +44 -0
  186. data/lib/docspring/models/combined_pdf_state.rb +44 -0
  187. data/lib/docspring/models/{copy_template_options.rb → copy_template_request.rb} +32 -87
  188. data/lib/docspring/models/{combine_pdfs_data.rb → create_combined_pdf_request.rb} +60 -123
  189. data/lib/docspring/models/{create_custom_file_data.rb → create_custom_file_from_upload_request.rb} +29 -96
  190. data/lib/docspring/models/{move_template_data.rb → create_folder_request.rb} +60 -102
  191. data/lib/docspring/models/{create_submission_data_request_event_request.rb → create_signature_request_event_request.rb} +50 -122
  192. data/lib/docspring/models/create_signature_request_token_request.rb +190 -0
  193. data/lib/docspring/models/{submission_batch_data.rb → create_submission_batch_request.rb} +75 -108
  194. data/lib/docspring/models/{create_pdf_submission_data.rb → create_submission_request.rb} +114 -144
  195. data/lib/docspring/models/create_template_request.rb +646 -0
  196. data/lib/docspring/models/create_webhook_request.rb +368 -0
  197. data/lib/docspring/models/custom_file.rb +132 -95
  198. data/lib/docspring/models/custom_file_list.rb +200 -0
  199. data/lib/docspring/models/custom_file_source_pdf.rb +212 -0
  200. data/lib/docspring/models/error_code.rb +60 -0
  201. data/lib/docspring/models/error_detail.rb +242 -0
  202. data/lib/docspring/models/error_info.rb +316 -0
  203. data/lib/docspring/models/error_response.rb +28 -138
  204. data/lib/docspring/models/expiration_interval.rb +42 -0
  205. data/lib/docspring/models/field.rb +2217 -0
  206. data/lib/docspring/models/field_comparison_condition.rb +247 -0
  207. data/lib/docspring/models/field_comparison_operator.rb +43 -0
  208. data/lib/docspring/models/field_dependency.rb +246 -0
  209. data/lib/docspring/models/field_dependency_input.rb +246 -0
  210. data/lib/docspring/models/field_display_type.rb +45 -0
  211. data/lib/docspring/models/field_equals_condition.rb +247 -0
  212. data/lib/docspring/models/field_equals_operator.rb +41 -0
  213. data/lib/docspring/models/field_group.rb +368 -0
  214. data/lib/docspring/models/field_group_input.rb +247 -0
  215. data/lib/docspring/models/field_group_type.rb +41 -0
  216. data/lib/docspring/models/{create_folder_data.rb → field_in_condition.rb} +101 -103
  217. data/lib/docspring/models/field_input.rb +1109 -0
  218. data/lib/docspring/models/field_override.rb +829 -0
  219. data/lib/docspring/models/field_presence_condition.rb +234 -0
  220. data/lib/docspring/models/field_presence_operator.rb +41 -0
  221. data/lib/docspring/models/field_range_condition.rb +234 -0
  222. data/lib/docspring/models/field_reimport_state.rb +43 -0
  223. data/lib/docspring/models/field_setup_logic.rb +41 -0
  224. data/lib/docspring/models/field_setup_naming.rb +41 -0
  225. data/lib/docspring/models/field_setup_source.rb +42 -0
  226. data/lib/docspring/models/field_type.rb +54 -0
  227. data/lib/docspring/models/folder.rb +134 -93
  228. data/lib/docspring/models/folder_list.rb +200 -0
  229. data/lib/docspring/models/generate_files_format.rb +40 -0
  230. data/lib/docspring/models/generate_submission_files_request.rb +187 -0
  231. data/lib/docspring/models/generated_file.rb +326 -0
  232. data/lib/docspring/models/generated_file_state.rb +42 -0
  233. data/lib/docspring/models/html_engine_options.rb +416 -0
  234. data/lib/docspring/models/html_engine_options_input.rb +280 -0
  235. data/lib/docspring/models/image_gravity.rb +48 -0
  236. data/lib/docspring/models/image_scale_type.rb +42 -0
  237. data/lib/docspring/models/model_code_language.rb +48 -0
  238. data/lib/docspring/models/{move_folder_data.rb → move_folder_request.rb} +31 -87
  239. data/lib/docspring/models/move_template_request.rb +171 -0
  240. data/lib/docspring/models/number_condition_type.rb +45 -0
  241. data/lib/docspring/models/output_format.rb +41 -0
  242. data/lib/docspring/models/page_format.rb +52 -0
  243. data/lib/docspring/models/page_image.rb +359 -0
  244. data/lib/docspring/models/page_images.rb +248 -0
  245. data/lib/docspring/models/predefined_field.rb +287 -0
  246. data/lib/docspring/models/predefined_field_input.rb +287 -0
  247. data/lib/docspring/models/{publish_version_data.rb → publish_template_version_request.rb} +64 -99
  248. data/lib/docspring/models/remove_template_fields_request.rb +187 -0
  249. data/lib/docspring/models/{rename_folder_data.rb → rename_folder_request.rb} +29 -87
  250. data/lib/docspring/models/reorder_template_fields_request.rb +187 -0
  251. data/lib/docspring/models/{restore_version_data.rb → restore_template_version_request.rb} +29 -87
  252. data/lib/docspring/models/shape_type.rb +45 -0
  253. data/lib/docspring/models/{submission_data_request_show.rb → signature_request.rb} +240 -171
  254. data/lib/docspring/models/signature_request_auth_second_factor_type.rb +45 -0
  255. data/lib/docspring/models/signature_request_auth_type.rb +46 -0
  256. data/lib/docspring/models/{submission_data_request_event.rb → signature_request_event.rb} +137 -122
  257. data/lib/docspring/models/signature_request_event_type.rb +45 -0
  258. data/lib/docspring/models/{update_submission_data_request_data.rb → signature_request_input.rb} +156 -173
  259. data/lib/docspring/models/signature_request_message_type.rb +48 -0
  260. data/lib/docspring/models/signature_request_state.rb +42 -0
  261. data/lib/docspring/models/signature_request_token.rb +369 -0
  262. data/lib/docspring/models/signature_request_token_type.rb +41 -0
  263. data/lib/docspring/models/string_condition_type.rb +44 -0
  264. data/lib/docspring/models/submission.rb +399 -335
  265. data/lib/docspring/models/submission_action.rb +64 -136
  266. data/lib/docspring/models/submission_action_state.rb +43 -0
  267. data/lib/docspring/models/submission_action_type.rb +46 -0
  268. data/lib/docspring/models/submission_batch.rb +157 -112
  269. data/lib/docspring/models/submission_batch_state.rb +42 -0
  270. data/lib/docspring/models/submission_files.rb +197 -0
  271. data/lib/docspring/models/submission_input.rb +296 -0
  272. data/lib/docspring/models/submission_list.rb +200 -0
  273. data/lib/docspring/models/submission_source.rb +43 -0
  274. data/lib/docspring/models/submission_source_pdf.rb +212 -0
  275. data/lib/docspring/models/submission_state.rb +52 -0
  276. data/lib/docspring/models/submission_validation.rb +234 -0
  277. data/lib/docspring/models/template.rb +528 -736
  278. data/lib/docspring/models/template_actor.rb +259 -0
  279. data/lib/docspring/models/template_actor_type.rb +42 -0
  280. data/lib/docspring/models/template_defaults.rb +395 -0
  281. data/lib/docspring/models/template_defaults_input.rb +395 -0
  282. data/lib/docspring/models/template_diff.rb +321 -0
  283. data/lib/docspring/models/template_diff_summary.rb +320 -0
  284. data/lib/docspring/models/template_document.rb +396 -0
  285. data/lib/docspring/models/template_document_state.rb +46 -0
  286. data/lib/docspring/models/template_field_change.rb +266 -0
  287. data/lib/docspring/models/template_field_changes.rb +274 -0
  288. data/lib/docspring/models/{success_error_response.rb → template_field_dependency.rb} +122 -114
  289. data/lib/docspring/models/template_field_dependency_action.rb +42 -0
  290. data/lib/docspring/models/{create_pdf_template.rb → template_field_dependency_condition.rb} +116 -103
  291. data/lib/docspring/models/template_field_dependency_condition_input.rb +67 -0
  292. data/lib/docspring/models/template_field_dependency_input.rb +285 -0
  293. data/lib/docspring/models/template_field_dependency_match.rb +41 -0
  294. data/lib/docspring/models/template_field_dependency_operator.rb +49 -0
  295. data/lib/docspring/models/template_field_logic_status.rb +44 -0
  296. data/lib/docspring/models/{update_webhook_data.rb → template_field_move.rb} +99 -103
  297. data/lib/docspring/models/{add_fields_data.rb → template_fields.rb} +71 -89
  298. data/lib/docspring/models/template_form_mode.rb +42 -0
  299. data/lib/docspring/models/{template_model_code_response.rb → template_model_code.rb} +37 -96
  300. data/lib/docspring/models/template_page_ai_error.rb +43 -0
  301. data/lib/docspring/models/template_page_ai_naming_status.rb +41 -0
  302. data/lib/docspring/models/template_page_fields_status.rb +44 -0
  303. data/lib/docspring/models/template_page_image_status.rb +41 -0
  304. data/lib/docspring/models/template_page_images.rb +254 -0
  305. data/lib/docspring/models/template_page_processing_status.rb +275 -0
  306. data/lib/docspring/models/{update_pdf_template.rb → template_source_pdf.rb} +92 -103
  307. data/lib/docspring/models/{template_preview.rb → template_summary.rb} +436 -589
  308. data/lib/docspring/models/template_summary_list.rb +200 -0
  309. data/lib/docspring/models/template_type.rb +41 -0
  310. data/lib/docspring/models/template_version.rb +238 -0
  311. data/lib/docspring/models/template_version_type.rb +42 -0
  312. data/lib/docspring/models/text_alignment.rb +43 -0
  313. data/lib/docspring/models/text_overflow.rb +41 -0
  314. data/lib/docspring/models/text_vertical_alignment.rb +42 -0
  315. data/lib/docspring/models/typeface.rb +56 -0
  316. data/lib/docspring/models/{create_submission_data_request_data.rb → update_signature_request_request.rb} +72 -196
  317. data/lib/docspring/models/update_template_document_request.rb +208 -0
  318. data/lib/docspring/models/update_template_fields_request.rb +187 -0
  319. data/lib/docspring/models/update_template_request.rb +551 -0
  320. data/lib/docspring/models/update_webhook_request.rb +344 -0
  321. data/lib/docspring/models/upload_method.rb +40 -0
  322. data/lib/docspring/models/{upload_presign_response.rb → upload_presign.rb} +93 -140
  323. data/lib/docspring/models/url_source_pdf.rb +212 -0
  324. data/lib/docspring/models/validate_submission_request.rb +288 -0
  325. data/lib/docspring/models/webhook.rb +97 -107
  326. data/lib/docspring/models/webhook_event_type.rb +64 -0
  327. data/lib/docspring/models/webhook_list.rb +200 -0
  328. data/lib/docspring/models/webhook_mode.rb +41 -0
  329. data/lib/docspring/request_schemas.json +4967 -0
  330. data/lib/docspring/request_validator.rb +396 -0
  331. data/lib/docspring/version.rb +4 -4
  332. data/lib/docspring.rb +153 -53
  333. data/spec/api/client_spec.rb +411 -265
  334. data/spec/models/add_template_fields_request_spec.rb +36 -0
  335. data/spec/models/ai_field_naming_language_spec.rb +30 -0
  336. data/spec/models/authentication_check_spec.rb +36 -0
  337. data/spec/models/barcode_symbology_spec.rb +30 -0
  338. data/spec/models/check_character_spec.rb +30 -0
  339. data/spec/models/combined_field_type_spec.rb +30 -0
  340. data/spec/models/combined_pdf_files_spec.rb +36 -0
  341. data/spec/models/combined_pdf_list_spec.rb +42 -0
  342. data/spec/models/combined_pdf_source_input_spec.rb +44 -0
  343. data/spec/models/combined_pdf_source_pdf_spec.rb +42 -0
  344. data/spec/models/{submission_data_request_token_spec.rb → combined_pdf_source_spec.rb} +18 -12
  345. data/spec/models/combined_pdf_source_type_spec.rb +30 -0
  346. data/spec/models/{combined_submission_spec.rb → combined_pdf_spec.rb} +20 -24
  347. data/spec/models/combined_pdf_state_spec.rb +30 -0
  348. data/spec/models/{copy_template_options_spec.rb → copy_template_request_spec.rb} +9 -9
  349. data/spec/models/{combine_pdfs_data_spec.rb → create_combined_pdf_request_spec.rb} +12 -18
  350. data/spec/models/{create_custom_file_data_spec.rb → create_custom_file_from_upload_request_spec.rb} +9 -9
  351. data/spec/models/{move_template_data_spec.rb → create_folder_request_spec.rb} +11 -11
  352. data/spec/models/{list_submissions_response_spec.rb → create_signature_request_event_request_spec.rb} +18 -12
  353. data/spec/models/create_signature_request_token_request_spec.rb +36 -0
  354. data/spec/models/{submission_batch_data_spec.rb → create_submission_batch_request_spec.rb} +19 -13
  355. data/spec/models/{create_pdf_submission_data_spec.rb → create_submission_request_spec.rb} +29 -17
  356. data/spec/models/{template_preview_spec.rb → create_template_request_spec.rb} +49 -103
  357. data/spec/models/create_webhook_request_spec.rb +96 -0
  358. data/spec/models/custom_file_list_spec.rb +42 -0
  359. data/spec/models/custom_file_source_pdf_spec.rb +42 -0
  360. data/spec/models/custom_file_spec.rb +29 -5
  361. data/spec/models/error_code_spec.rb +30 -0
  362. data/spec/models/{create_submission_response_spec.rb → error_detail_spec.rb} +14 -18
  363. data/spec/models/{batch_generate_pdfs201_response_spec.rb → error_info_spec.rb} +27 -19
  364. data/spec/models/error_response_spec.rb +4 -14
  365. data/spec/models/expiration_interval_spec.rb +30 -0
  366. data/spec/models/field_comparison_condition_spec.rb +48 -0
  367. data/spec/models/field_comparison_operator_spec.rb +30 -0
  368. data/spec/models/field_dependency_input_spec.rb +48 -0
  369. data/spec/models/field_dependency_spec.rb +48 -0
  370. data/spec/models/field_display_type_spec.rb +30 -0
  371. data/spec/models/field_equals_condition_spec.rb +48 -0
  372. data/spec/models/field_equals_operator_spec.rb +30 -0
  373. data/spec/models/field_group_input_spec.rb +72 -0
  374. data/spec/models/field_group_spec.rb +78 -0
  375. data/spec/models/field_group_type_spec.rb +30 -0
  376. data/spec/models/field_in_condition_spec.rb +48 -0
  377. data/spec/models/field_input_spec.rb +570 -0
  378. data/spec/models/field_override_spec.rb +408 -0
  379. data/spec/models/field_presence_condition_spec.rb +42 -0
  380. data/spec/models/field_presence_operator_spec.rb +30 -0
  381. data/spec/models/field_range_condition_spec.rb +54 -0
  382. data/spec/models/field_reimport_state_spec.rb +30 -0
  383. data/spec/models/field_setup_logic_spec.rb +30 -0
  384. data/spec/models/field_setup_naming_spec.rb +30 -0
  385. data/spec/models/field_setup_source_spec.rb +30 -0
  386. data/spec/models/field_spec.rb +576 -0
  387. data/spec/models/field_type_spec.rb +30 -0
  388. data/spec/models/folder_list_spec.rb +42 -0
  389. data/spec/models/folder_spec.rb +16 -4
  390. data/spec/models/generate_files_format_spec.rb +30 -0
  391. data/spec/models/generate_submission_files_request_spec.rb +36 -0
  392. data/spec/models/generated_file_spec.rb +78 -0
  393. data/spec/models/generated_file_state_spec.rb +30 -0
  394. data/spec/models/html_engine_options_input_spec.rb +90 -0
  395. data/spec/models/html_engine_options_spec.rb +90 -0
  396. data/spec/models/image_gravity_spec.rb +30 -0
  397. data/spec/models/image_scale_type_spec.rb +30 -0
  398. data/spec/models/model_code_language_spec.rb +30 -0
  399. data/spec/models/move_folder_request_spec.rb +36 -0
  400. data/spec/models/move_template_request_spec.rb +36 -0
  401. data/spec/models/number_condition_type_spec.rb +30 -0
  402. data/spec/models/output_format_spec.rb +30 -0
  403. data/spec/models/page_format_spec.rb +30 -0
  404. data/spec/models/page_image_spec.rb +84 -0
  405. data/spec/models/page_images_spec.rb +54 -0
  406. data/spec/models/predefined_field_input_spec.rb +72 -0
  407. data/spec/models/predefined_field_spec.rb +72 -0
  408. data/spec/models/{publish_version_data_spec.rb → publish_template_version_request_spec.rb} +11 -11
  409. data/spec/models/remove_template_fields_request_spec.rb +36 -0
  410. data/spec/models/{rename_folder_data_spec.rb → rename_folder_request_spec.rb} +9 -9
  411. data/spec/models/reorder_template_fields_request_spec.rb +36 -0
  412. data/spec/models/restore_template_version_request_spec.rb +36 -0
  413. data/spec/models/shape_type_spec.rb +30 -0
  414. data/spec/models/signature_request_auth_second_factor_type_spec.rb +30 -0
  415. data/spec/models/signature_request_auth_type_spec.rb +30 -0
  416. data/spec/models/{submission_data_request_event_spec.rb → signature_request_event_spec.rb} +16 -18
  417. data/spec/models/signature_request_event_type_spec.rb +30 -0
  418. data/spec/models/{create_submission_data_request_data_spec.rb → signature_request_input_spec.rb} +28 -30
  419. data/spec/models/signature_request_message_type_spec.rb +30 -0
  420. data/spec/models/{submission_data_request_show_spec.rb → signature_request_spec.rb} +31 -31
  421. data/spec/models/signature_request_state_spec.rb +30 -0
  422. data/spec/models/signature_request_token_spec.rb +72 -0
  423. data/spec/models/signature_request_token_type_spec.rb +30 -0
  424. data/spec/models/string_condition_type_spec.rb +30 -0
  425. data/spec/models/submission_action_spec.rb +4 -22
  426. data/spec/models/submission_action_state_spec.rb +30 -0
  427. data/spec/models/submission_action_type_spec.rb +30 -0
  428. data/spec/models/submission_batch_spec.rb +27 -13
  429. data/spec/models/submission_batch_state_spec.rb +30 -0
  430. data/spec/models/submission_files_spec.rb +54 -0
  431. data/spec/models/{json_schema_spec.rb → submission_input_spec.rb} +21 -21
  432. data/spec/models/submission_list_spec.rb +42 -0
  433. data/spec/models/submission_source_pdf_spec.rb +42 -0
  434. data/spec/models/submission_source_spec.rb +30 -0
  435. data/spec/models/submission_spec.rb +27 -51
  436. data/spec/models/submission_state_spec.rb +30 -0
  437. data/spec/models/submission_validation_spec.rb +54 -0
  438. data/spec/models/template_actor_spec.rb +60 -0
  439. data/spec/models/template_actor_type_spec.rb +30 -0
  440. data/spec/models/{submission_data_request_spec.rb → template_defaults_input_spec.rb} +29 -53
  441. data/spec/models/{submission_preview_spec.rb → template_defaults_spec.rb} +29 -61
  442. data/spec/models/template_diff_spec.rb +72 -0
  443. data/spec/models/template_diff_summary_spec.rb +66 -0
  444. data/spec/models/template_document_spec.rb +102 -0
  445. data/spec/models/template_document_state_spec.rb +30 -0
  446. data/spec/models/template_field_change_spec.rb +54 -0
  447. data/spec/models/template_field_changes_spec.rb +54 -0
  448. data/spec/models/template_field_dependency_action_spec.rb +30 -0
  449. data/spec/models/template_field_dependency_condition_input_spec.rb +44 -0
  450. data/spec/models/template_field_dependency_condition_spec.rb +54 -0
  451. data/spec/models/template_field_dependency_input_spec.rb +60 -0
  452. data/spec/models/template_field_dependency_match_spec.rb +30 -0
  453. data/spec/models/template_field_dependency_operator_spec.rb +30 -0
  454. data/spec/models/template_field_dependency_spec.rb +60 -0
  455. data/spec/models/template_field_logic_status_spec.rb +30 -0
  456. data/spec/models/template_field_move_spec.rb +48 -0
  457. data/spec/models/template_fields_spec.rb +48 -0
  458. data/spec/models/template_form_mode_spec.rb +30 -0
  459. data/spec/models/{template_model_code_response_spec.rb → template_model_code_spec.rb} +9 -13
  460. data/spec/models/template_page_ai_error_spec.rb +30 -0
  461. data/spec/models/template_page_ai_naming_status_spec.rb +30 -0
  462. data/spec/models/template_page_fields_status_spec.rb +30 -0
  463. data/spec/models/template_page_image_status_spec.rb +30 -0
  464. data/spec/models/template_page_images_spec.rb +54 -0
  465. data/spec/models/template_page_processing_status_spec.rb +60 -0
  466. data/spec/models/template_source_pdf_spec.rb +54 -0
  467. data/spec/models/template_spec.rb +44 -140
  468. data/spec/models/template_summary_list_spec.rb +42 -0
  469. data/spec/models/template_summary_spec.rb +252 -0
  470. data/spec/models/template_type_spec.rb +30 -0
  471. data/spec/models/template_version_spec.rb +54 -0
  472. data/spec/models/template_version_type_spec.rb +30 -0
  473. data/spec/models/text_alignment_spec.rb +30 -0
  474. data/spec/models/text_overflow_spec.rb +30 -0
  475. data/spec/models/text_vertical_alignment_spec.rb +30 -0
  476. data/spec/models/typeface_spec.rb +30 -0
  477. data/spec/models/{submission_batch_with_submissions_spec.rb → update_signature_request_request_spec.rb} +18 -22
  478. data/spec/models/update_template_document_request_spec.rb +60 -0
  479. data/spec/models/update_template_fields_request_spec.rb +36 -0
  480. data/spec/models/update_template_request_spec.rb +240 -0
  481. data/spec/models/update_webhook_request_spec.rb +96 -0
  482. data/spec/models/upload_method_spec.rb +30 -0
  483. data/spec/models/{upload_presign_response_spec.rb → upload_presign_spec.rb} +13 -17
  484. data/spec/models/url_source_pdf_spec.rb +42 -0
  485. data/spec/models/validate_submission_request_spec.rb +96 -0
  486. data/spec/models/webhook_event_type_spec.rb +30 -0
  487. data/spec/models/webhook_list_spec.rb +42 -0
  488. data/spec/models/webhook_mode_spec.rb +30 -0
  489. data/spec/models/webhook_spec.rb +4 -8
  490. data/spec/spec_helper.rb +3 -3
  491. metadata +597 -202
  492. data/docs/AddFieldsData.md +0 -18
  493. data/docs/BatchGeneratePdfs201Response.md +0 -28
  494. data/docs/CombinePdfsData.md +0 -28
  495. data/docs/CombinedSubmission.md +0 -44
  496. data/docs/CombinedSubmissionAction.md +0 -30
  497. data/docs/CopyTemplateOptions.md +0 -22
  498. data/docs/CreateCombinedSubmissionResponse.md +0 -26
  499. data/docs/CreateCustomFileData.md +0 -18
  500. data/docs/CreateCustomFileResponse.md +0 -24
  501. data/docs/CreateHtmlTemplate.md +0 -18
  502. data/docs/CreatePdfSubmissionData.md +0 -34
  503. data/docs/CreatePdfTemplate.md +0 -18
  504. data/docs/CreateSubmissionDataRequestData.md +0 -44
  505. data/docs/CreateSubmissionDataRequestEventRequest.md +0 -24
  506. data/docs/CreateSubmissionDataRequestEventResponse.md +0 -24
  507. data/docs/CreateSubmissionDataRequestResponse.md +0 -24
  508. data/docs/CreateSubmissionDataRequestTokenResponse.md +0 -24
  509. data/docs/CreateSubmissionResponse.md +0 -26
  510. data/docs/ErrorOrMultipleErrorsResponse.md +0 -22
  511. data/docs/ForbiddenErrorResponse.md +0 -22
  512. data/docs/JsonSchema.md +0 -40
  513. data/docs/ListSubmissionsResponse.md +0 -22
  514. data/docs/MoveFolderData.md +0 -18
  515. data/docs/MoveTemplateData.md +0 -20
  516. data/docs/MultipleErrorsResponse.md +0 -20
  517. data/docs/PublishVersionData.md +0 -20
  518. data/docs/RestoreVersionData.md +0 -18
  519. data/docs/Submission422Response.md +0 -24
  520. data/docs/SubmissionBatchData.md +0 -26
  521. data/docs/SubmissionBatchWithSubmissions.md +0 -34
  522. data/docs/SubmissionDataRequest.md +0 -60
  523. data/docs/SubmissionDataRequestEvent.md +0 -30
  524. data/docs/SubmissionDataRequestShow.md +0 -62
  525. data/docs/SubmissionDataRequestToken.md +0 -24
  526. data/docs/SubmissionPreview.md +0 -64
  527. data/docs/SuccessErrorResponse.md +0 -20
  528. data/docs/SuccessMultipleErrorsResponse.md +0 -20
  529. data/docs/TemplateAddFieldsResponse.md +0 -22
  530. data/docs/TemplateDeleteResponse.md +0 -24
  531. data/docs/TemplateModelCodeResponse.md +0 -22
  532. data/docs/TemplatePreview.md +0 -116
  533. data/docs/TemplatePublishVersionResponse.md +0 -22
  534. data/docs/UpdateHtmlTemplate.md +0 -18
  535. data/docs/UpdatePdfTemplate.md +0 -18
  536. data/docs/UpdateSubmissionDataRequestData.md +0 -42
  537. data/docs/UploadPresignResponse.md +0 -24
  538. data/lib/docspring/models/batch_generate_pdfs201_response.rb +0 -352
  539. data/lib/docspring/models/combined_submission_action.rb +0 -384
  540. data/lib/docspring/models/create_combined_submission_response.rb +0 -324
  541. data/lib/docspring/models/create_custom_file_response.rb +0 -314
  542. data/lib/docspring/models/create_html_template.rb +0 -243
  543. data/lib/docspring/models/create_submission_data_request_event_response.rb +0 -314
  544. data/lib/docspring/models/create_submission_data_request_response.rb +0 -314
  545. data/lib/docspring/models/create_submission_data_request_token_response.rb +0 -314
  546. data/lib/docspring/models/create_submission_response.rb +0 -324
  547. data/lib/docspring/models/error_or_multiple_errors_response.rb +0 -290
  548. data/lib/docspring/models/forbidden_error_response.rb +0 -323
  549. data/lib/docspring/models/json_schema.rb +0 -329
  550. data/lib/docspring/models/list_submissions_response.rb +0 -283
  551. data/lib/docspring/models/multiple_errors_response.rb +0 -296
  552. data/lib/docspring/models/submission422_response.rb +0 -299
  553. data/lib/docspring/models/submission_batch_with_submissions.rb +0 -433
  554. data/lib/docspring/models/submission_data_request.rb +0 -570
  555. data/lib/docspring/models/submission_data_request_token.rb +0 -279
  556. data/lib/docspring/models/submission_preview.rb +0 -637
  557. data/lib/docspring/models/success_multiple_errors_response.rb +0 -279
  558. data/lib/docspring/models/template_add_fields_response.rb +0 -290
  559. data/lib/docspring/models/template_delete_response.rb +0 -300
  560. data/lib/docspring/models/template_publish_version_response.rb +0 -305
  561. data/lib/docspring/models/update_html_template.rb +0 -243
  562. data/spec/models/add_fields_data_spec.rb +0 -36
  563. data/spec/models/combined_submission_action_spec.rb +0 -84
  564. data/spec/models/create_combined_submission_response_spec.rb +0 -64
  565. data/spec/models/create_custom_file_response_spec.rb +0 -58
  566. data/spec/models/create_folder_data_spec.rb +0 -36
  567. data/spec/models/create_html_template_spec.rb +0 -36
  568. data/spec/models/create_pdf_template_spec.rb +0 -36
  569. data/spec/models/create_submission_data_request_event_request_spec.rb +0 -62
  570. data/spec/models/create_submission_data_request_event_response_spec.rb +0 -58
  571. data/spec/models/create_submission_data_request_response_spec.rb +0 -58
  572. data/spec/models/create_submission_data_request_token_response_spec.rb +0 -58
  573. data/spec/models/create_webhook_data_spec.rb +0 -36
  574. data/spec/models/error_or_multiple_errors_response_spec.rb +0 -52
  575. data/spec/models/forbidden_error_response_spec.rb +0 -56
  576. data/spec/models/move_folder_data_spec.rb +0 -36
  577. data/spec/models/multiple_errors_response_spec.rb +0 -46
  578. data/spec/models/restore_version_data_spec.rb +0 -36
  579. data/spec/models/submission422_response_spec.rb +0 -58
  580. data/spec/models/success_error_response_spec.rb +0 -46
  581. data/spec/models/success_multiple_errors_response_spec.rb +0 -46
  582. data/spec/models/template_add_fields_response_spec.rb +0 -52
  583. data/spec/models/template_delete_response_spec.rb +0 -58
  584. data/spec/models/template_publish_version_response_spec.rb +0 -52
  585. data/spec/models/update_html_template_spec.rb +0 -36
  586. data/spec/models/update_pdf_template_spec.rb +0 -36
  587. data/spec/models/update_submission_data_request_data_spec.rb +0 -116
  588. data/spec/models/update_webhook_data_spec.rb +0 -36
data/.travis.yml CHANGED
@@ -8,4 +8,4 @@ script:
8
8
  - bundle install --path vendor/bundle
9
9
  - bundle exec rspec
10
10
  - gem build docspring.gemspec
11
- - gem install ./docspring-3.5.0.gem
11
+ - gem install ./docspring-4.1.0.gem
data/AGENTS.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # AGENTS.md
2
2
 
3
- Notes for AI coding agents working with the DocSpring Ruby SDK (`docspring`), in this repository or
4
- as a dependency of an app.
3
+ Notes for AI coding agents working with the DocSpring Ruby SDK (`docspring`): integrating it into an
4
+ app, or working in this repository.
5
5
 
6
6
  ## This code is generated
7
7
 
8
8
  Every file here is generated from DocSpring's OpenAPI spec by
9
9
  [DocSpring's fork of OpenAPI Generator](https://github.com/DocSpring/openapi-generator/tree/docspring/all_patches), and each release replaces
10
- all of it. Don't edit it or open pull requests that change it, and don't patch an installed copy: the next release
11
- overwrites the change. Report bugs at https://github.com/DocSpring/docspring-ruby/issues or to support@docspring.com, and DocSpring fixes them in
12
- the generator.
10
+ all of it. Don't patch an installed copy: the next release overwrites the change. Issues and pull requests are welcome
11
+ at https://github.com/DocSpring/docspring-ruby (or email support@docspring.com), and DocSpring makes the fix in the generator so that every release
12
+ keeps it.
13
13
 
14
14
  ## Where to look
15
15
 
@@ -17,17 +17,77 @@ the generator.
17
17
  - [docs/Client.md](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md): every method, with its parameters and return type.
18
18
  - [docs/](https://github.com/DocSpring/docspring-ruby/tree/main/docs): every model and its fields.
19
19
  - https://docspring.com/docs/llms.txt: DocSpring's documentation for LLMs (`llms-small.txt`, `llms-full.txt`).
20
- - https://docspring.com/docs/api/: the API reference, with Ruby code for every method.
21
- - https://docspring.com/api-docs/v1/openapi.json: the OpenAPI spec this SDK is generated from.
22
-
23
- ## Using it in an app
24
-
25
- - Credentials come from `DOCSPRING_TOKEN_ID` and `DOCSPRING_TOKEN_SECRET`. Keep them in the environment or a secret
26
- store, never in code. Accounts in the EU region also need `DOCSPRING_REGION=EU`.
27
- - Template IDs look like `tpl_...` and submission IDs like `sub_...`.
28
- - Pass `test: true` when you generate PDFs during development: test PDFs are free and watermarked.
29
- - Generating a PDF waits for it, for up to 95 seconds. For many PDFs or slow templates, set `wait` to false and use
30
- webhooks or check the submission later (https://docspring.com/docs/api-guide/synchronous-requests/).
31
- - Errors: Methods raise `DocSpring::ApiError` for an error response, with the HTTP status in `code` and the body in `response_body`.
32
- - Responses can be newer than this SDK, because DocSpring adds fields and enum values to API v1 without a new
33
- version. The model leaves out a response field added to the API after this release. An enum value added to the API after this release comes back as a string, so handle values you don't recognize.
20
+ - https://docspring.com/docs/: the guides. https://docspring.com/docs/api/: the API reference, with Ruby code
21
+ for every method.
22
+ - https://docspring.com/api-docs/v2/openapi.json: the OpenAPI spec this SDK is generated from.
23
+
24
+ ## Set up
25
+
26
+ - Credentials come from `DOCSPRING_TOKEN_ID` and `DOCSPRING_TOKEN_SECRET` (an API token from
27
+ https://app.docspring.com/api_tokens). Keep them in the environment or a secret store, never in code. An account in
28
+ the EU region also needs `DOCSPRING_REGION=EU`.
29
+ - Call DocSpring from your server. The token secret gives full access to the account, so it must never reach a browser
30
+ or a mobile app. Signers use signing links or the embedded signing form instead (see Signature requests).
31
+ - `test_authentication` checks the credentials.
32
+
33
+ ## Generate PDFs
34
+
35
+ - Read a template's data shape before writing the request: `get_template_schema` returns the
36
+ JSON Schema of its submission data (its field names and types), and `get_template_model_code`
37
+ generates typed code for it. The keys of `data` are the template's field names. Date fields take `YYYY-MM-DD`.
38
+ - Template IDs look like `tpl_...` and submission IDs like `sub_...`. Store the submission ID with your own record.
39
+ - Pass `test: true` while you build: test PDFs are free and watermarked. Live PDFs use credits.
40
+ - A submission uses the template's latest published version (its draft when nothing has been published yet). Pass
41
+ `version` (`draft`, `1.2.0`, or `1` for the latest 1.x.x) to use another one.
42
+ - `create_submission` waits for the PDF, for up to 95 seconds, and returns the submission in
43
+ its final state: check its `state` (`processed`, or a failure state with an `error_message`). If the PDF takes longer,
44
+ the call fails with a 504 `polling_timeout` error that has the submission's ID. The submission exists and is still
45
+ being made, so don't send the request again (that makes a second one): get it with
46
+ `get_submission` until its state isn't `pending`. For slow templates or many PDFs, set
47
+ `wait` to false and use webhooks (https://docspring.com/docs/api-guide/synchronous-requests/).
48
+ `create_submission_batch` sends up to 50 submissions in one request.
49
+ - `files.pdf.download_url` is a temporary link. Keep the submission ID (or `files.pdf.permanent_url`, which needs your
50
+ API token) and get a fresh link when someone downloads the PDF.
51
+ - Submission data is often personal data: don't log request or response bodies. `expires_in` deletes a submission's PDF
52
+ and data that many seconds after it's created, and `expire_submission` deletes them now.
53
+
54
+ ## Errors
55
+
56
+ - Methods raise `DocSpring::ApiError` for an error response, with the HTTP status in `code` and the body in `response_body`.
57
+ - Every error response has one body: `{"error": {"code", "message", "details", "request_id"}}`. Branch on `code`, not
58
+ on the message. Each detail has a `pointer` to the request body value it's about, or the query `parameter`.
59
+ - 422 `invalid_data`: the data doesn't match the template. The submission is saved anyway, as `invalid_data`, and the
60
+ error has its `submission_id`.
61
+ - 402 `insufficient_credits`: the submission is saved and is made automatically once the account has credits. Don't
62
+ send it again (https://docspring.com/docs/api-guide/credits-and-rate-limits/).
63
+ - 429 `rate_limited`: wait for the seconds in the `Retry-After` header, then retry.
64
+ - Requests are checked against the API's request schemas before they're sent. A request the API would reject raises `DocSpring::ValidationError` (an `ArgumentError`), whose `details` are hashes with `code`, `message` and a `pointer` into the body (or a `parameter`). Turn the check off with `client.api_client.config.client_side_validation = false`.
65
+
66
+ ## Webhooks
67
+
68
+ - Webhooks tell your server when a submission is processed or fails, instead of polling
69
+ (https://docspring.com/docs/webhooks/overview/). A webhook created with API v2 sends events in API v2's format
70
+ (version 4).
71
+ - Verify each request's `X-DocSpring-Signature` header before acting on it: an HMAC-SHA256 of `{t}.{raw body}` with the
72
+ webhook's signing secret, computed over the raw body exactly as received
73
+ (https://docspring.com/docs/webhooks/verifying-signatures/).
74
+ - No webhook is sent when a submission starts waiting for credits.
75
+
76
+ ## Signature requests
77
+
78
+ - To have people fill in fields and sign before the PDF is made, create the submission with `signature_requests`. Each
79
+ one has the `fields` its signer fills in (a field belongs to one signature request), and their `name` and `email`.
80
+ The PDF is made when every signer has finished
81
+ (https://docspring.com/docs/api-guide/create-signature-requests/).
82
+ - Send a signer to the `signature_request_url` of a token from
83
+ `create_signature_request_token`. An `api` token's link opens the form for 24 hours and an
84
+ `email` token's for 7 days (`expires_at`), so create a new token when a signer comes back later.
85
+ - To show the signing form on your own site, use Signature Requests JS, and add the site's domain to the template's
86
+ Embed Domains (https://docspring.com/docs/guides/embedded-forms/embedded-signature-requests/).
87
+
88
+ ## Responses
89
+
90
+ - List methods return `data` and `next_cursor`: pass `next_cursor` as `cursor` to get the next page.
91
+ - Responses can be newer than this SDK, because DocSpring adds fields and enum values to API v2 without a new
92
+ version. The model leaves out a response field added to the API after this release. Enum values in responses are strings, so a
93
+ value added after this release comes back as it is: handle values you don't recognize.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,150 @@
1
+ ### 4.1.0 [October 27, 2026]
2
+
3
+ - New: list_template_fields, add_template_fields, update_template_fields, remove_template_fields and
4
+ reorder_template_fields read and edit a template's fields (`Field`), with all their settings and their own conditional
5
+ logic (`dependencies`). A field's `y` is measured from the top of its page.
6
+ - New: a template's `predefined_fields` (`PredefinedField`) and `predefined_fields_sample_data`, the field names that
7
+ people using the embedded template editor choose from. get_template returns them, and create_template and
8
+ update_template set them.
9
+ - New: a template's `field_groups` (`FieldGroup`), the groups that its fields' names make, with their titles and the
10
+ settings of lists (`min_items`, `max_items`, `allow_additional_items`). get_template returns them, and update_template
11
+ changes them.
12
+ - New: get_template_page_images returns an image of each page of a PDF template (`TemplatePageImages`), to see where
13
+ fields go.
14
+ - New: get_template_diff says what changed in a template's draft since its latest published version, or in a published
15
+ version since the one before it (`TemplateDiff`).
16
+ - New: validate_submission checks a submission's data and settings as create_submission does, without creating the
17
+ submission or using credits (`SubmissionValidation`). It doesn't check your account's credits.
18
+ - New: the `png` output format, an image of each page of a submission's PDF (`files.png.pages`). Add it to
19
+ `output_formats` in create_submission or create_submission_batch (it adds `pdf`), or to a processed submission with
20
+ generate_submission_files.
21
+ - create_template and update_template_document take a `document_url` (DocSpring downloads it) or a `document_base64`
22
+ instead of a `cache_id`. While the URL downloads, the template's `document.state` is `downloading`; if it can't be
23
+ downloaded, it's `download_failed` and `document.error_message` says why.
24
+
25
+ ### 4.0.0 [October 26, 2026]
26
+
27
+ - **BREAKING CHANGE**: This version calls DocSpring API v2 (`/api/v2`). The 3.x versions call API v1, which keeps
28
+ working. Every change is in the migration guide: https://docspring.com/docs/api-guide/migrating-to-api-v2/
29
+ - **BREAKING CHANGE**: If you set the API's full base URL yourself, change `/api/v1` in it to `/api/v2`. The client only
30
+ picks the version in the URLs it builds from a region or host.
31
+ - **BREAKING CHANGE**: Operations are named after the resource they act on. generate_pdf is create_submission,
32
+ batch_generate_pdfs is create_submission_batch, combine_pdfs is create_combined_pdf, create_html_template and
33
+ create_pdf_template_from_upload are create_template (with a `template_type`), create_pdf_template (which uploads a PDF
34
+ file) is upload_template, get_full_template is get_template (which returns the template, without its fields for now),
35
+ update_template_document (which uploads a PDF file) is upload_template_document, update_template_document_from_upload
36
+ is update_template_document, generate_preview is generate_submission_preview, get_combined_submission is
37
+ get_combined_pdf, list_combined_submissions is list_combined_pdfs, expire_combined_submission is expire_combined_pdf,
38
+ move_template_to_folder is move_template and move_folder_to_folder is move_folder. New: get_folder, list_custom_files,
39
+ get_custom_file and delete_custom_file. A template's fields, and adding fields to a template, aren't in API v2 yet.
40
+ - **BREAKING CHANGE**: Data requests are called signature requests. `get_data_request`, `update_data_request`,
41
+ `create_data_request_token` and `create_data_request_event` are `get_signature_request`, `update_signature_request`,
42
+ `create_signature_request_token` and `create_signature_request_event` (at `/signature_requests`), and their models are
43
+ `SignatureRequest`, `SignatureRequestToken` and `SignatureRequestEvent`. A submission's `data_requests` is
44
+ `signature_requests` (also when you create one), `data_request_id` is `signature_request_id`, a token's
45
+ `data_request_url` is `signature_request_url`, the `waiting_for_data_requests` state is
46
+ `waiting_for_signature_requests`, and a template's `add_data_request_submission_id_footers` is
47
+ `add_signature_request_submission_id_footers`. New ones get IDs that start with `srq_` instead of `drq_`.
48
+ - **BREAKING CHANGE**: A response is the resource itself, with no `status` or wrapper key. Lists return `data` and
49
+ `next_cursor`: pass `next_cursor` as `cursor` to get the next page, and `limit` (1 to 100, default 50) for its size.
50
+ `page` and `per_page` are gone. Every create returns 201.
51
+ - **BREAKING CHANGE**: Every error has one shape, `{"error": {"code", "message", "details", "request_id"}}`, with a
52
+ `code` to check (`validation_failed`, `not_found`, `insufficient_credits`, `rate_limited`, ...), and each detail has a
53
+ `pointer` to the body value it's about, or a `parameter` with the query parameter's name.
54
+ - **BREAKING CHANGE**: Requests are validated strictly: an unknown property or query parameter, or a value of the wrong
55
+ type, is a 422 instead of being ignored. Request bodies must be JSON (`Content-Type: application/json`, or it's a
56
+ 415), except the PDF uploads. Request bodies are flat, with no `template`, `folder` or `webhook` key around them.
57
+ - **BREAKING CHANGE**: Submission data is checked more strictly. An empty `data` is validated like any other, date
58
+ fields take `YYYY-MM-DD` (or the template's date format when `parse_dates_using_template_date_format` is on), and a
59
+ signature request's `fields` must be fields on the template (set `ignore_unknown_fields` to leave out the others). A
60
+ submission that fails because of the template is still saved as `invalid_data`, and the 422 includes its
61
+ `submission_id`.
62
+ - **BREAKING CHANGE**: A submission's or combined PDF's files are in `files`, by format. `files.pdf` has `state`,
63
+ `error_message`, `download_url`, `permanent_url`, `filename`, `content_type`, `size` and `sha256`, and replaces
64
+ `download_url`, `permanent_download_url` and `pdf_hash`. A submission's `files.audit_trail` and `files.preview`, with
65
+ the same properties, replace `audit_trail_download_url` and `preview_download_url`. A file made after its submission
66
+ was processed is listed while it's being made, so check its `state` before using its links. Combined submissions are
67
+ combined PDFs (`CombinedPdf`), a template's `document_url` is `document.download_url`, and a custom file's `url` is
68
+ `download_url`.
69
+ - **BREAKING CHANGE**: A template's `embed_domains` is a list of domains, not a comma-separated string, and each entry
70
+ is checked. Copying a template with `parent_folder_id` null puts the copy at the root (leave it out to keep the
71
+ template's folder). A template's schema and model code describe the version that submissions use by default (the
72
+ latest published version), not the draft: pass `version` for another one.
73
+ - **BREAKING CHANGE**: Every property name is snake_case, including template `defaults` (`font_size`, was `fontSize`),
74
+ `html_engine_options` (`margin_top`), a field dependency condition's `range_max`, and the field settings in a
75
+ submission's `field_overrides`.
76
+ - `field_overrides` takes a `DocSpring::FieldOverride` per field name, with every setting an override can change
77
+ (`required`, `font_size`, `color`, ...), so a misspelt setting or a value of the wrong type is caught before the
78
+ request is sent.
79
+ - A combined PDF's `source_pdfs` and a rule's `conditions` take a model per kind, with only the properties that kind
80
+ uses (another kind's property is a 422 `not_allowed`). `CombinedPdfSourceInput` is a `SubmissionSourcePdf`,
81
+ `CombinedPdfSourcePdf`, `TemplateSourcePdf`, `CustomFileSourcePdf` or `UrlSourcePdf`, picked by its `type`.
82
+ `TemplateFieldDependencyConditionInput` is a `FieldPresenceCondition` (`present`, `blank`), `FieldEqualsCondition`
83
+ (`equals`, `not_equals`), `FieldInCondition` (`in`, with a list), `FieldComparisonCondition` (`gt`, `gte`, `lt`,
84
+ `lte`, on a number field) or `FieldRangeCondition` (`range`), picked by its `operator`. Pass hashes, or the models,
85
+ which set their own `type` (and `FieldInCondition` and `FieldRangeCondition` their `operator`):
86
+ `DocSpring::UrlSourcePdf.new(url: url)`. A template returns its conditions with only the properties their operators
87
+ use, in the shape an update takes.
88
+ - **BREAKING CHANGE**: Templates: `ready` and a `document` object (with its `state`, `page_count` and
89
+ `page_dimensions`) replace `document_processed`, `document_state`, `document_parse_error` and the `page_*` fields.
90
+ `list_templates` returns template summaries. Templates have no `webhook_url` or `webhook_options`: create a webhook
91
+ with `template_ids` instead.
92
+ - **BREAKING CHANGE**: Secrets are write-only. A submission's or combined PDF's `password` and a template's
93
+ `encrypt_pdfs_password` and `slack_webhook_url` aren't returned; `has_password`, `has_encrypt_pdfs_password` and
94
+ `has_slack_webhook_url` say whether one is set.
95
+ - **BREAKING CHANGE**: Webhooks created with this version send payload version 4, `{"id", "event_type", "created_at",
96
+ "data"}`, where `data` is the resource as API v2 returns it. Their events have API v2's names
97
+ (`combined_pdf.processed`, `signature_request.completed`). Webhooks created with 3.x or in the dashboard keep their
98
+ payload version.
99
+ - **BREAKING CHANGE**: Models are named after the API's resources (`Submission`, `CombinedPdf`, `Template`,
100
+ `TemplateSummary`, `SignatureRequest`), request bodies after their operation (`CreateSubmissionRequest`), and
101
+ enums are their own types (`SubmissionState`, `WebhookEventType`).
102
+ - Response enums are types too (`SubmissionState`, `TemplateType`). Their constants are the values this version knows
103
+ (`DocSpring::SubmissionState::PROCESSED`), and the values stay strings, so a value added to the API after this release
104
+ comes back as it came.
105
+ - The client checks each request against the API's request schemas before sending it, so an invalid request fails
106
+ without a round trip, with the details the API's 422 response would have. A request the API would reject raises
107
+ `DocSpring::ValidationError` (an `ArgumentError`), whose `details` are hashes with `code`, `message` and a `pointer`
108
+ into the body (or a `parameter`). The models' setters no longer check patterns, lengths or ranges themselves. Turn
109
+ the check off with `client.api_client.config.client_side_validation = false`.
110
+ - A waited request to `sync.api.docspring.com` that times out returns a 504 `polling_timeout` error with the resource's
111
+ ID, so you can get it later. Without an ID, the request got no answer in time: check whether the resource was created
112
+ before you send it again.
113
+ - A nullable map or list that you set to `nil` (such as a template's `html_engine_options`) is sent as `null` instead of
114
+ being left out.
115
+ - **BREAKING CHANGE**: A client created with credentials, a host or a region has its own `ApiClient`, with a copy of
116
+ `DocSpring::Configuration.default`, so two clients with different credentials or hosts no longer change each other's.
117
+ `DocSpring::Client.new` with no arguments still uses `ApiClient.default`. Pass `api_client:` to share one.
118
+ - An empty API token ID or secret counts as not set, so the client reads `DOCSPRING_TOKEN_ID` or
119
+ `DOCSPRING_TOKEN_SECRET` instead. It was sent as an empty string.
120
+ - Templates: new `default_form_mode` setting (`web`, `visual` or `dual`), when you create or update a template.
121
+ It's the hosted form that `/templates/<id>/form` opens when the link has no `mode` parameter: the web form, the
122
+ visual form (filled in on the PDF), or both in tabs. HTML templates have no visual form, so they only accept
123
+ `web`.
124
+ - Templates: `defaults` can set `required_field_background_color`, the background colour that visual forms and
125
+ signature requests give required fields. PDFs don't draw it.
126
+ - Templates: new `allow_skipping_optional_fields` setting (boolean), when you create or update a template. Visual
127
+ forms and signature requests then show the Continue button as soon as the required fields are filled in, without
128
+ visiting each optional field. The `allowSkippingOptionalFields` embed option overrides it.
129
+ - Templates: when you replace a template's PDF, `reimport_fields` (boolean) replaces the template's fields with the
130
+ fillable fields in the new PDF (or in its current PDF when you don't upload one). A PDF with no fillable fields
131
+ keeps the template's fields.
132
+ - Fields: `shape_type` can be `triangle` or `polygon`, with `shape_sides` (3 to 12) for a polygon. Text fields can set
133
+ `keep_leading_spaces` to keep the spaces at the start of each line in the PDF.
134
+ - Templates: create_template and upload_template take `detect_fields` (boolean, default false). DocSpring then sets
135
+ up the PDF's fields as the "Automatically detect fields" upload option does: it imports or detects them, names them
136
+ with AI and sets up conditional logic. `field_source` (`auto`, `pdf_detection` or `pdf_form_fields`),
137
+ `field_naming` (`ai` or `preserve`) and `field_logic` (`ai` or `none`) choose how, like the Set Up Fields choices
138
+ in the template editor. With `pdf_form_fields`, `preserve` and `none`, the PDF's form fields are imported with their
139
+ own names and no AI. Each account gets free AI pages every month, and further pages are paid from credits. See
140
+ https://docspring.com/docs/template-editor/automatic-field-detection/.
141
+ - Templates: new `ai_field_naming_language` setting (`auto`, `english` or `form_language`) for PDF templates, when
142
+ you create or update one: the language AI uses for field names. It's null for HTML templates.
143
+ - Templates: a template's `document` includes `has_fillable_fields`, `page_processing_statuses` (how processing is
144
+ going on each page: its image, its fields and AI naming) and `field_logic_status` (the AI logic step that runs once
145
+ every page's fields are done, and can still rename fields and add rules). Field setup is finished when
146
+ `document.state` is `processed` and `field_logic_status` isn't `pending` or `processing`.
147
+
1
148
  ### 3.5.0 [October 18, 2026]
2
149
 
3
150
  - Submissions and combined submissions can be in the new `insufficient_credits` state: a live PDF that your credit
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- docspring (3.5.0)
4
+ docspring (4.1.0)
5
5
  logger
6
6
  typhoeus (~> 1.0, >= 1.0.1)
7
7
 
@@ -33,10 +33,10 @@ GEM
33
33
  logger (1.7.0)
34
34
  method_source (1.1.0)
35
35
  parallel (1.28.0)
36
- parser (3.3.12.0)
36
+ parser (3.3.13.0)
37
37
  ast (~> 2.4.1)
38
38
  racc
39
- pry (0.16.0)
39
+ pry (0.16.1)
40
40
  coderay (~> 1.1)
41
41
  method_source (~> 1.0)
42
42
  reline (>= 0.6.0)
@@ -104,7 +104,7 @@ CHECKSUMS
104
104
  coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b
105
105
  date (3.6.0) sha256=18ac945c4e24ebd93534f8eab8c2fd8c5604b3e977105b3798d62a1e8d27b580
106
106
  diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
107
- docspring (3.5.0)
107
+ docspring (4.1.0)
108
108
  ethon (0.18.0) sha256=b598afc9f30448cb068b850714b7d6948e941476095d04f90a4ac65b8d6efcb2
109
109
  ffi (1.17.4) sha256=bcd1642e06f0d16fc9e09ac6d49c3a7298b9789bcb58127302f934e437d60acf
110
110
  ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df
@@ -122,8 +122,8 @@ CHECKSUMS
122
122
  logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
123
123
  method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
124
124
  parallel (1.28.0) sha256=33e6de1484baf2524792d178b0913fc8eb94c628d6cfe45599ad4458c638c970
125
- parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828
126
- pry (0.16.0) sha256=d76c69065698ed1f85e717bd33d7942c38a50868f6b0673c636192b3d1b6054e
125
+ parser (3.3.13.0) sha256=e02f9b63c2fe05b0c68f692ba4df89b3cb113b663964f75d988fbebfd6c3deca
126
+ pry (0.16.1) sha256=d92d82c86e7f2dc34beec6d2892d5cf5ea517eea22eed3ceabb38ee62a98accc
127
127
  pry-byebug (3.12.0) sha256=594e094ae8a8390a7ad4c7b36ae36e13304ed02664c67417d108dc5f7213d1b7
128
128
  psych (5.5.0) sha256=4b245bbbd0f3238df8ccee766ebc1a6b062b10e4ee1d3284eb588739ba156a0a
129
129
  racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
@@ -142,4 +142,4 @@ CHECKSUMS
142
142
  unicode-display_width (1.5.0) sha256=9890eebd24feb4cb0e0542c9b8c6beecb40cda27be8c7afe49312625b36156eb
143
143
 
144
144
  BUNDLED WITH
145
- 4.0.8
145
+ 4.0.20
data/README.md CHANGED
@@ -6,7 +6,10 @@ templates with your data, generates PDFs from HTML templates, combines PDFs and
6
6
  [Documentation](https://docspring.com/docs/) · [API reference](https://docspring.com/docs/api/) ·
7
7
  [RubyGems](https://rubygems.org/gems/docspring) · [Changelog](https://github.com/DocSpring/docspring-ruby/blob/main/CHANGELOG.md)
8
8
 
9
- Version 3.5.0. Requires Ruby >= 2.7.
9
+ The code in this repository is generated from DocSpring's OpenAPI spec ([About this SDK](#about-this-sdk)). Issues and
10
+ pull requests are welcome.
11
+
12
+ Version 4.1.0. Requires Ruby >= 2.7.
10
13
 
11
14
  ## Install and configure
12
15
 
@@ -57,22 +60,21 @@ Fill a template with data (use your template's ID in place of `tpl_1234567890abc
57
60
 
58
61
  ```ruby
59
62
  template_id = 'tpl_1234567890abcdef01'
60
- submission = {
61
- data: { first_name: 'John', last_name: 'Smith', phone_number: '+11234567890' },
62
- metadata: { foo: 123, bar: :baz },
63
+ body = {
64
+ data: { 'first_name' => 'John', 'last_name' => 'Smith', 'phone_number' => '+11234567890' },
65
+ metadata: { user_id: 42 },
66
+ test: true,
63
67
  }
64
- wait = nil
65
68
 
66
- response = client.generate_pdf(
69
+ response = client.create_submission(
67
70
  template_id,
68
- submission,
69
- wait: wait
71
+ body
70
72
  )
71
73
  puts response
72
74
  ```
73
75
 
74
- By default the call waits for the PDF, for up to 95 seconds, and the submission in the response has its
75
- `download_url`. Set `wait` to false to get a pending submission straight away.
76
+ By default the call waits for the PDF, for up to 95 seconds, and the submission in the response has a link to
77
+ download it (`files.pdf.download_url`). Set `wait` to false to get a pending submission straight away.
76
78
  [Sync vs. async processing](https://docspring.com/docs/api-guide/synchronous-requests/) covers the time limit, status
77
79
  checks and webhooks.
78
80
 
@@ -84,86 +86,100 @@ Ruby code for every method.
84
86
 
85
87
  | Method | Description |
86
88
  | ------ | ----------- |
87
- | [`add_fields_to_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#add_fields_to_template) | Add new fields to a Template |
88
- | [`batch_generate_pdfs`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#batch_generate_pdfs) | Generate multiple PDFs |
89
- | [`combine_pdfs`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#combine_pdfs) | Merge submission PDFs, template PDFs, or custom files |
89
+ | [`add_template_fields`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#add_template_fields) | Add fields to a template |
90
90
  | [`copy_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#copy_template) | Copy a template |
91
- | [`create_custom_file_from_upload`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_custom_file_from_upload) | Create a new custom file from a cached S3 upload |
92
- | [`create_data_request_event`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_data_request_event) | Create a new event for emailing a signee a request for signature |
93
- | [`create_data_request_token`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_data_request_token) | Create a new data request token for form authentication |
91
+ | [`create_combined_pdf`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_combined_pdf) | Combine PDFs |
92
+ | [`create_custom_file_from_upload`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_custom_file_from_upload) | Create a custom file from an upload |
94
93
  | [`create_folder`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_folder) | Create a folder |
95
- | [`create_html_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_html_template) | Create a new HTML template |
96
- | [`create_pdf_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_pdf_template) | Create a new PDF template with a form POST file upload |
97
- | [`create_pdf_template_from_upload`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_pdf_template_from_upload) | Create a new PDF template from a cached S3 file upload |
94
+ | [`create_signature_request_event`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_signature_request_event) | Record a signature request event |
95
+ | [`create_signature_request_token`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_signature_request_token) | Create a signature request token |
96
+ | [`create_submission`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_submission) | Generate a PDF |
97
+ | [`create_submission_batch`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_submission_batch) | Generate PDFs in a batch |
98
+ | [`create_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_template) | Create a template |
98
99
  | [`create_webhook`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#create_webhook) | Create a webhook |
100
+ | [`delete_custom_file`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#delete_custom_file) | Delete a custom file |
99
101
  | [`delete_folder`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#delete_folder) | Delete a folder |
100
102
  | [`delete_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#delete_template) | Delete a template |
101
103
  | [`delete_webhook`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#delete_webhook) | Delete a webhook |
102
- | [`expire_combined_submission`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#expire_combined_submission) | Expire a combined submission |
103
- | [`expire_submission`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#expire_submission) | Expire a PDF submission |
104
- | [`generate_pdf`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#generate_pdf) | Generate a PDF |
105
- | [`generate_preview`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#generate_preview) | Generate a preview PDF for partially completed data requests |
106
- | [`get_combined_submission`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_combined_submission) | Check the status of a combined submission (merged PDFs) |
107
- | [`get_data_request`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_data_request) | Look up a submission data request |
108
- | [`get_full_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_full_template) | Fetch the full attributes for a PDF template |
109
- | [`get_presign_url`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_presign_url) | Get a presigned S3 URL for direct file upload |
110
- | [`get_submission`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_submission) | Check the status of a PDF |
111
- | [`get_submission_batch`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_submission_batch) | Check the status of a submission batch job |
112
- | [`get_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_template) | Check the status of an uploaded template |
113
- | [`get_template_model_code`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_template_model_code) | Generate typed model code for a template |
114
- | [`get_template_schema`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_template_schema) | Fetch the JSON schema for a template |
104
+ | [`expire_combined_pdf`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#expire_combined_pdf) | Expire a combined PDF |
105
+ | [`expire_submission`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#expire_submission) | Expire a submission |
106
+ | [`generate_submission_files`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#generate_submission_files) | Generate more files |
107
+ | [`generate_submission_preview`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#generate_submission_preview) | Generate a preview PDF |
108
+ | [`get_combined_pdf`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_combined_pdf) | Get a combined PDF |
109
+ | [`get_custom_file`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_custom_file) | Get a custom file |
110
+ | [`get_folder`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_folder) | Get a folder |
111
+ | [`get_presign_url`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_presign_url) | Get a presigned URL to upload a file |
112
+ | [`get_signature_request`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_signature_request) | Get a signature request |
113
+ | [`get_submission`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_submission) | Get a submission |
114
+ | [`get_submission_batch`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_submission_batch) | Get a batch |
115
+ | [`get_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_template) | Get a template |
116
+ | [`get_template_diff`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_template_diff) | Compare a version of a template with the one before it |
117
+ | [`get_template_model_code`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_template_model_code) | Generate typed code for a template's submission data |
118
+ | [`get_template_page_images`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_template_page_images) | Get images of a template's pages |
119
+ | [`get_template_schema`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_template_schema) | Get the JSON Schema of a template's submission data |
115
120
  | [`get_webhook`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#get_webhook) | Get a webhook |
116
- | [`list_combined_submissions`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_combined_submissions) | Get a list of all combined submissions |
117
- | [`list_folders`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_folders) | Get a list of all folders |
118
- | [`list_submissions`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_submissions) | List all submissions |
119
- | [`list_template_submissions`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_template_submissions) | List all submissions for a given template |
120
- | [`list_templates`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_templates) | Get a list of all templates |
121
- | [`list_webhooks`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_webhooks) | Get a list of all webhooks |
122
- | [`move_folder_to_folder`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#move_folder_to_folder) | Move a folder |
123
- | [`move_template_to_folder`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#move_template_to_folder) | Move Template to folder |
121
+ | [`list_combined_pdfs`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_combined_pdfs) | List combined PDFs |
122
+ | [`list_custom_files`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_custom_files) | List custom files |
123
+ | [`list_folders`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_folders) | List folders |
124
+ | [`list_submissions`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_submissions) | List submissions |
125
+ | [`list_template_fields`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_template_fields) | List a template's fields |
126
+ | [`list_template_submissions`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_template_submissions) | List a template's submissions |
127
+ | [`list_templates`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_templates) | List templates |
128
+ | [`list_webhooks`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#list_webhooks) | List webhooks |
129
+ | [`move_folder`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#move_folder) | Move a folder |
130
+ | [`move_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#move_template) | Move a template to a folder |
124
131
  | [`publish_template_version`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#publish_template_version) | Publish a template version |
132
+ | [`remove_template_fields`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#remove_template_fields) | Remove fields from a template |
125
133
  | [`rename_folder`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#rename_folder) | Rename a folder |
134
+ | [`reorder_template_fields`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#reorder_template_fields) | Reorder a template's fields |
126
135
  | [`restore_template_version`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#restore_template_version) | Restore a template version |
127
136
  | [`test_authentication`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#test_authentication) | Test authentication |
128
- | [`update_data_request`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#update_data_request) | Update a submission data request |
129
- | [`update_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#update_template) | Update a Template |
130
- | [`update_template_document`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#update_template_document) | Update a template's document with a form POST file upload |
131
- | [`update_template_document_from_upload`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#update_template_document_from_upload) | Update a template's document with a cached S3 file upload |
137
+ | [`update_signature_request`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#update_signature_request) | Update a signature request |
138
+ | [`update_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#update_template) | Update a template |
139
+ | [`update_template_document`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#update_template_document) | Replace a template's PDF |
140
+ | [`update_template_fields`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#update_template_fields) | Update a template's fields |
132
141
  | [`update_webhook`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#update_webhook) | Update a webhook |
142
+ | [`upload_template`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#upload_template) | Create a PDF template from an uploaded PDF |
143
+ | [`upload_template_document`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#upload_template_document) | Replace a template's PDF with an uploaded PDF |
144
+ | [`validate_submission`](https://github.com/DocSpring/docspring-ruby/blob/main/docs/Client.md#validate_submission) | Check a submission without creating it |
133
145
 
134
146
  ## Errors
135
147
 
136
148
  Methods raise `DocSpring::ApiError` for an error response, with the HTTP status in `code` and the body in `response_body`.
137
149
 
150
+ The client checks each request against the API's request schemas before sending it. A request the API would reject raises `DocSpring::ValidationError` (an `ArgumentError`), whose `details` are hashes with `code`, `message` and a `pointer` into the body (or a `parameter`). Turn the check off with `client.api_client.config.client_side_validation = false`.
151
+ The details are the ones the API's 422 response would have, so you get them without a round trip.
152
+
138
153
  ## API changes
139
154
 
140
- DocSpring adds fields and enum values to API v1 without releasing a new API version. Changes that would break
155
+ DocSpring adds fields and enum values to API v2 without releasing a new API version. Changes that would break
141
156
  existing code, such as removing or renaming a field, go in a new API version
142
157
  ([API changes](https://docspring.com/docs/api-guide/openapi-schema/#api-changes)). So this SDK keeps working with
143
158
  responses that are newer than it is:
144
159
 
145
160
  - The model leaves out a response field added to the API after this release.
146
- - An enum value added to the API after this release comes back as a string, so handle values you don't recognize.
161
+ - Enum values in responses are strings, so a value added to the API after this release comes back as it is: handle values you don't recognize.
147
162
 
148
163
  Upgrade the SDK to read new fields and enum values. The [changelog](https://github.com/DocSpring/docspring-ruby/blob/main/CHANGELOG.md) lists
149
164
  what each release adds.
150
165
 
151
166
  ## About this SDK
152
167
 
153
- This SDK is generated from DocSpring's [OpenAPI spec](https://docspring.com/api-docs/v1/openapi.json) with
154
- [DocSpring's fork of OpenAPI Generator](https://github.com/DocSpring/openapi-generator/tree/docspring/all_patches) 7.16.0.
168
+ This SDK is generated from DocSpring's [OpenAPI spec](https://docspring.com/api-docs/v2/openapi.json) with
169
+ [DocSpring's fork of OpenAPI Generator](https://github.com/DocSpring/openapi-generator/tree/docspring/all_patches) 7.26.0.
155
170
  The fork changes the Ruby generator:
156
171
 
157
- - Responses with an enum value added to the API after this release don't raise `ArgumentError`. Setting an attribute yourself still checks its value.
172
+ - An enum value added to the API after this release comes back as the API sent it, instead of raising `ArgumentError`. An enum type's constants are the values this release knows, and the values are strings.
158
173
 
159
174
  On top of the generated code, we add:
160
175
 
161
176
  - A client constructor that reads your credentials, region and host from the environment.
162
- - A fix for multipart PUT requests in Ethon (file uploads to `update_template_document`).
177
+ - A fix for multipart PUT requests in Ethon (file uploads to `upload_template_document`).
163
178
 
164
- Because the code is generated, we can't merge pull requests that change it. Please
165
- [open an issue](https://github.com/DocSpring/docspring-ruby/issues) or email [support@docspring.com](mailto:support@docspring.com) instead, and
166
- we'll fix it in the generator. [AGENTS.md](https://github.com/DocSpring/docspring-ruby/blob/main/AGENTS.md) is a short guide for AI coding agents.
179
+ Each release regenerates every file, so a change made only here would be lost in the next one. Issues and pull
180
+ requests are welcome all the same: [open an issue](https://github.com/DocSpring/docspring-ruby/issues) or a pull request, or email
181
+ [support@docspring.com](mailto:support@docspring.com), and we'll make the fix in the generator so that every release
182
+ keeps it. [AGENTS.md](https://github.com/DocSpring/docspring-ruby/blob/main/AGENTS.md) is a guide for AI coding agents that integrate this SDK.
167
183
 
168
184
  ## License
169
185
 
@@ -0,0 +1,18 @@
1
+ # DocSpring::AddTemplateFieldsRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **fields** | [**Array&lt;FieldInput&gt;**](FieldInput.md) | The fields to add. Settings left out have their defaults, except that a field with the name of other fields takes their shared settings. Shared settings it sets change them for every field with the name. | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'docspring'
13
+
14
+ instance = DocSpring::AddTemplateFieldsRequest.new(
15
+ fields: null
16
+ )
17
+ ```
18
+
@@ -1,18 +1,15 @@
1
- # DocSpring::RenameFolderData
1
+ # DocSpring::AiFieldNamingLanguage
2
2
 
3
3
  ## Properties
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **name** | **String** | | |
8
7
 
9
8
  ## Example
10
9
 
11
10
  ```ruby
12
11
  require 'docspring'
13
12
 
14
- instance = DocSpring::RenameFolderData.new(
15
- name: null
16
- )
13
+ instance = DocSpring::AiFieldNamingLanguage.new()
17
14
  ```
18
15
 
@@ -0,0 +1,18 @@
1
+ # DocSpring::AuthenticationCheck
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **authenticated** | **Boolean** | Always true. | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'docspring'
13
+
14
+ instance = DocSpring::AuthenticationCheck.new(
15
+ authenticated: null
16
+ )
17
+ ```
18
+
@@ -1,18 +1,15 @@
1
- # DocSpring::CreateFolderData
1
+ # DocSpring::BarcodeSymbology
2
2
 
3
3
  ## Properties
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **folder** | **Object** | | |
8
7
 
9
8
  ## Example
10
9
 
11
10
  ```ruby
12
11
  require 'docspring'
13
12
 
14
- instance = DocSpring::CreateFolderData.new(
15
- folder: null
16
- )
13
+ instance = DocSpring::BarcodeSymbology.new()
17
14
  ```
18
15