signwell_sdk 0.1.1 → 0.2.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 (317) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.yml +53 -0
  3. data/.github/ISSUE_TEMPLATE/config.yml +5 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.yml +35 -0
  5. data/.github/pull_request_template.md +39 -0
  6. data/.github/workflows/ci.yml +45 -0
  7. data/.github/workflows/generator-ownership.yml +53 -0
  8. data/.github/workflows/manual-release.yml +64 -0
  9. data/.github/workflows/release.yml +69 -0
  10. data/.gitignore +39 -0
  11. data/.release-please-manifest.json +3 -0
  12. data/.rspec +2 -0
  13. data/.rubocop.yml +200 -0
  14. data/CHANGELOG.md +20 -0
  15. data/CONTRIBUTING.md +13 -0
  16. data/Gemfile.lock +28 -34
  17. data/README.md +93 -6
  18. data/docs/AdditionalFieldsInnerInner.md +4 -0
  19. data/docs/{APIApplicationApi.md → ApiApplicationApi.md} +9 -9
  20. data/docs/BulkSendApi.md +4 -4
  21. data/docs/BulkSendCsvRequest.md +1 -1
  22. data/docs/ConditionalLogicDecisionInfo.md +26 -0
  23. data/docs/ConditionalRuleInfo.md +26 -0
  24. data/docs/ConditionalRuleInfoConditionsInner.md +26 -0
  25. data/docs/ConditionalRuleRequest.md +28 -0
  26. data/docs/ConditionalRuleRequestConditionsInner.md +26 -0
  27. data/docs/CopiedPlaceholdersInner.md +1 -1
  28. data/docs/CreateBulkSendRequest.md +2 -2
  29. data/docs/DocumentApi.md +89 -13
  30. data/docs/DocumentFromTemplateRequest.md +11 -3
  31. data/docs/DocumentFromTemplateResponse.md +12 -2
  32. data/docs/DocumentFromTemplateResponseFieldsInnerInner.md +6 -0
  33. data/docs/DocumentFromTemplateResponseRecipientsInner.md +6 -0
  34. data/docs/DocumentRequest.md +10 -4
  35. data/docs/DocumentResponse.md +12 -2
  36. data/docs/DocumentResponseFieldsInnerInner.md +6 -0
  37. data/docs/DocumentResponseRecipientsInner.md +6 -0
  38. data/docs/DocumentResponseRecipientsInnerPasscodeDelivery.md +22 -0
  39. data/docs/DocumentResponseRecipientsInnerSms.md +30 -0
  40. data/docs/DocumentTemplateRequest.md +5 -3
  41. data/docs/DocumentTemplateResponse.md +3 -1
  42. data/docs/DocumentTemplateResponsePlaceholdersInner.md +3 -1
  43. data/docs/DocumentTemplateUpdateRequest.md +5 -3
  44. data/docs/EmbeddedBranding.md +18 -0
  45. data/docs/EmbeddedBrandingBranding.md +26 -0
  46. data/docs/EmbeddedBrandingRequest.md +26 -0
  47. data/docs/EmbeddedBrandingRequestCompanyLogo.md +20 -0
  48. data/docs/EmbeddedRequest.md +18 -0
  49. data/docs/FieldsInnerInner.md +4 -0
  50. data/docs/FileInfo.md +1 -1
  51. data/docs/PlaceholdersInner.md +4 -2
  52. data/docs/PlaceholdersInnerPasscodeDelivery.md +22 -0
  53. data/docs/RecipientsInner.md +14 -4
  54. data/docs/RecipientsInnerPasscodeDelivery.md +22 -0
  55. data/docs/RegionalApi.md +4 -4
  56. data/docs/ReminderRecipientsInner.md +1 -1
  57. data/docs/SendReminderRequest.md +1 -1
  58. data/docs/TemplateApi.md +3 -1
  59. data/docs/TemplateFieldsInnerInner.md +4 -0
  60. data/docs/TemplateRecipientsInner.md +14 -4
  61. data/docs/UpdateAuthenticationRequest.md +18 -0
  62. data/docs/UpdateAuthenticationRequestRecipientsInner.md +22 -0
  63. data/docs/UpdateDocumentAndSendRequest.md +9 -3
  64. data/docs/UpdateRecipientsMapInner.md +4 -2
  65. data/docs/UpdateRecipientsMapInnerPasscodeDelivery.md +22 -0
  66. data/docs/WebhookResponse.md +0 -2
  67. data/docs/WebhooksApi.md +1 -1
  68. data/lib/signwell_sdk/api/api_application_api.rb +35 -40
  69. data/lib/signwell_sdk/api/bulk_send_api.rb +116 -111
  70. data/lib/signwell_sdk/api/document_api.rb +324 -162
  71. data/lib/signwell_sdk/api/me_api.rb +20 -20
  72. data/lib/signwell_sdk/api/regional_api.rb +46 -28
  73. data/lib/signwell_sdk/api/template_api.rb +116 -85
  74. data/lib/signwell_sdk/api/webhooks_api.rb +51 -48
  75. data/lib/signwell_sdk/api_client.rb +274 -95
  76. data/lib/signwell_sdk/api_error.rb +141 -17
  77. data/lib/signwell_sdk/api_model_base.rb +88 -0
  78. data/lib/signwell_sdk/configuration.rb +43 -53
  79. data/lib/signwell_sdk/{embedded → extras/embedded}/railtie.rb +2 -0
  80. data/lib/signwell_sdk/extras/embedded/view_helpers.rb +281 -0
  81. data/lib/signwell_sdk/{embedded.rb → extras/embedded.rb} +96 -54
  82. data/lib/signwell_sdk/extras/rate_limit.rb +17 -0
  83. data/lib/signwell_sdk/extras/webhook.rb +257 -0
  84. data/lib/signwell_sdk/models/account_info_response.rb +109 -85
  85. data/lib/signwell_sdk/models/account_info_response_active_users_inner.rb +79 -60
  86. data/lib/signwell_sdk/models/account_info_response_preferences.rb +111 -102
  87. data/lib/signwell_sdk/models/additional_fields_inner_inner.rb +248 -145
  88. data/lib/signwell_sdk/models/additional_fields_inner_inner_value.rb +25 -24
  89. data/lib/signwell_sdk/models/additional_files_inner.rb +57 -52
  90. data/lib/signwell_sdk/models/api_application_response.rb +90 -72
  91. data/lib/signwell_sdk/models/api_application_response_owner.rb +79 -58
  92. data/lib/signwell_sdk/models/api_application_response_preferences.rb +66 -62
  93. data/lib/signwell_sdk/models/attachment_request_info.rb +65 -52
  94. data/lib/signwell_sdk/models/attachment_requests_inner.rb +67 -56
  95. data/lib/signwell_sdk/models/bulk_send_create_response.rb +109 -77
  96. data/lib/signwell_sdk/models/bulk_send_csv_request.rb +54 -49
  97. data/lib/signwell_sdk/models/bulk_send_csv_template_response.rb +45 -42
  98. data/lib/signwell_sdk/models/bulk_send_documents_response.rb +145 -102
  99. data/lib/signwell_sdk/models/bulk_send_list_item.rb +146 -97
  100. data/lib/signwell_sdk/models/bulk_send_list_response.rb +98 -72
  101. data/lib/signwell_sdk/models/bulk_send_response.rb +124 -91
  102. data/lib/signwell_sdk/models/bulk_send_response_templates_inner.rb +59 -48
  103. data/lib/signwell_sdk/models/bulk_send_validate_csv_response.rb +90 -77
  104. data/lib/signwell_sdk/models/checkbox_group_info.rb +110 -85
  105. data/lib/signwell_sdk/models/checkbox_groups_inner.rb +104 -82
  106. data/lib/signwell_sdk/models/checkbox_validation.rb +16 -16
  107. data/lib/signwell_sdk/models/completed_pdf_response.rb +24 -23
  108. data/lib/signwell_sdk/models/completed_pdf_url_response.rb +45 -42
  109. data/lib/signwell_sdk/models/conditional_logic_decision_info.rb +365 -0
  110. data/lib/signwell_sdk/models/conditional_rule_info.rb +351 -0
  111. data/lib/signwell_sdk/models/conditional_rule_info_conditions_inner.rb +340 -0
  112. data/lib/signwell_sdk/models/conditional_rule_request.rb +322 -0
  113. data/lib/signwell_sdk/models/conditional_rule_request_conditions_inner.rb +371 -0
  114. data/lib/signwell_sdk/models/copied_contact_info.rb +57 -50
  115. data/lib/signwell_sdk/models/copied_contacts_inner.rb +51 -46
  116. data/lib/signwell_sdk/models/copied_placeholders_inner.rb +57 -54
  117. data/lib/signwell_sdk/models/create_bulk_send_request.rb +108 -94
  118. data/lib/signwell_sdk/models/create_webhook_request.rb +51 -48
  119. data/lib/signwell_sdk/models/date_format.rb +17 -17
  120. data/lib/signwell_sdk/models/detailed_option.rb +59 -54
  121. data/lib/signwell_sdk/models/document_from_template_request.rb +351 -224
  122. data/lib/signwell_sdk/models/document_from_template_response.rb +384 -212
  123. data/lib/signwell_sdk/models/document_from_template_response_fields_inner_inner.rb +247 -139
  124. data/lib/signwell_sdk/models/document_from_template_response_fields_inner_inner_recipient.rb +65 -54
  125. data/lib/signwell_sdk/models/document_from_template_response_recipients_inner.rb +219 -119
  126. data/lib/signwell_sdk/models/document_list_response.rb +98 -72
  127. data/lib/signwell_sdk/models/document_request.rb +288 -216
  128. data/lib/signwell_sdk/models/document_response.rb +386 -214
  129. data/lib/signwell_sdk/models/document_response_attachment_requests_inner.rb +65 -54
  130. data/lib/signwell_sdk/models/document_response_fields_inner_inner.rb +247 -139
  131. data/lib/signwell_sdk/models/document_response_fields_inner_inner_options_inner.rb +50 -49
  132. data/lib/signwell_sdk/models/document_response_fields_inner_inner_recipient.rb +59 -48
  133. data/lib/signwell_sdk/models/document_response_fields_inner_inner_value.rb +25 -24
  134. data/lib/signwell_sdk/models/document_response_recipients_inner.rb +222 -118
  135. data/lib/signwell_sdk/models/document_response_recipients_inner_passcode_delivery.rb +246 -0
  136. data/lib/signwell_sdk/models/document_response_recipients_inner_sms.rb +292 -0
  137. data/lib/signwell_sdk/models/document_template_list_response.rb +98 -72
  138. data/lib/signwell_sdk/models/document_template_request.rb +213 -168
  139. data/lib/signwell_sdk/models/document_template_response.rb +250 -180
  140. data/lib/signwell_sdk/models/document_template_response_copied_placeholders_inner.rb +82 -72
  141. data/lib/signwell_sdk/models/document_template_response_placeholders_inner.rb +98 -79
  142. data/lib/signwell_sdk/models/document_template_update_request.rb +156 -127
  143. data/lib/signwell_sdk/models/dropdown_option.rb +24 -23
  144. data/lib/signwell_sdk/models/embedded_branding.rb +241 -0
  145. data/lib/signwell_sdk/models/embedded_branding_branding.rb +307 -0
  146. data/lib/signwell_sdk/models/embedded_branding_request.rb +297 -0
  147. data/lib/signwell_sdk/models/embedded_branding_request_company_logo.rb +236 -0
  148. data/lib/signwell_sdk/models/embedded_request.rb +225 -0
  149. data/lib/signwell_sdk/models/error_response.rb +44 -45
  150. data/lib/signwell_sdk/models/error_response_meta.rb +66 -55
  151. data/lib/signwell_sdk/models/field_type.rb +27 -28
  152. data/lib/signwell_sdk/models/fields_inner_inner.rb +242 -141
  153. data/lib/signwell_sdk/models/file_format.rb +14 -14
  154. data/lib/signwell_sdk/models/file_info.rb +51 -56
  155. data/lib/signwell_sdk/models/files_inner.rb +57 -52
  156. data/lib/signwell_sdk/models/label_info.rb +44 -45
  157. data/lib/signwell_sdk/models/label_request.rb +45 -42
  158. data/lib/signwell_sdk/models/label_response.rb +51 -46
  159. data/lib/signwell_sdk/models/me_response.rb +121 -76
  160. data/lib/signwell_sdk/models/me_response_contact.rb +113 -85
  161. data/lib/signwell_sdk/models/me_response_user.rb +91 -68
  162. data/lib/signwell_sdk/models/me_response_user_preferences.rb +50 -49
  163. data/lib/signwell_sdk/models/nom151_certificate_response.rb +45 -42
  164. data/lib/signwell_sdk/models/nom151_certificate_response_nom151.rb +137 -82
  165. data/lib/signwell_sdk/models/nom151_url_response.rb +45 -42
  166. data/lib/signwell_sdk/models/pagination_meta.rb +87 -65
  167. data/lib/signwell_sdk/models/placeholders_inner.rb +81 -60
  168. data/lib/signwell_sdk/models/placeholders_inner_passcode_delivery.rb +271 -0
  169. data/lib/signwell_sdk/models/rate_limit_error_response.rb +45 -42
  170. data/lib/signwell_sdk/models/recipients_inner.rb +190 -90
  171. data/lib/signwell_sdk/models/recipients_inner_passcode_delivery.rb +271 -0
  172. data/lib/signwell_sdk/models/reminder_recipients_inner.rb +45 -46
  173. data/lib/signwell_sdk/models/send_reminder_request.rb +40 -43
  174. data/lib/signwell_sdk/models/template_attachment_requests_inner.rb +64 -55
  175. data/lib/signwell_sdk/models/template_checkbox_groups_inner.rb +101 -81
  176. data/lib/signwell_sdk/models/template_field_values_inner.rb +59 -48
  177. data/lib/signwell_sdk/models/template_field_values_inner_value.rb +25 -24
  178. data/lib/signwell_sdk/models/template_fields_inner_inner.rb +239 -140
  179. data/lib/signwell_sdk/models/template_recipients_inner.rb +196 -94
  180. data/lib/signwell_sdk/models/text_validation.rb +24 -24
  181. data/lib/signwell_sdk/models/update_authentication_request.rb +243 -0
  182. data/lib/signwell_sdk/models/update_authentication_request_recipients_inner.rb +262 -0
  183. data/lib/signwell_sdk/models/update_document_and_send_request.rb +206 -150
  184. data/lib/signwell_sdk/models/update_recipients_map_inner.rb +102 -69
  185. data/lib/signwell_sdk/models/update_recipients_map_inner_passcode_delivery.rb +271 -0
  186. data/lib/signwell_sdk/models/update_recipients_request.rb +42 -43
  187. data/lib/signwell_sdk/models/validation_error_response.rb +42 -43
  188. data/lib/signwell_sdk/models/webhook_response.rb +67 -66
  189. data/lib/signwell_sdk/version.rb +4 -4
  190. data/lib/signwell_sdk.rb +34 -13
  191. data/openapi.yaml +2171 -902
  192. data/package-lock.json +542 -136
  193. data/package.json +4 -1
  194. data/signwell_sdk.gemspec +26 -8
  195. data/spec/api/api_application_api_spec.rb +15 -14
  196. data/spec/api/bulk_send_api_spec.rb +13 -14
  197. data/spec/api/document_api_spec.rb +24 -21
  198. data/spec/api/me_api_spec.rb +11 -10
  199. data/spec/api/regional_api_spec.rb +12 -11
  200. data/spec/api/template_api_spec.rb +12 -13
  201. data/spec/api/webhooks_api_spec.rb +12 -11
  202. data/spec/models/account_info_response_active_users_inner_spec.rb +11 -11
  203. data/spec/models/account_info_response_preferences_spec.rb +11 -11
  204. data/spec/models/account_info_response_spec.rb +10 -10
  205. data/spec/models/additional_fields_inner_inner_spec.rb +23 -11
  206. data/spec/models/additional_fields_inner_inner_value_spec.rb +9 -10
  207. data/spec/models/additional_files_inner_spec.rb +11 -11
  208. data/spec/models/api_application_response_owner_spec.rb +11 -11
  209. data/spec/models/api_application_response_preferences_spec.rb +11 -11
  210. data/spec/models/api_application_response_spec.rb +10 -10
  211. data/spec/models/attachment_request_info_spec.rb +11 -11
  212. data/spec/models/attachment_requests_inner_spec.rb +11 -11
  213. data/spec/models/bulk_send_create_response_spec.rb +10 -10
  214. data/spec/models/bulk_send_csv_request_spec.rb +11 -11
  215. data/spec/models/bulk_send_csv_template_response_spec.rb +10 -10
  216. data/spec/models/bulk_send_documents_response_spec.rb +11 -11
  217. data/spec/models/bulk_send_list_item_spec.rb +11 -11
  218. data/spec/models/bulk_send_list_response_spec.rb +10 -10
  219. data/spec/models/bulk_send_response_spec.rb +11 -11
  220. data/spec/models/bulk_send_response_templates_inner_spec.rb +11 -11
  221. data/spec/models/bulk_send_validate_csv_response_spec.rb +10 -10
  222. data/spec/models/checkbox_group_info_spec.rb +10 -10
  223. data/spec/models/checkbox_groups_inner_spec.rb +10 -10
  224. data/spec/models/checkbox_validation_spec.rb +10 -10
  225. data/spec/models/completed_pdf_response_spec.rb +9 -10
  226. data/spec/models/completed_pdf_url_response_spec.rb +10 -10
  227. data/spec/models/conditional_logic_decision_info_spec.rb +58 -0
  228. data/spec/models/conditional_rule_info_conditions_inner_spec.rb +58 -0
  229. data/spec/models/conditional_rule_info_spec.rb +58 -0
  230. data/spec/models/conditional_rule_request_conditions_inner_spec.rb +58 -0
  231. data/spec/models/conditional_rule_request_spec.rb +64 -0
  232. data/spec/models/copied_contact_info_spec.rb +11 -11
  233. data/spec/models/copied_contacts_inner_spec.rb +11 -11
  234. data/spec/models/copied_placeholders_inner_spec.rb +11 -11
  235. data/spec/models/create_bulk_send_request_spec.rb +11 -11
  236. data/spec/models/create_webhook_request_spec.rb +11 -11
  237. data/spec/models/date_format_spec.rb +10 -10
  238. data/spec/models/detailed_option_spec.rb +11 -11
  239. data/spec/models/document_from_template_request_spec.rb +35 -11
  240. data/spec/models/document_from_template_response_fields_inner_inner_recipient_spec.rb +11 -11
  241. data/spec/models/document_from_template_response_fields_inner_inner_spec.rb +29 -11
  242. data/spec/models/document_from_template_response_recipients_inner_spec.rb +29 -11
  243. data/spec/models/document_from_template_response_spec.rb +41 -11
  244. data/spec/models/document_list_response_spec.rb +10 -10
  245. data/spec/models/document_request_spec.rb +29 -11
  246. data/spec/models/document_response_attachment_requests_inner_spec.rb +11 -11
  247. data/spec/models/document_response_fields_inner_inner_options_inner_spec.rb +11 -11
  248. data/spec/models/document_response_fields_inner_inner_recipient_spec.rb +11 -11
  249. data/spec/models/document_response_fields_inner_inner_spec.rb +29 -11
  250. data/spec/models/document_response_fields_inner_inner_value_spec.rb +9 -10
  251. data/spec/models/document_response_recipients_inner_passcode_delivery_spec.rb +46 -0
  252. data/spec/models/document_response_recipients_inner_sms_spec.rb +70 -0
  253. data/spec/models/document_response_recipients_inner_spec.rb +29 -11
  254. data/spec/models/document_response_spec.rb +41 -11
  255. data/spec/models/document_template_list_response_spec.rb +10 -10
  256. data/spec/models/document_template_request_spec.rb +17 -11
  257. data/spec/models/document_template_response_copied_placeholders_inner_spec.rb +10 -10
  258. data/spec/models/document_template_response_placeholders_inner_spec.rb +16 -10
  259. data/spec/models/document_template_response_spec.rb +17 -11
  260. data/spec/models/document_template_update_request_spec.rb +17 -11
  261. data/spec/models/dropdown_option_spec.rb +9 -10
  262. data/spec/models/embedded_branding_branding_spec.rb +58 -0
  263. data/spec/models/embedded_branding_request_company_logo_spec.rb +40 -0
  264. data/spec/models/embedded_branding_request_spec.rb +58 -0
  265. data/spec/models/embedded_branding_spec.rb +34 -0
  266. data/spec/models/embedded_request_spec.rb +34 -0
  267. data/spec/models/error_response_meta_spec.rb +11 -11
  268. data/spec/models/error_response_spec.rb +11 -11
  269. data/spec/models/field_type_spec.rb +10 -10
  270. data/spec/models/fields_inner_inner_spec.rb +23 -11
  271. data/spec/models/file_format_spec.rb +10 -10
  272. data/spec/models/file_info_spec.rb +11 -11
  273. data/spec/models/files_inner_spec.rb +11 -11
  274. data/spec/models/label_info_spec.rb +11 -11
  275. data/spec/models/label_request_spec.rb +10 -10
  276. data/spec/models/label_response_spec.rb +11 -11
  277. data/spec/models/me_response_contact_spec.rb +10 -10
  278. data/spec/models/me_response_spec.rb +10 -10
  279. data/spec/models/me_response_user_preferences_spec.rb +11 -11
  280. data/spec/models/me_response_user_spec.rb +10 -10
  281. data/spec/models/nom151_certificate_response_nom151_spec.rb +10 -10
  282. data/spec/models/nom151_certificate_response_spec.rb +10 -10
  283. data/spec/models/nom151_url_response_spec.rb +10 -10
  284. data/spec/models/pagination_meta_spec.rb +11 -11
  285. data/spec/models/placeholders_inner_passcode_delivery_spec.rb +46 -0
  286. data/spec/models/placeholders_inner_spec.rb +17 -11
  287. data/spec/models/rate_limit_error_response_spec.rb +10 -10
  288. data/spec/models/recipients_inner_passcode_delivery_spec.rb +46 -0
  289. data/spec/models/recipients_inner_spec.rb +41 -11
  290. data/spec/models/reminder_recipients_inner_spec.rb +11 -11
  291. data/spec/models/send_reminder_request_spec.rb +10 -10
  292. data/spec/models/template_attachment_requests_inner_spec.rb +11 -11
  293. data/spec/models/template_checkbox_groups_inner_spec.rb +10 -10
  294. data/spec/models/template_field_values_inner_spec.rb +11 -11
  295. data/spec/models/template_field_values_inner_value_spec.rb +9 -10
  296. data/spec/models/template_fields_inner_inner_spec.rb +23 -11
  297. data/spec/models/template_recipients_inner_spec.rb +41 -11
  298. data/spec/models/text_validation_spec.rb +10 -10
  299. data/spec/models/update_authentication_request_recipients_inner_spec.rb +46 -0
  300. data/spec/models/update_authentication_request_spec.rb +34 -0
  301. data/spec/models/update_document_and_send_request_spec.rb +29 -11
  302. data/spec/models/update_recipients_map_inner_passcode_delivery_spec.rb +46 -0
  303. data/spec/models/update_recipients_map_inner_spec.rb +16 -10
  304. data/spec/models/update_recipients_request_spec.rb +10 -10
  305. data/spec/models/validation_error_response_spec.rb +10 -10
  306. data/spec/models/webhook_response_spec.rb +11 -17
  307. data/spec/regressions/api_client_spec.rb +536 -0
  308. data/spec/regressions/bulk_send_api_spec.rb +47 -0
  309. data/spec/regressions/embedded_spec.rb +263 -0
  310. data/spec/regressions/generated_resource_helpers_spec.rb +119 -0
  311. data/spec/regressions/response_modes_spec.rb +93 -0
  312. data/spec/regressions/view_helpers_spec.rb +202 -0
  313. data/spec/regressions/webhook_spec.rb +210 -0
  314. data/spec/spec_helper.rb +10 -12
  315. metadata +197 -91
  316. data/lib/signwell_sdk/embedded/view_helpers.rb +0 -132
  317. data/lib/signwell_sdk/webhook.rb +0 -109
