docspring 3.5.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (505) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +361 -150
  3. data/.openapi-generator/VERSION +1 -1
  4. data/.rubocop.yml +1 -1
  5. data/.travis.yml +1 -1
  6. data/AGENTS.md +79 -19
  7. data/CHANGELOG.md +123 -0
  8. data/Gemfile.lock +7 -7
  9. data/README.md +60 -53
  10. data/docs/{RenameFolderData.md → AiFieldNamingLanguage.md} +2 -5
  11. data/docs/AuthenticationCheck.md +18 -0
  12. data/docs/{CreateFolderData.md → BarcodeSymbology.md} +2 -5
  13. data/docs/{CreateWebhookData.md → CheckCharacter.md} +2 -5
  14. data/docs/Client.md +890 -777
  15. data/docs/{UpdateWebhookData.md → CombinedFieldType.md} +2 -5
  16. data/docs/CombinedPdf.md +44 -0
  17. data/docs/CombinedPdfFiles.md +18 -0
  18. data/docs/CombinedPdfList.md +20 -0
  19. data/docs/CombinedPdfSource.md +26 -0
  20. data/docs/CombinedPdfSourceInput.md +88 -0
  21. data/docs/CombinedPdfSourcePdf.md +20 -0
  22. data/docs/CombinedPdfSourceType.md +15 -0
  23. data/docs/CombinedPdfState.md +15 -0
  24. data/docs/CopyTemplateRequest.md +22 -0
  25. data/docs/CreateCombinedPdfRequest.md +26 -0
  26. data/docs/CreateCustomFileFromUploadRequest.md +18 -0
  27. data/docs/CreateFolderRequest.md +20 -0
  28. data/docs/CreateSignatureRequestEventRequest.md +24 -0
  29. data/docs/CreateSignatureRequestTokenRequest.md +18 -0
  30. data/docs/CreateSubmissionBatchRequest.md +26 -0
  31. data/docs/CreateSubmissionRequest.md +36 -0
  32. data/docs/CreateTemplateRequest.md +94 -0
  33. data/docs/CreateWebhookRequest.md +38 -0
  34. data/docs/CustomFile.md +11 -3
  35. data/docs/CustomFileList.md +20 -0
  36. data/docs/CustomFileSourcePdf.md +20 -0
  37. data/docs/ErrorCode.md +15 -0
  38. data/docs/ErrorDetail.md +26 -0
  39. data/docs/ErrorInfo.md +32 -0
  40. data/docs/ErrorResponse.md +1 -3
  41. data/docs/ExpirationInterval.md +15 -0
  42. data/docs/FieldComparisonCondition.md +22 -0
  43. data/docs/FieldComparisonOperator.md +15 -0
  44. data/docs/FieldDisplayType.md +15 -0
  45. data/docs/FieldEqualsCondition.md +22 -0
  46. data/docs/FieldEqualsOperator.md +15 -0
  47. data/docs/FieldInCondition.md +22 -0
  48. data/docs/FieldOverride.md +142 -0
  49. data/docs/FieldPresenceCondition.md +20 -0
  50. data/docs/FieldPresenceOperator.md +15 -0
  51. data/docs/FieldRangeCondition.md +24 -0
  52. data/docs/FieldReimportState.md +15 -0
  53. data/docs/FieldSetupLogic.md +15 -0
  54. data/docs/FieldSetupNaming.md +15 -0
  55. data/docs/FieldSetupSource.md +15 -0
  56. data/docs/Folder.md +9 -5
  57. data/docs/FolderList.md +20 -0
  58. data/docs/GeneratedFile.md +32 -0
  59. data/docs/GeneratedFileState.md +15 -0
  60. data/docs/HtmlEngineOptions.md +36 -0
  61. data/docs/HtmlEngineOptionsInput.md +36 -0
  62. data/docs/ImageGravity.md +15 -0
  63. data/docs/ImageScaleType.md +15 -0
  64. data/docs/ModelCodeLanguage.md +15 -0
  65. data/docs/MoveFolderRequest.md +18 -0
  66. data/docs/MoveTemplateRequest.md +18 -0
  67. data/docs/NumberConditionType.md +15 -0
  68. data/docs/PageFormat.md +15 -0
  69. data/docs/PublishTemplateVersionRequest.md +20 -0
  70. data/docs/RenameFolderRequest.md +18 -0
  71. data/docs/RestoreTemplateVersionRequest.md +18 -0
  72. data/docs/ShapeType.md +15 -0
  73. data/docs/SignatureRequest.md +66 -0
  74. data/docs/SignatureRequestAuthSecondFactorType.md +15 -0
  75. data/docs/SignatureRequestAuthType.md +15 -0
  76. data/docs/SignatureRequestEvent.md +32 -0
  77. data/docs/SignatureRequestEventType.md +15 -0
  78. data/docs/SignatureRequestInput.md +46 -0
  79. data/docs/SignatureRequestMessageType.md +15 -0
  80. data/docs/SignatureRequestState.md +15 -0
  81. data/docs/SignatureRequestToken.md +30 -0
  82. data/docs/SignatureRequestTokenType.md +15 -0
  83. data/docs/StringConditionType.md +15 -0
  84. data/docs/Submission.md +41 -47
  85. data/docs/SubmissionAction.md +6 -8
  86. data/docs/SubmissionActionState.md +15 -0
  87. data/docs/SubmissionActionType.md +15 -0
  88. data/docs/SubmissionBatch.md +16 -10
  89. data/docs/SubmissionBatchState.md +15 -0
  90. data/docs/SubmissionFiles.md +22 -0
  91. data/docs/SubmissionInput.md +38 -0
  92. data/docs/SubmissionList.md +20 -0
  93. data/docs/SubmissionSource.md +15 -0
  94. data/docs/SubmissionSourcePdf.md +20 -0
  95. data/docs/SubmissionState.md +15 -0
  96. data/docs/Template.md +73 -107
  97. data/docs/TemplateActor.md +26 -0
  98. data/docs/TemplateActorType.md +15 -0
  99. data/docs/TemplateDefaults.md +56 -0
  100. data/docs/TemplateDefaultsInput.md +56 -0
  101. data/docs/TemplateDocument.md +40 -0
  102. data/docs/TemplateDocumentState.md +15 -0
  103. data/docs/TemplateFieldDependency.md +26 -0
  104. data/docs/TemplateFieldDependencyAction.md +15 -0
  105. data/docs/TemplateFieldDependencyCondition.md +24 -0
  106. data/docs/TemplateFieldDependencyConditionInput.md +93 -0
  107. data/docs/TemplateFieldDependencyInput.md +26 -0
  108. data/docs/TemplateFieldDependencyMatch.md +15 -0
  109. data/docs/TemplateFieldDependencyOperator.md +15 -0
  110. data/docs/TemplateFieldLogicStatus.md +15 -0
  111. data/docs/TemplateFormMode.md +15 -0
  112. data/docs/TemplateModelCode.md +22 -0
  113. data/docs/TemplatePageAiError.md +15 -0
  114. data/docs/TemplatePageAiNamingStatus.md +15 -0
  115. data/docs/TemplatePageFieldsStatus.md +15 -0
  116. data/docs/TemplatePageImageStatus.md +15 -0
  117. data/docs/TemplatePageProcessingStatus.md +26 -0
  118. data/docs/TemplateSourcePdf.md +24 -0
  119. data/docs/TemplateSummary.md +90 -0
  120. data/docs/TemplateSummaryList.md +20 -0
  121. data/docs/TemplateType.md +15 -0
  122. data/docs/TemplateVersion.md +24 -0
  123. data/docs/TemplateVersionType.md +15 -0
  124. data/docs/TextAlignment.md +15 -0
  125. data/docs/TextOverflow.md +15 -0
  126. data/docs/TextVerticalAlignment.md +15 -0
  127. data/docs/Typeface.md +15 -0
  128. data/docs/UpdateSignatureRequestRequest.md +34 -0
  129. data/docs/UpdateTemplateDocumentRequest.md +22 -0
  130. data/docs/UpdateTemplateRequest.md +80 -0
  131. data/docs/UpdateWebhookRequest.md +38 -0
  132. data/docs/UploadMethod.md +15 -0
  133. data/docs/UploadPresign.md +24 -0
  134. data/docs/UrlSourcePdf.md +20 -0
  135. data/docs/Webhook.md +20 -20
  136. data/docs/WebhookEventType.md +15 -0
  137. data/docs/WebhookList.md +20 -0
  138. data/docs/WebhookMode.md +15 -0
  139. data/docspring.gemspec +3 -3
  140. data/lib/docspring/api/client.rb +995 -942
  141. data/lib/docspring/api_client.rb +14 -6
  142. data/lib/docspring/api_error.rb +3 -3
  143. data/lib/docspring/api_model_base.rb +88 -0
  144. data/lib/docspring/configuration.rb +12 -7
  145. data/lib/docspring/models/ai_field_naming_language.rb +42 -0
  146. data/lib/docspring/models/authentication_check.rb +185 -0
  147. data/lib/docspring/models/barcode_symbology.rb +47 -0
  148. data/lib/docspring/models/check_character.rb +44 -0
  149. data/lib/docspring/models/combined_field_type.rb +41 -0
  150. data/lib/docspring/models/{combined_submission.rb → combined_pdf.rb} +228 -206
  151. data/lib/docspring/models/combined_pdf_files.rb +167 -0
  152. data/lib/docspring/models/combined_pdf_list.rb +200 -0
  153. data/lib/docspring/models/{update_webhook_data.rb → combined_pdf_source.rb} +107 -103
  154. data/lib/docspring/models/combined_pdf_source_input.rb +62 -0
  155. data/lib/docspring/models/combined_pdf_source_pdf.rb +212 -0
  156. data/lib/docspring/models/combined_pdf_source_type.rb +44 -0
  157. data/lib/docspring/models/combined_pdf_state.rb +44 -0
  158. data/lib/docspring/models/{copy_template_options.rb → copy_template_request.rb} +32 -87
  159. data/lib/docspring/models/{combine_pdfs_data.rb → create_combined_pdf_request.rb} +60 -123
  160. data/lib/docspring/models/{create_custom_file_data.rb → create_custom_file_from_upload_request.rb} +29 -96
  161. data/lib/docspring/models/{move_template_data.rb → create_folder_request.rb} +60 -102
  162. data/lib/docspring/models/{create_submission_data_request_event_request.rb → create_signature_request_event_request.rb} +50 -122
  163. data/lib/docspring/models/create_signature_request_token_request.rb +190 -0
  164. data/lib/docspring/models/{submission_batch_data.rb → create_submission_batch_request.rb} +53 -108
  165. data/lib/docspring/models/{create_pdf_submission_data.rb → create_submission_request.rb} +97 -149
  166. data/lib/docspring/models/create_template_request.rb +601 -0
  167. data/lib/docspring/models/create_webhook_request.rb +368 -0
  168. data/lib/docspring/models/custom_file.rb +132 -95
  169. data/lib/docspring/models/custom_file_list.rb +200 -0
  170. data/lib/docspring/models/custom_file_source_pdf.rb +212 -0
  171. data/lib/docspring/models/error_code.rb +60 -0
  172. data/lib/docspring/models/error_detail.rb +242 -0
  173. data/lib/docspring/models/error_info.rb +316 -0
  174. data/lib/docspring/models/error_response.rb +28 -138
  175. data/lib/docspring/models/expiration_interval.rb +42 -0
  176. data/lib/docspring/models/field_comparison_condition.rb +247 -0
  177. data/lib/docspring/models/field_comparison_operator.rb +43 -0
  178. data/lib/docspring/models/field_display_type.rb +45 -0
  179. data/lib/docspring/models/field_equals_condition.rb +247 -0
  180. data/lib/docspring/models/field_equals_operator.rb +41 -0
  181. data/lib/docspring/models/{create_folder_data.rb → field_in_condition.rb} +101 -103
  182. data/lib/docspring/models/field_override.rb +829 -0
  183. data/lib/docspring/models/field_presence_condition.rb +234 -0
  184. data/lib/docspring/models/field_presence_operator.rb +41 -0
  185. data/lib/docspring/models/field_range_condition.rb +234 -0
  186. data/lib/docspring/models/field_reimport_state.rb +43 -0
  187. data/lib/docspring/models/field_setup_logic.rb +41 -0
  188. data/lib/docspring/models/field_setup_naming.rb +41 -0
  189. data/lib/docspring/models/field_setup_source.rb +42 -0
  190. data/lib/docspring/models/folder.rb +134 -93
  191. data/lib/docspring/models/folder_list.rb +200 -0
  192. data/lib/docspring/models/generated_file.rb +326 -0
  193. data/lib/docspring/models/generated_file_state.rb +42 -0
  194. data/lib/docspring/models/html_engine_options.rb +416 -0
  195. data/lib/docspring/models/html_engine_options_input.rb +280 -0
  196. data/lib/docspring/models/image_gravity.rb +48 -0
  197. data/lib/docspring/models/image_scale_type.rb +42 -0
  198. data/lib/docspring/models/model_code_language.rb +48 -0
  199. data/lib/docspring/models/{move_folder_data.rb → move_folder_request.rb} +31 -87
  200. data/lib/docspring/models/move_template_request.rb +171 -0
  201. data/lib/docspring/models/number_condition_type.rb +45 -0
  202. data/lib/docspring/models/page_format.rb +52 -0
  203. data/lib/docspring/models/{publish_version_data.rb → publish_template_version_request.rb} +64 -99
  204. data/lib/docspring/models/{rename_folder_data.rb → rename_folder_request.rb} +29 -87
  205. data/lib/docspring/models/{restore_version_data.rb → restore_template_version_request.rb} +29 -87
  206. data/lib/docspring/models/shape_type.rb +45 -0
  207. data/lib/docspring/models/{submission_data_request_show.rb → signature_request.rb} +240 -171
  208. data/lib/docspring/models/signature_request_auth_second_factor_type.rb +45 -0
  209. data/lib/docspring/models/signature_request_auth_type.rb +46 -0
  210. data/lib/docspring/models/{submission_data_request_event.rb → signature_request_event.rb} +137 -122
  211. data/lib/docspring/models/signature_request_event_type.rb +45 -0
  212. data/lib/docspring/models/{update_submission_data_request_data.rb → signature_request_input.rb} +156 -173
  213. data/lib/docspring/models/signature_request_message_type.rb +48 -0
  214. data/lib/docspring/models/signature_request_state.rb +42 -0
  215. data/lib/docspring/models/signature_request_token.rb +369 -0
  216. data/lib/docspring/models/signature_request_token_type.rb +41 -0
  217. data/lib/docspring/models/string_condition_type.rb +44 -0
  218. data/lib/docspring/models/submission.rb +374 -339
  219. data/lib/docspring/models/submission_action.rb +64 -136
  220. data/lib/docspring/models/submission_action_state.rb +43 -0
  221. data/lib/docspring/models/submission_action_type.rb +46 -0
  222. data/lib/docspring/models/submission_batch.rb +157 -112
  223. data/lib/docspring/models/submission_batch_state.rb +42 -0
  224. data/lib/docspring/models/submission_files.rb +188 -0
  225. data/lib/docspring/models/submission_input.rb +274 -0
  226. data/lib/docspring/models/submission_list.rb +200 -0
  227. data/lib/docspring/models/submission_source.rb +43 -0
  228. data/lib/docspring/models/submission_source_pdf.rb +212 -0
  229. data/lib/docspring/models/submission_state.rb +52 -0
  230. data/lib/docspring/models/template.rb +485 -766
  231. data/lib/docspring/models/{add_fields_data.rb → template_actor.rb} +119 -105
  232. data/lib/docspring/models/template_actor_type.rb +42 -0
  233. data/lib/docspring/models/template_defaults.rb +395 -0
  234. data/lib/docspring/models/template_defaults_input.rb +395 -0
  235. data/lib/docspring/models/template_document.rb +396 -0
  236. data/lib/docspring/models/template_document_state.rb +44 -0
  237. data/lib/docspring/models/{success_error_response.rb → template_field_dependency.rb} +122 -114
  238. data/lib/docspring/models/template_field_dependency_action.rb +42 -0
  239. data/lib/docspring/models/{create_pdf_template.rb → template_field_dependency_condition.rb} +116 -103
  240. data/lib/docspring/models/template_field_dependency_condition_input.rb +67 -0
  241. data/lib/docspring/models/template_field_dependency_input.rb +285 -0
  242. data/lib/docspring/models/template_field_dependency_match.rb +41 -0
  243. data/lib/docspring/models/template_field_dependency_operator.rb +49 -0
  244. data/lib/docspring/models/template_field_logic_status.rb +44 -0
  245. data/lib/docspring/models/template_form_mode.rb +42 -0
  246. data/lib/docspring/models/{template_model_code_response.rb → template_model_code.rb} +37 -96
  247. data/lib/docspring/models/template_page_ai_error.rb +43 -0
  248. data/lib/docspring/models/template_page_ai_naming_status.rb +41 -0
  249. data/lib/docspring/models/template_page_fields_status.rb +44 -0
  250. data/lib/docspring/models/template_page_image_status.rb +41 -0
  251. data/lib/docspring/models/template_page_processing_status.rb +275 -0
  252. data/lib/docspring/models/{create_webhook_data.rb → template_source_pdf.rb} +92 -103
  253. data/lib/docspring/models/{template_preview.rb → template_summary.rb} +436 -589
  254. data/lib/docspring/models/template_summary_list.rb +200 -0
  255. data/lib/docspring/models/template_type.rb +41 -0
  256. data/lib/docspring/models/template_version.rb +238 -0
  257. data/lib/docspring/models/template_version_type.rb +42 -0
  258. data/lib/docspring/models/text_alignment.rb +43 -0
  259. data/lib/docspring/models/text_overflow.rb +41 -0
  260. data/lib/docspring/models/text_vertical_alignment.rb +42 -0
  261. data/lib/docspring/models/typeface.rb +56 -0
  262. data/lib/docspring/models/{create_submission_data_request_data.rb → update_signature_request_request.rb} +72 -196
  263. data/lib/docspring/models/update_template_document_request.rb +205 -0
  264. data/lib/docspring/models/update_template_request.rb +514 -0
  265. data/lib/docspring/models/update_webhook_request.rb +344 -0
  266. data/lib/docspring/models/upload_method.rb +40 -0
  267. data/lib/docspring/models/{upload_presign_response.rb → upload_presign.rb} +93 -140
  268. data/lib/docspring/models/url_source_pdf.rb +212 -0
  269. data/lib/docspring/models/webhook.rb +97 -107
  270. data/lib/docspring/models/webhook_event_type.rb +64 -0
  271. data/lib/docspring/models/webhook_list.rb +200 -0
  272. data/lib/docspring/models/webhook_mode.rb +41 -0
  273. data/lib/docspring/request_schemas.json +3187 -0
  274. data/lib/docspring/request_validator.rb +396 -0
  275. data/lib/docspring/version.rb +4 -4
  276. data/lib/docspring.rb +125 -53
  277. data/spec/api/client_spec.rb +304 -277
  278. data/spec/models/ai_field_naming_language_spec.rb +30 -0
  279. data/spec/models/authentication_check_spec.rb +36 -0
  280. data/spec/models/barcode_symbology_spec.rb +30 -0
  281. data/spec/models/check_character_spec.rb +30 -0
  282. data/spec/models/combined_field_type_spec.rb +30 -0
  283. data/spec/models/combined_pdf_files_spec.rb +36 -0
  284. data/spec/models/combined_pdf_list_spec.rb +42 -0
  285. data/spec/models/combined_pdf_source_input_spec.rb +44 -0
  286. data/spec/models/combined_pdf_source_pdf_spec.rb +42 -0
  287. data/spec/models/{submission_data_request_token_spec.rb → combined_pdf_source_spec.rb} +18 -12
  288. data/spec/models/combined_pdf_source_type_spec.rb +30 -0
  289. data/spec/models/{combined_submission_spec.rb → combined_pdf_spec.rb} +20 -24
  290. data/spec/models/combined_pdf_state_spec.rb +30 -0
  291. data/spec/models/{copy_template_options_spec.rb → copy_template_request_spec.rb} +9 -9
  292. data/spec/models/{combine_pdfs_data_spec.rb → create_combined_pdf_request_spec.rb} +12 -18
  293. data/spec/models/{create_custom_file_data_spec.rb → create_custom_file_from_upload_request_spec.rb} +9 -9
  294. data/spec/models/{move_template_data_spec.rb → create_folder_request_spec.rb} +11 -11
  295. data/spec/models/{list_submissions_response_spec.rb → create_signature_request_event_request_spec.rb} +18 -12
  296. data/spec/models/create_signature_request_token_request_spec.rb +36 -0
  297. data/spec/models/{submission_batch_data_spec.rb → create_submission_batch_request_spec.rb} +13 -13
  298. data/spec/models/{create_pdf_submission_data_spec.rb → create_submission_request_spec.rb} +24 -18
  299. data/spec/models/{template_preview_spec.rb → create_template_request_spec.rb} +40 -118
  300. data/spec/models/create_webhook_request_spec.rb +96 -0
  301. data/spec/models/custom_file_list_spec.rb +42 -0
  302. data/spec/models/custom_file_source_pdf_spec.rb +42 -0
  303. data/spec/models/custom_file_spec.rb +29 -5
  304. data/spec/models/error_code_spec.rb +30 -0
  305. data/spec/models/{create_submission_response_spec.rb → error_detail_spec.rb} +14 -18
  306. data/spec/models/{batch_generate_pdfs201_response_spec.rb → error_info_spec.rb} +27 -19
  307. data/spec/models/error_response_spec.rb +4 -14
  308. data/spec/models/expiration_interval_spec.rb +30 -0
  309. data/spec/models/field_comparison_condition_spec.rb +48 -0
  310. data/spec/models/field_comparison_operator_spec.rb +30 -0
  311. data/spec/models/field_display_type_spec.rb +30 -0
  312. data/spec/models/field_equals_condition_spec.rb +48 -0
  313. data/spec/models/field_equals_operator_spec.rb +30 -0
  314. data/spec/models/field_in_condition_spec.rb +48 -0
  315. data/spec/models/field_override_spec.rb +408 -0
  316. data/spec/models/field_presence_condition_spec.rb +42 -0
  317. data/spec/models/field_presence_operator_spec.rb +30 -0
  318. data/spec/models/field_range_condition_spec.rb +54 -0
  319. data/spec/models/field_reimport_state_spec.rb +30 -0
  320. data/spec/models/field_setup_logic_spec.rb +30 -0
  321. data/spec/models/field_setup_naming_spec.rb +30 -0
  322. data/spec/models/field_setup_source_spec.rb +30 -0
  323. data/spec/models/folder_list_spec.rb +42 -0
  324. data/spec/models/folder_spec.rb +16 -4
  325. data/spec/models/generated_file_spec.rb +78 -0
  326. data/spec/models/generated_file_state_spec.rb +30 -0
  327. data/spec/models/html_engine_options_input_spec.rb +90 -0
  328. data/spec/models/html_engine_options_spec.rb +90 -0
  329. data/spec/models/image_gravity_spec.rb +30 -0
  330. data/spec/models/image_scale_type_spec.rb +30 -0
  331. data/spec/models/model_code_language_spec.rb +30 -0
  332. data/spec/models/move_folder_request_spec.rb +36 -0
  333. data/spec/models/move_template_request_spec.rb +36 -0
  334. data/spec/models/number_condition_type_spec.rb +30 -0
  335. data/spec/models/page_format_spec.rb +30 -0
  336. data/spec/models/{publish_version_data_spec.rb → publish_template_version_request_spec.rb} +11 -11
  337. data/spec/models/{rename_folder_data_spec.rb → rename_folder_request_spec.rb} +9 -9
  338. data/spec/models/restore_template_version_request_spec.rb +36 -0
  339. data/spec/models/shape_type_spec.rb +30 -0
  340. data/spec/models/signature_request_auth_second_factor_type_spec.rb +30 -0
  341. data/spec/models/signature_request_auth_type_spec.rb +30 -0
  342. data/spec/models/{submission_data_request_event_spec.rb → signature_request_event_spec.rb} +16 -18
  343. data/spec/models/signature_request_event_type_spec.rb +30 -0
  344. data/spec/models/{create_submission_data_request_data_spec.rb → signature_request_input_spec.rb} +28 -30
  345. data/spec/models/signature_request_message_type_spec.rb +30 -0
  346. data/spec/models/{submission_data_request_show_spec.rb → signature_request_spec.rb} +31 -31
  347. data/spec/models/signature_request_state_spec.rb +30 -0
  348. data/spec/models/signature_request_token_spec.rb +72 -0
  349. data/spec/models/signature_request_token_type_spec.rb +30 -0
  350. data/spec/models/string_condition_type_spec.rb +30 -0
  351. data/spec/models/submission_action_spec.rb +4 -22
  352. data/spec/models/submission_action_state_spec.rb +30 -0
  353. data/spec/models/submission_action_type_spec.rb +30 -0
  354. data/spec/models/submission_batch_spec.rb +27 -13
  355. data/spec/models/submission_batch_state_spec.rb +30 -0
  356. data/spec/models/submission_files_spec.rb +48 -0
  357. data/spec/models/submission_input_spec.rb +96 -0
  358. data/spec/models/submission_list_spec.rb +42 -0
  359. data/spec/models/submission_source_pdf_spec.rb +42 -0
  360. data/spec/models/submission_source_spec.rb +30 -0
  361. data/spec/models/submission_spec.rb +26 -56
  362. data/spec/models/submission_state_spec.rb +30 -0
  363. data/spec/models/template_actor_spec.rb +60 -0
  364. data/spec/models/template_actor_type_spec.rb +30 -0
  365. data/spec/models/{submission_data_request_spec.rb → template_defaults_input_spec.rb} +29 -53
  366. data/spec/models/template_defaults_spec.rb +150 -0
  367. data/spec/models/{json_schema_spec.rb → template_document_spec.rb} +21 -21
  368. data/spec/models/template_document_state_spec.rb +30 -0
  369. data/spec/models/template_field_dependency_action_spec.rb +30 -0
  370. data/spec/models/template_field_dependency_condition_input_spec.rb +44 -0
  371. data/spec/models/template_field_dependency_condition_spec.rb +54 -0
  372. data/spec/models/template_field_dependency_input_spec.rb +60 -0
  373. data/spec/models/template_field_dependency_match_spec.rb +30 -0
  374. data/spec/models/template_field_dependency_operator_spec.rb +30 -0
  375. data/spec/models/template_field_dependency_spec.rb +60 -0
  376. data/spec/models/template_field_logic_status_spec.rb +30 -0
  377. data/spec/models/template_form_mode_spec.rb +30 -0
  378. data/spec/models/{template_model_code_response_spec.rb → template_model_code_spec.rb} +9 -13
  379. data/spec/models/template_page_ai_error_spec.rb +30 -0
  380. data/spec/models/template_page_ai_naming_status_spec.rb +30 -0
  381. data/spec/models/template_page_fields_status_spec.rb +30 -0
  382. data/spec/models/template_page_image_status_spec.rb +30 -0
  383. data/spec/models/template_page_processing_status_spec.rb +60 -0
  384. data/spec/models/template_source_pdf_spec.rb +54 -0
  385. data/spec/models/template_spec.rb +40 -154
  386. data/spec/models/template_summary_list_spec.rb +42 -0
  387. data/spec/models/template_summary_spec.rb +252 -0
  388. data/spec/models/template_type_spec.rb +30 -0
  389. data/spec/models/template_version_spec.rb +54 -0
  390. data/spec/models/template_version_type_spec.rb +30 -0
  391. data/spec/models/text_alignment_spec.rb +30 -0
  392. data/spec/models/text_overflow_spec.rb +30 -0
  393. data/spec/models/text_vertical_alignment_spec.rb +30 -0
  394. data/spec/models/typeface_spec.rb +30 -0
  395. data/spec/models/{submission_batch_with_submissions_spec.rb → update_signature_request_request_spec.rb} +18 -22
  396. data/spec/models/update_template_document_request_spec.rb +48 -0
  397. data/spec/models/{submission_preview_spec.rb → update_template_request_spec.rb} +81 -41
  398. data/spec/models/update_webhook_request_spec.rb +96 -0
  399. data/spec/models/upload_method_spec.rb +30 -0
  400. data/spec/models/{upload_presign_response_spec.rb → upload_presign_spec.rb} +13 -17
  401. data/spec/models/url_source_pdf_spec.rb +42 -0
  402. data/spec/models/webhook_event_type_spec.rb +30 -0
  403. data/spec/models/webhook_list_spec.rb +42 -0
  404. data/spec/models/webhook_mode_spec.rb +30 -0
  405. data/spec/models/webhook_spec.rb +4 -8
  406. data/spec/spec_helper.rb +3 -3
  407. metadata +485 -202
  408. data/docs/AddFieldsData.md +0 -18
  409. data/docs/BatchGeneratePdfs201Response.md +0 -28
  410. data/docs/CombinePdfsData.md +0 -28
  411. data/docs/CombinedSubmission.md +0 -44
  412. data/docs/CombinedSubmissionAction.md +0 -30
  413. data/docs/CopyTemplateOptions.md +0 -22
  414. data/docs/CreateCombinedSubmissionResponse.md +0 -26
  415. data/docs/CreateCustomFileData.md +0 -18
  416. data/docs/CreateCustomFileResponse.md +0 -24
  417. data/docs/CreateHtmlTemplate.md +0 -18
  418. data/docs/CreatePdfSubmissionData.md +0 -34
  419. data/docs/CreatePdfTemplate.md +0 -18
  420. data/docs/CreateSubmissionDataRequestData.md +0 -44
  421. data/docs/CreateSubmissionDataRequestEventRequest.md +0 -24
  422. data/docs/CreateSubmissionDataRequestEventResponse.md +0 -24
  423. data/docs/CreateSubmissionDataRequestResponse.md +0 -24
  424. data/docs/CreateSubmissionDataRequestTokenResponse.md +0 -24
  425. data/docs/CreateSubmissionResponse.md +0 -26
  426. data/docs/ErrorOrMultipleErrorsResponse.md +0 -22
  427. data/docs/ForbiddenErrorResponse.md +0 -22
  428. data/docs/JsonSchema.md +0 -40
  429. data/docs/ListSubmissionsResponse.md +0 -22
  430. data/docs/MoveFolderData.md +0 -18
  431. data/docs/MoveTemplateData.md +0 -20
  432. data/docs/MultipleErrorsResponse.md +0 -20
  433. data/docs/PublishVersionData.md +0 -20
  434. data/docs/RestoreVersionData.md +0 -18
  435. data/docs/Submission422Response.md +0 -24
  436. data/docs/SubmissionBatchData.md +0 -26
  437. data/docs/SubmissionBatchWithSubmissions.md +0 -34
  438. data/docs/SubmissionDataRequest.md +0 -60
  439. data/docs/SubmissionDataRequestEvent.md +0 -30
  440. data/docs/SubmissionDataRequestShow.md +0 -62
  441. data/docs/SubmissionDataRequestToken.md +0 -24
  442. data/docs/SubmissionPreview.md +0 -64
  443. data/docs/SuccessErrorResponse.md +0 -20
  444. data/docs/SuccessMultipleErrorsResponse.md +0 -20
  445. data/docs/TemplateAddFieldsResponse.md +0 -22
  446. data/docs/TemplateDeleteResponse.md +0 -24
  447. data/docs/TemplateModelCodeResponse.md +0 -22
  448. data/docs/TemplatePreview.md +0 -116
  449. data/docs/TemplatePublishVersionResponse.md +0 -22
  450. data/docs/UpdateHtmlTemplate.md +0 -18
  451. data/docs/UpdatePdfTemplate.md +0 -18
  452. data/docs/UpdateSubmissionDataRequestData.md +0 -42
  453. data/docs/UploadPresignResponse.md +0 -24
  454. data/lib/docspring/models/batch_generate_pdfs201_response.rb +0 -352
  455. data/lib/docspring/models/combined_submission_action.rb +0 -384
  456. data/lib/docspring/models/create_combined_submission_response.rb +0 -324
  457. data/lib/docspring/models/create_custom_file_response.rb +0 -314
  458. data/lib/docspring/models/create_html_template.rb +0 -243
  459. data/lib/docspring/models/create_submission_data_request_event_response.rb +0 -314
  460. data/lib/docspring/models/create_submission_data_request_response.rb +0 -314
  461. data/lib/docspring/models/create_submission_data_request_token_response.rb +0 -314
  462. data/lib/docspring/models/create_submission_response.rb +0 -324
  463. data/lib/docspring/models/error_or_multiple_errors_response.rb +0 -290
  464. data/lib/docspring/models/forbidden_error_response.rb +0 -323
  465. data/lib/docspring/models/json_schema.rb +0 -329
  466. data/lib/docspring/models/list_submissions_response.rb +0 -283
  467. data/lib/docspring/models/multiple_errors_response.rb +0 -296
  468. data/lib/docspring/models/submission422_response.rb +0 -299
  469. data/lib/docspring/models/submission_batch_with_submissions.rb +0 -433
  470. data/lib/docspring/models/submission_data_request.rb +0 -570
  471. data/lib/docspring/models/submission_data_request_token.rb +0 -279
  472. data/lib/docspring/models/submission_preview.rb +0 -637
  473. data/lib/docspring/models/success_multiple_errors_response.rb +0 -279
  474. data/lib/docspring/models/template_add_fields_response.rb +0 -290
  475. data/lib/docspring/models/template_delete_response.rb +0 -300
  476. data/lib/docspring/models/template_publish_version_response.rb +0 -305
  477. data/lib/docspring/models/update_html_template.rb +0 -243
  478. data/lib/docspring/models/update_pdf_template.rb +0 -243
  479. data/spec/models/add_fields_data_spec.rb +0 -36
  480. data/spec/models/combined_submission_action_spec.rb +0 -84
  481. data/spec/models/create_combined_submission_response_spec.rb +0 -64
  482. data/spec/models/create_custom_file_response_spec.rb +0 -58
  483. data/spec/models/create_folder_data_spec.rb +0 -36
  484. data/spec/models/create_html_template_spec.rb +0 -36
  485. data/spec/models/create_pdf_template_spec.rb +0 -36
  486. data/spec/models/create_submission_data_request_event_request_spec.rb +0 -62
  487. data/spec/models/create_submission_data_request_event_response_spec.rb +0 -58
  488. data/spec/models/create_submission_data_request_response_spec.rb +0 -58
  489. data/spec/models/create_submission_data_request_token_response_spec.rb +0 -58
  490. data/spec/models/create_webhook_data_spec.rb +0 -36
  491. data/spec/models/error_or_multiple_errors_response_spec.rb +0 -52
  492. data/spec/models/forbidden_error_response_spec.rb +0 -56
  493. data/spec/models/move_folder_data_spec.rb +0 -36
  494. data/spec/models/multiple_errors_response_spec.rb +0 -46
  495. data/spec/models/restore_version_data_spec.rb +0 -36
  496. data/spec/models/submission422_response_spec.rb +0 -58
  497. data/spec/models/success_error_response_spec.rb +0 -46
  498. data/spec/models/success_multiple_errors_response_spec.rb +0 -46
  499. data/spec/models/template_add_fields_response_spec.rb +0 -52
  500. data/spec/models/template_delete_response_spec.rb +0 -58
  501. data/spec/models/template_publish_version_response_spec.rb +0 -52
  502. data/spec/models/update_html_template_spec.rb +0 -36
  503. data/spec/models/update_pdf_template_spec.rb +0 -36
  504. data/spec/models/update_submission_data_request_data_spec.rb +0 -116
  505. data/spec/models/update_webhook_data_spec.rb +0 -36