@@ -1,14 +1,13 @@
1
- # frozen_string_literal: true
2
-
3
- # SignWell Developer API
4
- #
5
- # API for creating, managing, and tracking electronic signature workflows.
6
- #
7
- # The version of the OpenAPI document: v1
8
- # Contact: support@signwell.com
9
- # Generated by: https://openapi-generator.tech
10
- # Generator version: 7.12.0
11
- #
1
+ =begin
2
+ SignWell Developer API
3
+
4
+ API for creating, managing, and tracking electronic signature workflows.
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: support@signwell.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+ =end
12
11
 
13
12
  require 'date'
14
13
  require 'time'
@@ -40,6 +39,9 @@ module SignWell
40
39
  # @return [Boolean]
41
40
  attr_accessor :fixed_width
42
41
 
42
+ # @return [String]
43
+ attr_accessor :formula
44
+
43
45
  # @return [String]
44
46
  attr_accessor :label
45
47
 
@@ -55,6 +57,14 @@ module SignWell
55
57
  # @return [TextValidation]
56
58
  attr_accessor :validation
57
59
 
60
+ # Text fields with custom validation only: the regex pattern used to validate field values. Required when validation is set to custom.
61
+ # @return [String]
62
+ attr_accessor :validation_regex
63
+
64
+ # Text fields with custom validation only: the error message shown to the recipient when their input doesn't match the regex pattern. Required when validation is set to custom.
65
+ # @return [String]
66
+ attr_accessor :validation_regex_error_message
67
+
58
68
  # @return [DocumentResponseFieldsInnerInnerValue]
59
69
  attr_accessor :value
60
70
 
@@ -86,7 +96,8 @@ module SignWell
86
96
  attr_accessor :allow_other
87
97
 
88
98
  class EnumAttributeValidator
89
- attr_reader :datatype, :allowable_values
99
+ attr_reader :datatype
100
+ attr_reader :allowable_values
90
101
 
91
102
  def initialize(datatype, allowable_values)
92
103
  @allowable_values = allowable_values.map do |value|
@@ -109,28 +120,31 @@ module SignWell
109
120
  # Attribute mapping from ruby-style variable name to JSON key.
110
121
  def self.attribute_map
111
122
  {
112
- 'x': :x,
113
- 'y': :y,
114
- 'page': :page,
115
- 'recipient': :recipient,
116
- 'api_id': :api_id,
117
- 'name': :name,
118
- 'date_format': :date_format,
119
- 'fixed_width': :fixed_width,
120
- 'label': :label,
121
- 'lock_sign_date': :lock_sign_date,
122
- 'required': :required,
123
- 'type': :type,
124
- 'validation': :validation,
125
- 'value': :value,
126
- 'height': :height,
127
- 'width': :width,
128
- 'recipient_id': :recipient_id,
129
- 'signing_elements_group_id': :signing_elements_group_id,
130
- 'placeholder_name': :placeholder_name,
131
- 'options': :options,
132
- 'default_option': :default_option,
133
- 'allow_other': :allow_other
123
+ :'x' => :'x',
124
+ :'y' => :'y',
125
+ :'page' => :'page',
126
+ :'recipient' => :'recipient',
127
+ :'api_id' => :'api_id',
128
+ :'name' => :'name',
129
+ :'date_format' => :'date_format',
130
+ :'fixed_width' => :'fixed_width',
131
+ :'formula' => :'formula',
132
+ :'label' => :'label',
133
+ :'lock_sign_date' => :'lock_sign_date',
134
+ :'required' => :'required',
135
+ :'type' => :'type',
136
+ :'validation' => :'validation',
137
+ :'validation_regex' => :'validation_regex',
138
+ :'validation_regex_error_message' => :'validation_regex_error_message',
139
+ :'value' => :'value',
140
+ :'height' => :'height',
141
+ :'width' => :'width',
142
+ :'recipient_id' => :'recipient_id',
143
+ :'signing_elements_group_id' => :'signing_elements_group_id',
144
+ :'placeholder_name' => :'placeholder_name',
145
+ :'options' => :'options',
146
+ :'default_option' => :'default_option',
147
+ :'allow_other' => :'allow_other'
134
148
  }