@@ -1,384 +0,0 @@
1
- =begin
2
- #DocSpring API
3
-
4
- #Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
5
-
6
- The version of the OpenAPI document: v1
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.16.0-DOCSPRING
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module DocSpring
17
- class CombinedSubmissionAction
18
- attr_accessor :id
19
-
20
- attr_accessor :integration_id
21
-
22
- attr_accessor :state
23
-
24
- attr_accessor :action_type
25
-
26
- attr_accessor :action_category
27
-
28
- attr_accessor :result_data
29
-
30
- attr_accessor :error_message
31
-
32
- class EnumAttributeValidator
33
- attr_reader :datatype
34
- attr_reader :allowable_values
35
-
36
- def initialize(datatype, allowable_values)
37
- @allowable_values = allowable_values.map do |value|
38
- case datatype.to_s
39
- when /Integer/i
40
- value.to_i
41
- when /Float/i
42
- value.to_f
43
- else
44
- value
45
- end
46
- end
47
- end
48
-
49
- def valid?(value)
50
- !value || allowable_values.include?(value)
51
- end
52
- end
53
-
54
- # Attribute mapping from ruby-style variable name to JSON key.
55
- def self.attribute_map
56
- {
57
- :'id' => :'id',
58
- :'integration_id' => :'integration_id',
59
- :'state' => :'state',
60
- :'action_type' => :'action_type',
61
- :'action_category' => :'action_category',
62
- :'result_data' => :'result_data',
63
- :'error_message' => :'error_message'
64
- }
65
- end
66
-
67
- # Returns attribute mapping this model knows about
68
- def self.acceptable_attribute_map
69
- attribute_map
70
- end
71
-
72
- # Returns all the JSON keys this model knows about
73
- def self.acceptable_attributes
74
- acceptable_attribute_map.values
75
- end
76
-
77
- # Attribute type mapping.
78
- def self.openapi_types
79
- {
80
- :'id' => :'String',
81
- :'integration_id' => :'String',
82
- :'state' => :'String',
83
- :'action_type' => :'String',
84
- :'action_category' => :'String',
85
- :'result_data' => :'Object',
86
- :'error_message' => :'String'
87
- }
88
- end
89
-
90
- # List of attributes with nullable: true
91
- def self.openapi_nullable
92
- Set.new([
93
- :'id',
94
- :'integration_id',
95
- :'action_type',
96
- :'error_message'
97
- ])
98
- end
99
-
100
- # Initializes the object
101
- # @param [Hash] attributes Model attributes in the form of hash
102
- def initialize(attributes = {})
103
- if (!attributes.is_a?(Hash))
104
- fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::CombinedSubmissionAction` initialize method"
105
- end
106
-
107
- # check to see if the attribute exists and convert string to symbol for hash key
108
- acceptable_attribute_map = self.class.acceptable_attribute_map
109
- attributes = attributes.each_with_object({}) { |(k, v), h|
110
- if (!acceptable_attribute_map.key?(k.to_sym))
111
- fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::CombinedSubmissionAction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
112
- end
113
- h[k.to_sym] = v
114
- }
115
-
116
- if attributes.key?(:'id')
117
- self.id = attributes[:'id']
118
- else
119
- self.id = nil
120
- end
121
-
122
- if attributes.key?(:'integration_id')
123
- self.integration_id = attributes[:'integration_id']
124
- else
125
- self.integration_id = nil
126
- end
127
-
128
- if attributes.key?(:'state')
129
- self.state = attributes[:'state']
130
- else
131
- self.state = nil
132
- end
133
-
134
- if attributes.key?(:'action_type')
135
- self.action_type = attributes[:'action_type']
136
- else
137
- self.action_type = nil
138
- end
139
-
140
- if attributes.key?(:'action_category')
141
- self.action_category = attributes[:'action_category']
142
- else
143
- self.action_category = nil
144
- end
145
-
146
- if attributes.key?(:'result_data')
147
- self.result_data = attributes[:'result_data']
148
- else
149
- self.result_data = nil
150
- end
151
-
152
- if attributes.key?(:'error_message')
153
- self.error_message = attributes[:'error_message']
154
- else
155
- self.error_message = nil
156
- end
157
- end
158
-
159
- # Show invalid properties with the reasons. Usually used together with valid?
160
- # @return Array for valid properties with the reasons
161
- def list_invalid_properties
162
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
163
- invalid_properties = Array.new
164
- if @state.nil?
165
- invalid_properties.push('invalid value for "state", state cannot be nil.')
166
- end
167
-
168
- if @action_category.nil?
169
- invalid_properties.push('invalid value for "action_category", action_category cannot be nil.')
170
- end
171
-
172
- if @result_data.nil?
173
- invalid_properties.push('invalid value for "result_data", result_data cannot be nil.')
174
- end
175
-
176
- invalid_properties
177
- end
178
-
179
- # Check to see if the all the properties in the model are valid
180
- # @return true if the model is valid
181
- def valid?
182
- warn '[DEPRECATED] the `valid?` method is obsolete'
183
- return false if @state.nil?
184
- state_validator = EnumAttributeValidator.new('String', ["pending", "processed", "failed", "error"])
185
- return false unless state_validator.valid?(@state)
186
- action_type_validator = EnumAttributeValidator.new('String', ["webhook", "slack_webhook", "email", "aws_s3_upload"])
187
- return false unless action_type_validator.valid?(@action_type)
188
- return false if @action_category.nil?
189
- action_category_validator = EnumAttributeValidator.new('String', ["notification", "file_upload"])
190
- return false unless action_category_validator.valid?(@action_category)
191
- return false if @result_data.nil?
192
- true
193
- end
194
-
195
- # Custom attribute writer method checking allowed values (enum).
196
- # @param [Object] state Object to be assigned
197
- def state=(state)
198
- validator = EnumAttributeValidator.new('String', ["pending", "processed", "failed", "error"])
199
- # build_from_hash accepts enum values this client doesn't know about yet
200
- unless defined?(@_skip_enum_validation) || validator.valid?(state)
201
- fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
202
- end
203
- @state = state
204
- end
205
-
206
- # Custom attribute writer method checking allowed values (enum).
207
- # @param [Object] action_type Object to be assigned
208
- def action_type=(action_type)
209
- validator = EnumAttributeValidator.new('String', ["webhook", "slack_webhook", "email", "aws_s3_upload"])
210
- # build_from_hash accepts enum values this client doesn't know about yet
211
- unless defined?(@_skip_enum_validation) || validator.valid?(action_type)
212
- fail ArgumentError, "invalid value for \"action_type\", must be one of #{validator.allowable_values}."
213
- end
214
- @action_type = action_type
215
- end
216
-
217
- # Custom attribute writer method checking allowed values (enum).
218
- # @param [Object] action_category Object to be assigned
219
- def action_category=(action_category)
220
- validator = EnumAttributeValidator.new('String', ["notification", "file_upload"])
221
- # build_from_hash accepts enum values this client doesn't know about yet
222
- unless defined?(@_skip_enum_validation) || validator.valid?(action_category)
223
- fail ArgumentError, "invalid value for \"action_category\", must be one of #{validator.allowable_values}."
224
- end
225
- @action_category = action_category
226
- end
227
-
228
- # Custom attribute writer method with validation
229
- # @param [Object] result_data Value to be assigned
230
- def result_data=(result_data)
231
- if result_data.nil?
232
- fail ArgumentError, 'result_data cannot be nil'
233
- end
234
-
235
- @result_data = result_data
236
- end
237
-
238
- # Checks equality by comparing each attribute.
239
- # @param [Object] Object to be compared
240
- def ==(o)
241
- return true if self.equal?(o)
242
- self.class == o.class &&
243
- id == o.id &&
244
- integration_id == o.integration_id &&
245
- state == o.state &&
246
- action_type == o.action_type &&
247
- action_category == o.action_category &&
248
- result_data == o.result_data &&
249
- error_message == o.error_message
250
- end
251
-
252
- # @see the `==` method
253
- # @param [Object] Object to be compared
254
- def eql?(o)
255
- self == o
256
- end
257
-
258
- # Calculates hash code according to all attributes.
259
- # @return [Integer] Hash code
260
- def hash
261
- [id, integration_id, state, action_type, action_category, result_data, error_message].hash
262
- end
263
-
264
- # Builds the object from hash
265
- # @param [Hash] attributes Model attributes in the form of hash
266
- # @return [Object] Returns the model itself
267
- def self.build_from_hash(attributes)
268
- return nil unless attributes.is_a?(Hash)
269
- attributes = attributes.transform_keys(&:to_sym)
270
- transformed_hash = {}
271
- openapi_types.each_pair do |key, type|
272
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
273
- transformed_hash["#{key}"] = nil
274
- elsif type =~ /\AArray<(.*)>/i
275
- # check to ensure the input is an array given that the attribute
276
- # is documented as an array but the input is not
277
- if attributes[attribute_map[key]].is_a?(Array)
278
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
279
- end
280
- elsif !attributes[attribute_map[key]].nil?
281
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
282
- end
283
- end
284
- # Responses can include enum values added after this client was released, so the enum setters
285
- # accept any value while the model is built from a response
286
- allocate.tap do |model|
287
- model.instance_variable_set(:@_skip_enum_validation, true)
288
- model.send(:initialize, transformed_hash)
289
- model.remove_instance_variable(:@_skip_enum_validation)
290
- end
291
- end
292
-
293
- # Deserializes the data based on type
294
- # @param string type Data type
295
- # @param string value Value to be deserialized
296
- # @return [Object] Deserialized data
297
- def self._deserialize(type, value)
298
- case type.to_sym
299
- when :Time
300
- Time.parse(value)
301
- when :Date
302
- Date.parse(value)
303
- when :String
304
- value.to_s
305
- when :Integer
306
- value.to_i
307
- when :Float
308
- value.to_f
309
- when :Boolean
310
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
311
- true
312
- else
313
- false
314
- end
315
- when :Object
316
- # generic object (usually a Hash), return directly
317
- value
318
- when /\AArray<(?<inner_type>.+)>\z/
319
- inner_type = Regexp.last_match[:inner_type]
320
- value.map { |v| _deserialize(inner_type, v) }
321
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
322
- k_type = Regexp.last_match[:k_type]
323
- v_type = Regexp.last_match[:v_type]
324
- {}.tap do |hash|
325
- value.each do |k, v|
326
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
327
- end
328
- end
329
- else # model
330
- # models (e.g. Pet) or oneOf
331
- klass = DocSpring.const_get(type)
332
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
333
- end
334
- end
335
-
336
- # Returns the string representation of the object
337
- # @return [String] String presentation of the object
338
- def to_s
339
- to_hash.to_s
340
- end
341
-
342
- # to_body is an alias to to_hash (backward compatibility)
343
- # @return [Hash] Returns the object in the form of hash
344
- def to_body
345
- to_hash
346
- end
347
-
348
- # Returns the object in the form of hash
349
- # @return [Hash] Returns the object in the form of hash
350
- def to_hash
351
- hash = {}
352
- self.class.attribute_map.each_pair do |attr, param|
353
- value = self.send(attr)
354
- if value.nil?
355
- is_nullable = self.class.openapi_nullable.include?(attr)
356
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
357
- end
358
-
359
- hash[param] = _to_hash(value)
360
- end
361
- hash
362
- end
363
-
364
- # Outputs non-array value in the form of hash
365
- # For object, use to_hash. Otherwise, just return the value
366
- # @param [Object] value Any valid value
367
- # @return [Hash] Returns the value in the form of hash
368
- def _to_hash(value)
369
- if value.is_a?(Array)
370
- value.compact.map { |v| _to_hash(v) }
371
- elsif value.is_a?(Hash)
372
- {}.tap do |hash|
373
- value.each { |k, v| hash[k] = _to_hash(v) }
374
- end
375
- elsif value.respond_to? :to_hash
376
- value.to_hash
377
- else
378
- value
379
- end
380
- end
381
-
382
- end
383
-
384
- end
@@ -1,324 +0,0 @@
1
- =begin
2
- #DocSpring API
3
-
4
- #Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
5
-
6
- The version of the OpenAPI document: v1
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.16.0-DOCSPRING
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module DocSpring
17
- class CreateCombinedSubmissionResponse
18
- attr_accessor :status
19
-
20
- attr_accessor :combined_submission
21
-
22
- attr_accessor :error
23
-
24
- attr_accessor :errors
25
-
26
- # `insufficient_credits` when the response is a 402.
27
- attr_accessor :code
28
-
29
- class EnumAttributeValidator
30
- attr_reader :datatype
31
- attr_reader :allowable_values
32
-
33
- def initialize(datatype, allowable_values)
34
- @allowable_values = allowable_values.map do |value|
35
- case datatype.to_s
36
- when /Integer/i
37
- value.to_i
38
- when /Float/i
39
- value.to_f
40
- else
41
- value
42
- end
43
- end
44
- end
45
-
46
- def valid?(value)
47
- !value || allowable_values.include?(value)
48
- end
49
- end
50
-
51
- # Attribute mapping from ruby-style variable name to JSON key.
52
- def self.attribute_map
53
- {
54
- :'status' => :'status',
55
- :'combined_submission' => :'combined_submission',
56
- :'error' => :'error',
57
- :'errors' => :'errors',
58
- :'code' => :'code'
59
- }
60
- end
61
-
62
- # Returns attribute mapping this model knows about
63
- def self.acceptable_attribute_map
64
- attribute_map
65
- end
66
-
67
- # Returns all the JSON keys this model knows about
68
- def self.acceptable_attributes
69
- acceptable_attribute_map.values
70
- end
71
-
72
- # Attribute type mapping.
73
- def self.openapi_types
74
- {
75
- :'status' => :'String',
76
- :'combined_submission' => :'CombinedSubmission',
77
- :'error' => :'String',
78
- :'errors' => :'Array<String>',
79
- :'code' => :'String'
80
- }
81
- end
82
-
83
- # List of attributes with nullable: true
84
- def self.openapi_nullable
85
- Set.new([
86
- ])
87
- end
88
-
89
- # Initializes the object
90
- # @param [Hash] attributes Model attributes in the form of hash
91
- def initialize(attributes = {})
92
- if (!attributes.is_a?(Hash))
93
- fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::CreateCombinedSubmissionResponse` initialize method"
94
- end
95
-
96
- # check to see if the attribute exists and convert string to symbol for hash key
97
- acceptable_attribute_map = self.class.acceptable_attribute_map
98
- attributes = attributes.each_with_object({}) { |(k, v), h|
99
- if (!acceptable_attribute_map.key?(k.to_sym))
100
- fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::CreateCombinedSubmissionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
101
- end
102
- h[k.to_sym] = v
103
- }
104
-
105
- if attributes.key?(:'status')
106
- self.status = attributes[:'status']
107
- else
108
- self.status = nil
109
- end
110
-
111
- if attributes.key?(:'combined_submission')
112
- self.combined_submission = attributes[:'combined_submission']
113
- else
114
- self.combined_submission = nil
115
- end
116
-
117
- if attributes.key?(:'error')
118
- self.error = attributes[:'error']
119
- end
120
-
121
- if attributes.key?(:'errors')
122
- if (value = attributes[:'errors']).is_a?(Array)
123
- self.errors = value
124
- end
125
- end
126
-
127
- if attributes.key?(:'code')
128
- self.code = attributes[:'code']
129
- end
130
- end
131
-
132
- # Show invalid properties with the reasons. Usually used together with valid?
133
- # @return Array for valid properties with the reasons
134
- def list_invalid_properties
135
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
136
- invalid_properties = Array.new
137
- if @status.nil?
138
- invalid_properties.push('invalid value for "status", status cannot be nil.')
139
- end
140
-
141
- if @combined_submission.nil?
142
- invalid_properties.push('invalid value for "combined_submission", combined_submission cannot be nil.')
143
- end
144
-
145
- invalid_properties
146
- end
147
-
148
- # Check to see if the all the properties in the model are valid
149
- # @return true if the model is valid
150
- def valid?
151
- warn '[DEPRECATED] the `valid?` method is obsolete'
152
- return false if @status.nil?
153
- status_validator = EnumAttributeValidator.new('String', ["success", "error"])
154
- return false unless status_validator.valid?(@status)
155
- return false if @combined_submission.nil?
156
- true
157
- end
158
-
159
- # Custom attribute writer method checking allowed values (enum).
160
- # @param [Object] status Object to be assigned
161
- def status=(status)
162
- validator = EnumAttributeValidator.new('String', ["success", "error"])
163
- # build_from_hash accepts enum values this client doesn't know about yet
164
- unless defined?(@_skip_enum_validation) || validator.valid?(status)
165
- fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
166
- end
167
- @status = status
168
- end
169
-
170
- # Custom attribute writer method with validation
171
- # @param [Object] combined_submission Value to be assigned
172
- def combined_submission=(combined_submission)
173
- if combined_submission.nil?
174
- fail ArgumentError, 'combined_submission cannot be nil'
175
- end
176
-
177
- @combined_submission = combined_submission
178
- end
179
-
180
- # Checks equality by comparing each attribute.
181
- # @param [Object] Object to be compared
182
- def ==(o)
183
- return true if self.equal?(o)
184
- self.class == o.class &&
185
- status == o.status &&
186
- combined_submission == o.combined_submission &&
187
- error == o.error &&
188
- errors == o.errors &&
189
- code == o.code
190
- end
191
-
192
- # @see the `==` method
193
- # @param [Object] Object to be compared
194
- def eql?(o)
195
- self == o
196
- end
197
-
198
- # Calculates hash code according to all attributes.
199
- # @return [Integer] Hash code
200
- def hash
201
- [status, combined_submission, error, errors, code].hash
202
- end
203
-
204
- # Builds the object from hash
205
- # @param [Hash] attributes Model attributes in the form of hash
206
- # @return [Object] Returns the model itself
207
- def self.build_from_hash(attributes)
208
- return nil unless attributes.is_a?(Hash)
209
- attributes = attributes.transform_keys(&:to_sym)
210
- transformed_hash = {}
211
- openapi_types.each_pair do |key, type|
212
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
213
- transformed_hash["#{key}"] = nil
214
- elsif type =~ /\AArray<(.*)>/i
215
- # check to ensure the input is an array given that the attribute
216
- # is documented as an array but the input is not
217
- if attributes[attribute_map[key]].is_a?(Array)
218
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
219
- end
220
- elsif !attributes[attribute_map[key]].nil?
221
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
222
- end
223
- end
224
- # Responses can include enum values added after this client was released, so the enum setters
225
- # accept any value while the model is built from a response
226
- allocate.tap do |model|
227
- model.instance_variable_set(:@_skip_enum_validation, true)
228
- model.send(:initialize, transformed_hash)
229
- model.remove_instance_variable(:@_skip_enum_validation)
230
- end
231
- end
232
-
233
- # Deserializes the data based on type
234
- # @param string type Data type
235
- # @param string value Value to be deserialized
236
- # @return [Object] Deserialized data
237
- def self._deserialize(type, value)
238
- case type.to_sym
239
- when :Time
240
- Time.parse(value)
241
- when :Date
242
- Date.parse(value)
243
- when :String
244
- value.to_s
245
- when :Integer
246
- value.to_i
247
- when :Float
248
- value.to_f
249
- when :Boolean
250
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
251
- true
252
- else
253
- false
254
- end
255
- when :Object
256
- # generic object (usually a Hash), return directly
257
- value
258
- when /\AArray<(?<inner_type>.+)>\z/
259
- inner_type = Regexp.last_match[:inner_type]
260
- value.map { |v| _deserialize(inner_type, v) }
261
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
262
- k_type = Regexp.last_match[:k_type]
263
- v_type = Regexp.last_match[:v_type]
264
- {}.tap do |hash|
265
- value.each do |k, v|
266
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
267
- end
268
- end
269
- else # model
270
- # models (e.g. Pet) or oneOf
271
- klass = DocSpring.const_get(type)
272
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
273
- end
274
- end
275
-
276
- # Returns the string representation of the object
277
- # @return [String] String presentation of the object
278
- def to_s
279
- to_hash.to_s
280
- end
281
-
282
- # to_body is an alias to to_hash (backward compatibility)
283
- # @return [Hash] Returns the object in the form of hash
284
- def to_body
285
- to_hash
286
- end
287
-
288
- # Returns the object in the form of hash
289
- # @return [Hash] Returns the object in the form of hash
290
- def to_hash
291
- hash = {}
292
- self.class.attribute_map.each_pair do |attr, param|
293
- value = self.send(attr)
294
- if value.nil?
295
- is_nullable = self.class.openapi_nullable.include?(attr)
296
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
297
- end
298
-
299
- hash[param] = _to_hash(value)
300
- end
301
- hash
302
- end
303
-
304
- # Outputs non-array value in the form of hash
305
- # For object, use to_hash. Otherwise, just return the value
306
- # @param [Object] value Any valid value
307
- # @return [Hash] Returns the value in the form of hash
308
- def _to_hash(value)
309
- if value.is_a?(Array)
310
- value.compact.map { |v| _to_hash(v) }
311
- elsif value.is_a?(Hash)
312
- {}.tap do |hash|
313
- value.each { |k, v| hash[k] = _to_hash(v) }
314
- end
315
- elsif value.respond_to? :to_hash
316
- value.to_hash
317
- else
318
- value
319
- end
320
- end
321
-
322
- end
323
-
324
- end