135
149
  end
136
150
 
@@ -147,120 +161,209 @@ module SignWell
147
161
  # Attribute type mapping.
148
162
  def self.openapi_types
149
163
  {
150
- 'x': :Float,
151
- 'y': :Float,
152
- 'page': :Integer,
153
- 'recipient': :DocumentResponseFieldsInnerInnerRecipient,
154
- 'api_id': :String,
155
- 'name': :String,
156
- 'date_format': :DateFormat,
157
- 'fixed_width': :Boolean,
158
- 'label': :String,
159
- 'lock_sign_date': :Boolean,
160
- 'required': :Boolean,
161
- 'type': :FieldType,
162
- 'validation': :TextValidation,
163
- 'value': :DocumentResponseFieldsInnerInnerValue,
164
- 'height': :String,
165
- 'width': :String,
166
- 'recipient_id': :String,
167
- 'signing_elements_group_id': :String,
168
- 'placeholder_name': :String,
169
- 'options': :'Array<DocumentResponseFieldsInnerInnerOptionsInner>',
170
- 'default_option': :String,
171
- 'allow_other': :Boolean
164
+ :'x' => :'Float',
165
+ :'y' => :'Float',
166
+ :'page' => :'Integer',
167
+ :'recipient' => :'DocumentResponseFieldsInnerInnerRecipient',
168
+ :'api_id' => :'String',
169
+ :'name' => :'String',
170
+ :'date_format' => :'DateFormat',
171
+ :'fixed_width' => :'Boolean',
172
+ :'formula' => :'String',
173
+ :'label' => :'String',
174
+ :'lock_sign_date' => :'Boolean',
175
+ :'required' => :'Boolean',
176
+ :'type' => :'FieldType',
177
+ :'validation' => :'TextValidation',
178
+ :'validation_regex' => :'String',
179
+ :'validation_regex_error_message' => :'String',
180
+ :'value' => :'DocumentResponseFieldsInnerInnerValue',
181
+ :'height' => :'String',
182
+ :'width' => :'String',
183
+ :'recipient_id' => :'String',
184
+ :'signing_elements_group_id' => :'String',
185
+ :'placeholder_name' => :'String',
186
+ :'options' => :'Array<DocumentResponseFieldsInnerInnerOptionsInner>',
187
+ :'default_option' => :'String',
188
+ :'allow_other' => :'Boolean'
172
189
  }
173
190
  end
174
191
 
175
192
  # List of attributes with nullable: true
176
193
  def self.openapi_nullable
177
- Set.new(%i[
178
- name
179
- value
180
- recipient_id
181
- ])
194
+ Set.new([
195
+ :'name',
196
+ :'value',
197
+ :'recipient_id',
198
+ ])
182
199
  end
183
200
 
184
201
  # Initializes the object
185
202
  # @param [Hash] attributes Model attributes in the form of hash
186
203
  def initialize(attributes = {})
187
- unless attributes.is_a?(Hash)
188
- raise ArgumentError,
189
- 'The input argument (attributes) must be a hash in `SignWell::DocumentResponseFieldsInnerInner` initialize method'
204
+ if (!attributes.is_a?(Hash))
205
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SignWell::DocumentResponseFieldsInnerInner` initialize method"
190
206
  end
191
207
 
192
208
  # check to see if the attribute exists and convert string to symbol for hash key
193
209
  acceptable_attribute_map = self.class.acceptable_attribute_map
194
- attributes = attributes.each_with_object({}) do |(k, v), h|
195
- unless acceptable_attribute_map.key?(k.to_sym)
196
- raise ArgumentError,
197
- "`#{k}` is not a valid attribute in `SignWell::DocumentResponseFieldsInnerInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
210
+ attributes = attributes.each_with_object({}) { |(k, v), h|
211
+ if (!acceptable_attribute_map.key?(k.to_sym))
212
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SignWell::DocumentResponseFieldsInnerInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
198
213
  end
199
-
200
214
  h[k.to_sym] = v
215
+ }
216
+
217
+ if attributes.key?(:'x')
218
+ self.x = attributes[:'x']
219
+ else
220
+ self.x = nil
201
221
  end
202
222
 
203
- self.x = (attributes[:x] if attributes.key?(:x))
223
+ if attributes.key?(:'y')
224
+ self.y = attributes[:'y']
225
+ else
226
+ self.y = nil
227
+ end
204
228
 
205
- self.y = (attributes[:y] if attributes.key?(:y))
229
+ if attributes.key?(:'page')
230
+ self.page = attributes[:'page']
231
+ else
232
+ self.page = nil
233
+ end
234
+
235
+ if attributes.key?(:'recipient')
236
+ self.recipient = attributes[:'recipient']
237
+ end
238
+
239
+ if attributes.key?(:'api_id')
240
+ self.api_id = attributes[:'api_id']
241
+ end
242
+
243
+ if attributes.key?(:'name')
244
+ self.name = attributes[:'name']
245
+ end
206
246
 
207
- self.page = (attributes[:page] if attributes.key?(:page))
247
+ if attributes.key?(:'date_format')
248
+ self.date_format = attributes[:'date_format']
249
+ end
208
250
 
209
- self.recipient = attributes[:recipient] if attributes.key?(:recipient)
251
+ if attributes.key?(:'fixed_width')
252
+ self.fixed_width = attributes[:'fixed_width']
253
+ end
210
254
 
211
- self.api_id = attributes[:api_id] if attributes.key?(:api_id)
255
+ if attributes.key?(:'formula')
256
+ self.formula = attributes[:'formula']
257
+ end
212
258
 
213
- self.name = attributes[:name] if attributes.key?(:name)
259
+ if attributes.key?(:'label')
260
+ self.label = attributes[:'label']
261
+ end
214
262
 
215
- self.date_format = attributes[:date_format] if attributes.key?(:date_format)
263
+ if attributes.key?(:'lock_sign_date')
264
+ self.lock_sign_date = attributes[:'lock_sign_date']
265
+ end
266
+
267
+ if attributes.key?(:'required')
268
+ self.required = attributes[:'required']
269
+ end
216
270
 
217
- self.fixed_width = attributes[:fixed_width] if attributes.key?(:fixed_width)
271
+ if attributes.key?(:'type')
272
+ self.type = attributes[:'type']
273
+ end
218
274
 
219
- self.label = attributes[:label] if attributes.key?(:label)
275
+ if attributes.key?(:'validation')
276
+ self.validation = attributes[:'validation']
277
+ end
220
278
 
221
- self.lock_sign_date = attributes[:lock_sign_date] if attributes.key?(:lock_sign_date)
279
+ if attributes.key?(:'validation_regex')
280
+ self.validation_regex = attributes[:'validation_regex']
281
+ end
222
282
 
223
- self.required = attributes[:required] if attributes.key?(:required)
283
+ if attributes.key?(:'validation_regex_error_message')
284
+ self.validation_regex_error_message = attributes[:'validation_regex_error_message']
285
+ end
224
286
 
225
- self.type = attributes[:type] if attributes.key?(:type)
287
+ if attributes.key?(:'value')
288
+ self.value = attributes[:'value']
289
+ end
226
290
 
227
- self.validation = attributes[:validation] if attributes.key?(:validation)
291
+ if attributes.key?(:'height')
292
+ self.height = attributes[:'height']
293
+ end
228
294
 
229
- self.value = attributes[:value] if attributes.key?(:value)
295
+ if attributes.key?(:'width')
296
+ self.width = attributes[:'width']
297
+ end
230
298
 
231
- self.height = attributes[:height] if attributes.key?(:height)
299
+ if attributes.key?(:'recipient_id')
300
+ self.recipient_id = attributes[:'recipient_id']
301
+ end
232
302
 
233
- self.width = attributes[:width] if attributes.key?(:width)
303
+ if attributes.key?(:'signing_elements_group_id')
304
+ self.signing_elements_group_id = attributes[:'signing_elements_group_id']
305
+ end
234
306
 
235
- self.recipient_id = attributes[:recipient_id] if attributes.key?(:recipient_id)
307
+ if attributes.key?(:'placeholder_name')
308
+ self.placeholder_name = attributes[:'placeholder_name']
309
+ end
236
310
 
237
- if attributes.key?(:signing_elements_group_id)
238
- self.signing_elements_group_id = attributes[:signing_elements_group_id]
311
+ if attributes.key?(:'options')
312
+ if (value = attributes[:'options']).is_a?(Array)
313
+ self.options = value
314
+ end
239
315
  end
240
316
 
241
- self.placeholder_name = attributes[:placeholder_name] if attributes.key?(:placeholder_name)
317
+ if attributes.key?(:'default_option')
318
+ self.default_option = attributes[:'default_option']
319
+ end
242
320
 
243
- if attributes.key?(:options) && (value = attributes[:options]).is_a?(Array)
244
- self.options = value
321
+ if attributes.key?(:'allow_other')
322
+ self.allow_other = attributes[:'allow_other']
245
323
  end
324
+ end
246
325
 
247
- self.default_option = attributes[:default_option] if attributes.key?(:default_option)
326
+ private
248
327
 
249
- return unless attributes.key?(:allow_other)
328
+ def normalize_for_serialization!
329
+ return unless type == 'checkbox' && !value.nil?
250
330
 
251
- self.allow_other = attributes[:allow_other]
331
+ self.value = normalize_checkbox_value(value)
252
332
  end
253
333
 
334
+ def normalize_checkbox_value(raw_value)
335
+ actual_value = raw_value.respond_to?(:actual_instance) ? raw_value.actual_instance : raw_value
336
+ return 't' if actual_value == true
337
+ return 'f' if actual_value == false
338
+
339
+ if actual_value.is_a?(String)
340
+ normalized = actual_value.strip.downcase
341
+ return 't' if %w[true t].include?(normalized)
342
+ return 'f' if %w[false f].include?(normalized)
343
+ end
344
+
345
+ fail ArgumentError, 'Checkbox field values must be boolean or one of "true", "false", "t", or "f".'
346
+ end
347
+
348
+ public
349
+
350
+
254
351
  # Show invalid properties with the reasons. Usually used together with valid?
255
352
  # @return Array for valid properties with the reasons
256
353
  def list_invalid_properties
257
354
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
258
- invalid_properties = []
259
- invalid_properties.push('invalid value for "x", x cannot be nil.') if @x.nil?
355
+ invalid_properties = Array.new
356
+ if @x.nil?
357
+ invalid_properties.push('invalid value for "x", x cannot be nil.')
358
+ end
260
359
 
261
- invalid_properties.push('invalid value for "y", y cannot be nil.') if @y.nil?
360
+ if @y.nil?
361
+ invalid_properties.push('invalid value for "y", y cannot be nil.')
362
+ end
262
363
 
263
- invalid_properties.push('invalid value for "page", page cannot be nil.') if @page.nil?
364
+ if @page.nil?
365
+ invalid_properties.push('invalid value for "page", page cannot be nil.')
366
+ end
264
367
 
265
368
  invalid_properties
266
369
  end
@@ -272,14 +375,15 @@ module SignWell
272
375
  return false if @x.nil?
273
376
  return false if @y.nil?
274
377
  return false if @page.nil?
275
-
276
378
  true
277
379
  end
278
380
 
279
381
  # Custom attribute writer method with validation
280
382
  # @param [Object] x Value to be assigned
281
383
  def x=(x)
282
- raise ArgumentError, 'x cannot be nil' if x.nil?
384
+ if x.nil?
385
+ fail ArgumentError, 'x cannot be nil'
386
+ end
283
387
 
284
388
  @x = x
285
389
  end
@@ -287,7 +391,9 @@ module SignWell
287
391
  # Custom attribute writer method with validation
288
392
  # @param [Object] y Value to be assigned
289
393
  def y=(y)
290
- raise ArgumentError, 'y cannot be nil' if y.nil?
394
+ if y.nil?
395
+ fail ArgumentError, 'y cannot be nil'
396
+ end
291
397
 
292
398
  @y = y
293
399
  end
@@ -295,52 +401,55 @@ module SignWell
295
401
  # Custom attribute writer method with validation
296
402
  # @param [Object] page Value to be assigned
297
403
  def page=(page)
298
- raise ArgumentError, 'page cannot be nil' if page.nil?
404
+ if page.nil?
405
+ fail ArgumentError, 'page cannot be nil'
406
+ end
299
407
 
300
408
  @page = page
301
409
  end
302
410
 
303
411
  # Checks equality by comparing each attribute.
304
412
  # @param [Object] other Object to be compared
305
- def ==(other)
306
- return true if equal?(other)
307
-
308
- self.class == other.class &&
309
- x == other.x &&
310
- y == other.y &&
311
- page == other.page &&
312
- recipient == other.recipient &&
313
- api_id == other.api_id &&
314
- name == other.name &&
315
- date_format == other.date_format &&
316
- fixed_width == other.fixed_width &&
317
- label == other.label &&
318
- lock_sign_date == other.lock_sign_date &&
319
- required == other.required &&
320
- type == other.type &&
321
- validation == other.validation &&
322
- value == other.value &&
323
- height == other.height &&
324
- width == other.width &&
325
- recipient_id == other.recipient_id &&
326
- signing_elements_group_id == other.signing_elements_group_id &&
327
- placeholder_name == other.placeholder_name &&
328
- options == other.options &&
329
- default_option == other.default_option &&
330
- allow_other == other.allow_other
413
+ def ==(o)
414
+ return true if self.equal?(o)
415
+ self.class == o.class &&
416
+ x == o.x &&
417
+ y == o.y &&
418
+ page == o.page &&
419
+ recipient == o.recipient &&
420
+ api_id == o.api_id &&
421
+ name == o.name &&
422
+ date_format == o.date_format &&
423
+ fixed_width == o.fixed_width &&
424
+ formula == o.formula &&
425
+ label == o.label &&
426
+ lock_sign_date == o.lock_sign_date &&
427
+ required == o.required &&
428
+ type == o.type &&
429
+ validation == o.validation &&
430
+ validation_regex == o.validation_regex &&
431
+ validation_regex_error_message == o.validation_regex_error_message &&
432
+ value == o.value &&
433
+ height == o.height &&
434
+ width == o.width &&
435
+ recipient_id == o.recipient_id &&
436
+ signing_elements_group_id == o.signing_elements_group_id &&
437
+ placeholder_name == o.placeholder_name &&
438
+ options == o.options &&
439
+ default_option == o.default_option &&
440
+ allow_other == o.allow_other
331
441
  end
332
442
 
333
443
  # @see the `==` method
334
444
  # @param [Object] other Object to be compared
335
- def eql?(other)
336
- self == other
445
+ def eql?(o)
446
+ self == o
337
447
  end
338
448
 
339
449
  # Calculates hash code according to all attributes.
340
450
  # @return [Integer] Hash code
341
451
  def hash
342
- [x, y, page, recipient, api_id, name, date_format, fixed_width, label, lock_sign_date, required, type,
343
- validation, value, height, width, recipient_id, signing_elements_group_id, placeholder_name, options, default_option, allow_other].hash
452
+ [x, y, page, recipient, api_id, name, date_format, fixed_width, formula, label, lock_sign_date, required, type, validation, validation_regex, validation_regex_error_message, value, height, width, recipient_id, signing_elements_group_id, placeholder_name, options, default_option, allow_other].hash
344
453
  end
345
454
 
346
455
  # Builds the object from hash
@@ -348,22 +457,19 @@ module SignWell
348
457
  # @return [Object] Returns the model itself
349
458
  def self.build_from_hash(attributes)
350
459
  return nil unless attributes.is_a?(Hash)
351
-
352
460
  attributes = attributes.transform_keys(&:to_sym)
353
461
  transformed_hash = {}
354
462
  openapi_types.each_pair do |key, type|
355
463
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
356
- transformed_hash[key.to_s] = nil
464
+ transformed_hash["#{key}"] = nil
357
465
  elsif type =~ /\AArray<(.*)>/i
358
466
  # check to ensure the input is an array given that the attribute
359
467
  # is documented as an array but the input is not
360
468
  if attributes[attribute_map[key]].is_a?(Array)
361
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map do |v|
362
- _deserialize(::Regexp.last_match(1), v)
363
- end
469
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
364
470
  end
365
471
  elsif !attributes[attribute_map[key]].nil?
366
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
472
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
367
473
  end
368
474
  end
369
475
  new(transformed_hash)
@@ -427,9 +533,11 @@ module SignWell
427
533
  # Returns the object in the form of hash
428
534
  # @return [Hash] Returns the object in the form of hash
429
535
  def to_hash
536
+ normalize_for_serialization! if respond_to?(:normalize_for_serialization!, true)
537
+
430
538
  hash = {}
431
539
  self.class.attribute_map.each_pair do |attr, param|
432
- value = send(attr)
540
+ value = self.send(attr)
433
541
  if value.nil?
434
542
  is_nullable = self.class.openapi_nullable.include?(attr)
435
543
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))