docspring 4.3.0 → 4.5.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 (168) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +80 -0
  3. data/.openapi-generator/FILES +90 -0
  4. data/AGENTS.md +2 -0
  5. data/CHANGELOG.md +70 -0
  6. data/Gemfile.lock +10 -10
  7. data/LICENSE +1 -1
  8. data/README.md +23 -1
  9. data/docs/AddTemplateFieldsRequest.md +1 -1
  10. data/docs/Client.md +2313 -766
  11. data/docs/CombinedPdfSource.md +1 -1
  12. data/docs/CreateAccountEmailActionRequest.md +54 -0
  13. data/docs/CreateEmailActionRequest.md +50 -0
  14. data/docs/CreateEmailDomainRequest.md +18 -0
  15. data/docs/CreateSubmissionBatchRequest.md +2 -2
  16. data/docs/CreateSubmissionRequest.md +24 -6
  17. data/docs/CreateTemplateRequest.md +32 -8
  18. data/docs/DnsRecordType.md +15 -0
  19. data/docs/EmailAction.md +76 -0
  20. data/docs/EmailActionConditions.md +20 -0
  21. data/docs/EmailActionConditionsInput.md +20 -0
  22. data/docs/EmailActionCustomization.md +36 -0
  23. data/docs/EmailActionDelivery.md +15 -0
  24. data/docs/EmailActionFileFormats.md +15 -0
  25. data/docs/EmailActionList.md +20 -0
  26. data/docs/EmailActionSetting.md +15 -0
  27. data/docs/EmailActionSubmissionType.md +15 -0
  28. data/docs/EmailActionTestEmail.md +18 -0
  29. data/docs/EmailDomain.md +38 -0
  30. data/docs/EmailDomainDnsRecord.md +24 -0
  31. data/docs/EmailDomainDnsRecordPurpose.md +15 -0
  32. data/docs/EmailDomainList.md +20 -0
  33. data/docs/EmailDomainRecordState.md +15 -0
  34. data/docs/EmailDomainState.md +15 -0
  35. data/docs/ErrorInfo.md +16 -6
  36. data/docs/Field.md +1 -1
  37. data/docs/FieldInput.md +1 -1
  38. data/docs/HtmlEngineOptions.md +5 -5
  39. data/docs/HtmlEngineOptionsInput.md +5 -5
  40. data/docs/SendAccountEmailActionTestEmailRequest.md +18 -0
  41. data/docs/SignatureRequest.md +9 -1
  42. data/docs/SignatureRequestEmailAttachments.md +15 -0
  43. data/docs/SignatureRequestEmailStatus.md +15 -0
  44. data/docs/SignatureRequestInput.md +7 -3
  45. data/docs/SignatureRequestReminders.md +20 -0
  46. data/docs/SigningOrder.md +15 -0
  47. data/docs/Submission.md +4 -2
  48. data/docs/SubmissionAction.md +5 -3
  49. data/docs/SubmissionInput.md +4 -4
  50. data/docs/SubmissionSummary.md +1 -1
  51. data/docs/Template.md +32 -8
  52. data/docs/TemplateFormSection.md +24 -0
  53. data/docs/TemplateFormSectionInput.md +24 -0
  54. data/docs/TemplateSourcePdf.md +1 -1
  55. data/docs/TemplateSummary.md +4 -4
  56. data/docs/UpdateAccountEmailActionRequest.md +54 -0
  57. data/docs/UpdateEmailActionCustomizationRequest.md +46 -0
  58. data/docs/UpdateEmailActionRequest.md +50 -0
  59. data/docs/UpdateTemplateDocumentRequest.md +1 -1
  60. data/docs/UpdateTemplateRequest.md +30 -6
  61. data/docs/ValidateSubmissionRequest.md +24 -6
  62. data/lib/docspring/api/client.rb +1752 -314
  63. data/lib/docspring/api_client.rb +1 -1
  64. data/lib/docspring/models/add_template_fields_request.rb +1 -1
  65. data/lib/docspring/models/combined_pdf_source.rb +1 -1
  66. data/lib/docspring/models/create_account_email_action_request.rb +388 -0
  67. data/lib/docspring/models/create_email_action_request.rb +364 -0
  68. data/lib/docspring/models/create_email_domain_request.rb +185 -0
  69. data/lib/docspring/models/create_submission_batch_request.rb +2 -2
  70. data/lib/docspring/models/create_submission_request.rb +145 -9
  71. data/lib/docspring/models/create_template_request.rb +153 -11
  72. data/lib/docspring/models/dns_record_type.rb +42 -0
  73. data/lib/docspring/models/email_action.rb +790 -0
  74. data/lib/docspring/models/email_action_conditions.rb +219 -0
  75. data/lib/docspring/models/email_action_conditions_input.rb +219 -0
  76. data/lib/docspring/models/email_action_customization.rb +360 -0
  77. data/lib/docspring/models/email_action_delivery.rb +41 -0
  78. data/lib/docspring/models/email_action_file_formats.rb +43 -0
  79. data/lib/docspring/models/email_action_list.rb +200 -0
  80. data/lib/docspring/models/email_action_setting.rb +53 -0
  81. data/lib/docspring/models/email_action_submission_type.rb +42 -0
  82. data/lib/docspring/models/email_action_test_email.rb +185 -0
  83. data/lib/docspring/models/email_domain.rb +423 -0
  84. data/lib/docspring/models/email_domain_dns_record.rb +288 -0
  85. data/lib/docspring/models/email_domain_dns_record_purpose.rb +42 -0
  86. data/lib/docspring/models/email_domain_list.rb +200 -0
  87. data/lib/docspring/models/email_domain_record_state.rb +42 -0
  88. data/lib/docspring/models/email_domain_state.rb +42 -0
  89. data/lib/docspring/models/error_code.rb +3 -1
  90. data/lib/docspring/models/error_info.rb +59 -9
  91. data/lib/docspring/models/field.rb +1 -1
  92. data/lib/docspring/models/field_input.rb +1 -1
  93. data/lib/docspring/models/html_engine_options.rb +5 -5
  94. data/lib/docspring/models/html_engine_options_input.rb +5 -5
  95. data/lib/docspring/models/send_account_email_action_test_email_request.rb +168 -0
  96. data/lib/docspring/models/signature_request.rb +68 -2
  97. data/lib/docspring/models/signature_request_email_attachments.rb +41 -0
  98. data/lib/docspring/models/signature_request_email_status.rb +47 -0
  99. data/lib/docspring/models/signature_request_event_type.rb +3 -1
  100. data/lib/docspring/models/signature_request_input.rb +25 -22
  101. data/lib/docspring/models/signature_request_reminders.rb +212 -0
  102. data/lib/docspring/models/signing_order.rb +41 -0
  103. data/lib/docspring/models/string_condition_type.rb +8 -1
  104. data/lib/docspring/models/submission.rb +30 -3
  105. data/lib/docspring/models/submission_action.rb +18 -5
  106. data/lib/docspring/models/submission_input.rb +4 -4
  107. data/lib/docspring/models/submission_summary.rb +1 -1
  108. data/lib/docspring/models/template.rb +227 -9
  109. data/lib/docspring/models/template_form_section.rb +254 -0
  110. data/lib/docspring/models/template_form_section_input.rb +252 -0
  111. data/lib/docspring/models/template_source_pdf.rb +1 -1
  112. data/lib/docspring/models/template_summary.rb +4 -4
  113. data/lib/docspring/models/template_type.rb +2 -1
  114. data/lib/docspring/models/update_account_email_action_request.rb +388 -0
  115. data/lib/docspring/models/update_email_action_customization_request.rb +343 -0
  116. data/lib/docspring/models/update_email_action_request.rb +364 -0
  117. data/lib/docspring/models/update_template_document_request.rb +1 -1
  118. data/lib/docspring/models/update_template_request.rb +153 -9
  119. data/lib/docspring/models/validate_submission_request.rb +145 -9
  120. data/lib/docspring/models/webhook_event_type.rb +3 -1
  121. data/lib/docspring/request_schemas.json +1708 -88
  122. data/lib/docspring/request_validator.rb +4 -0
  123. data/lib/docspring/version.rb +1 -1
  124. data/lib/docspring.rb +30 -0
  125. data/spec/api/client_spec.rb +307 -18
  126. data/spec/models/create_account_email_action_request_spec.rb +144 -0
  127. data/spec/models/create_email_action_request_spec.rb +132 -0
  128. data/spec/models/create_email_domain_request_spec.rb +36 -0
  129. data/spec/models/create_submission_request_spec.rb +54 -0
  130. data/spec/models/create_template_request_spec.rb +72 -0
  131. data/spec/models/dns_record_type_spec.rb +30 -0
  132. data/spec/models/email_action_conditions_input_spec.rb +42 -0
  133. data/spec/models/email_action_conditions_spec.rb +42 -0
  134. data/spec/models/email_action_customization_spec.rb +90 -0
  135. data/spec/models/email_action_delivery_spec.rb +30 -0
  136. data/spec/models/email_action_file_formats_spec.rb +30 -0
  137. data/spec/models/email_action_list_spec.rb +42 -0
  138. data/spec/models/email_action_setting_spec.rb +30 -0
  139. data/spec/models/email_action_spec.rb +210 -0
  140. data/spec/models/email_action_submission_type_spec.rb +30 -0
  141. data/spec/models/email_action_test_email_spec.rb +36 -0
  142. data/spec/models/email_domain_dns_record_purpose_spec.rb +30 -0
  143. data/spec/models/email_domain_dns_record_spec.rb +54 -0
  144. data/spec/models/email_domain_list_spec.rb +42 -0
  145. data/spec/models/email_domain_record_state_spec.rb +30 -0
  146. data/spec/models/email_domain_spec.rb +96 -0
  147. data/spec/models/email_domain_state_spec.rb +30 -0
  148. data/spec/models/error_info_spec.rb +30 -0
  149. data/spec/models/send_account_email_action_test_email_request_spec.rb +36 -0
  150. data/spec/models/signature_request_email_attachments_spec.rb +30 -0
  151. data/spec/models/signature_request_email_status_spec.rb +30 -0
  152. data/spec/models/signature_request_input_spec.rb +12 -0
  153. data/spec/models/signature_request_reminders_spec.rb +42 -0
  154. data/spec/models/signature_request_spec.rb +24 -0
  155. data/spec/models/signing_order_spec.rb +30 -0
  156. data/spec/models/submission_action_spec.rb +6 -0
  157. data/spec/models/submission_spec.rb +6 -0
  158. data/spec/models/template_form_section_input_spec.rb +54 -0
  159. data/spec/models/template_form_section_spec.rb +54 -0
  160. data/spec/models/template_spec.rb +72 -0
  161. data/spec/models/update_account_email_action_request_spec.rb +144 -0
  162. data/spec/models/update_email_action_customization_request_spec.rb +120 -0
  163. data/spec/models/update_email_action_request_spec.rb +132 -0
  164. data/spec/models/update_template_request_spec.rb +72 -0
  165. data/spec/models/validate_submission_request_spec.rb +54 -0
  166. metadata +123 -4
  167. data/.gitlab-ci.yml +0 -26
  168. data/.travis.yml +0 -11
@@ -25,13 +25,13 @@ module DocSpring
25
25
  # Shown under the template's name at the top of its hosted forms, and used as their meta description. Not shown on embedded forms or signature requests.
26
26
  attr_accessor :description
27
27
 
28
- # `pdf`: fields placed on an uploaded PDF. `html`: a PDF rendered from HTML and SCSS. `docx`: a Word document with tags where the data goes, which makes Word documents or PDFs. It can't be changed after the template is created.
28
+ # `pdf`: fields placed on an uploaded PDF. `html`: a PDF rendered from HTML and SCSS. `docx`: a Word document with tags where the data goes, which makes Word documents or PDFs. `page_designer`: a page design, a PDF laid out in the Page Designer from its `layout`. It can't be changed after the template is created.
29
29
  attr_accessor :template_type
30
30
 
31
- # What each submission makes unless its request sets `output_formats`: `docx` (a Word document), `odt` (an OpenDocument file, converted from the Word document) or `pdf`. A Word template's is chosen when it's created; PDF and HTML templates always make PDFs. A Word template that encrypts its PDFs makes PDFs, because Word documents and OpenDocument files can't be password-protected.
31
+ # What each submission makes unless its request sets `output_formats`: `docx` (a Word document), `odt` (an OpenDocument file, converted from the Word document) or `pdf`. A Word template's is chosen when it's created; other templates always make PDFs. A Word template that encrypts its PDFs makes PDFs, because Word documents and OpenDocument files can't be password-protected.
32
32
  attr_accessor :output_format
33
33
 
34
- # Whether the template can make documents. HTML templates are always ready. A PDF template is ready once DocSpring has stored its PDF, made an image of each page and finished looking for fields on each page, which can be after `document.state` becomes `processed`. A PDF template with no PDF (`document` is null) isn't ready. A Word template is ready once it has a Word document (a `document_url`'s has been downloaded).
34
+ # Whether the template can make documents. HTML templates and page designs are always ready. A PDF template is ready once DocSpring has stored its PDF, made an image of each page and finished looking for fields on each page, which can be after `document.state` becomes `processed`. A PDF template with no PDF (`document` is null) isn't ready. A Word template is ready once it has a Word document (a `document_url`'s has been downloaded).
35
35
  attr_accessor :ready
36
36
 
37
37
  # The PDF of a PDF template, or the Word document of a Word template. Null for HTML templates, and for a PDF template that has no PDF yet. A template created from a `document_url` has one, with no file, while it's downloaded.
@@ -82,7 +82,7 @@ module DocSpring
82
82
  # Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it.
83
83
  attr_accessor :editable_submissions
84
84
 
85
- # The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and the simple form) aren't restricted.
85
+ # The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work), without a path. Each one is stored in lowercase, without a trailing slash. Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and Web Forms JS) aren't restricted.
86
86
  attr_accessor :embed_domains
87
87
 
88
88
  # Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on).
@@ -121,9 +121,39 @@ module DocSpring
121
121
  # Allow anyone to fill in the template's web form.
122
122
  attr_accessor :public_web_form
123
123
 
124
- # Where the web form sends people after they submit it.
124
+ # Where the web form sends people after they submit it, instead of showing its success screen. After its `?` or `#`, it can have variables such as `{{ data.first_name }}`, which the form fills in with what they submitted.
125
125
  attr_accessor :redirect_url
126
126
 
127
+ # How DocSpring's completed emails send the signed PDF to your signers and CCs: `attachment` (attached, or a download link when it's too big to attach) or `link` (a download link). Null uses your account's rule: a link if your account has signed a BAA, otherwise attached. PDF templates only. A signature request uses the value it had when the request was created.
128
+ attr_accessor :signature_request_email_attachments
129
+
130
+ # The address DocSpring's emails to your signers come from: an address at one of your verified email domains, on the Growth plan or higher. Null sends them from DocSpring's shared address, with "via DocSpring" after the sender name. PDF templates only.
131
+ attr_accessor :signature_request_from_address
132
+
133
+ # Puts a signing token in `signature_request_signing_url`, as `{{ token_id }}` and `{{ token_secret }}`, so your page can open the signing form without creating a token itself. The email then carries a credential: anyone who has it can open the form and sign. PDF templates only.
134
+ attr_accessor :signature_request_include_signing_token
135
+
136
+ # The sender name on the emails DocSpring sends your signers, as in "Acme via DocSpring". It can't contain an email address, a website or quotes. Null uses your account's name. PDF templates only.
137
+ attr_accessor :signature_request_from_name
138
+
139
+ # Who DocSpring tells when a signature request's document is completed or declined, or an email bounces or can't be sent: members of your DocSpring team or addresses at your verified email domains. Empty means your account's owner. A submission's `notification_emails` replaces them. PDF templates only.
140
+ attr_accessor :signature_request_notification_emails
141
+
142
+ # Where your signers' replies to DocSpring's emails go: a member of your DocSpring team or an address at one of your verified email domains. Null means your account's owner. A submission's `reply_to` replaces it. PDF templates only.
143
+ attr_accessor :signature_request_reply_to
144
+
145
+ # A page on your own site that the button in DocSpring's email to a signer opens, instead of DocSpring's signing page: an https URL on one of your verified email domains or a subdomain of one, on the Growth plan or higher. It must include `{{ signature_request_id }}`. Your page authenticates the signer, creates a token for the signature request, and opens the signing form with it. Null links to DocSpring's signing page. PDF templates only.
146
+ attr_accessor :signature_request_signing_url
147
+
148
+ # The title of the web form's success screen. When it's null or empty, the screen says "Thanks for filling out" and the template's name. It can have variables such as `{{ data.first_name }}`.
149
+ attr_accessor :success_title
150
+
151
+ # A message under the title of the web form's success screen, as plain text. Line breaks show, and web addresses become links. It can have variables such as `{{ data.first_name }}`.
152
+ attr_accessor :success_message
153
+
154
+ # Whether the web form's success screen has a "Fill out again" button, which clears the form so someone can fill it in again.
155
+ attr_accessor :show_fill_again_button
156
+
127
157
  # Whether `slack_webhook_url` is set.
128
158
  attr_accessor :has_slack_webhook_url
129
159
 
@@ -138,13 +168,16 @@ module DocSpring
138
168
  # The groups of the template's fields, with their settings. A field's name puts it in groups: `address/city` is in the group `address`, and `items/0/price` is in the list `items` and its items' group `items/~`.
139
169
  attr_accessor :field_groups
140
170
 
171
+ # The web form's sections, in order: Web Forms JS and the hosted web form show one section at a time. Empty when the template has none, and the web form shows all of its fields together, in the order the fields endpoint lists them. A field that no section lists (one added later) goes after the field before it in that order, in that field's section.
172
+ attr_accessor :form_sections
173
+
141
174
  # The field names that people using the embedded template editor choose from, each with the data type and settings a field gets when it's given that name. Setting it replaces the whole list; an empty list turns them off.
142
175
  attr_accessor :predefined_fields
143
176
 
144
177
  # Sample submission data that sets `predefined_fields`: each value becomes a predefined field, with a type that fits it (`string`, `number`, `boolean`, `date`, `email` or `url`) and `required_in_template` true. Nested objects and arrays become names with `/`, such as `customer/email`. Without `predefined_fields` in the same request, it replaces them; with them, it adds to them and sets the types of the ones it has values for.
145
178
  attr_accessor :predefined_fields_sample_data
146
179
 
147
- # The HTML of an HTML template, as a Liquid template. Null for PDF and Word templates.
180
+ # The HTML of an HTML template, as a Liquid template. Null for other templates.
148
181
  attr_accessor :html
149
182
 
150
183
  # The SCSS of an HTML template.
@@ -156,12 +189,15 @@ module DocSpring
156
189
  # The HTML printed at the bottom of each page of an HTML template.
157
190
  attr_accessor :footer_html
158
191
 
159
- # How an HTML template's PDFs are printed. Null for PDF and Word templates. Setting it replaces the whole object: options left out use their defaults.
192
+ # How an HTML template's PDFs are printed. Null for other templates. Setting it replaces the whole object: options left out use their defaults.
160
193
  attr_accessor :html_engine_options
161
194
 
162
- # Whether an HTML template HTML-escapes the values it prints. When true, `{{ value }}` prints a value as text, so a `<` or `&` in it is printed as that character, and `{{ value | raw }}` prints a value as HTML. New HTML templates default to true. Templates created before October 2026, or with API v1, default to false, which prints every value as HTML. Null for PDF templates.
195
+ # Whether an HTML template HTML-escapes the values it prints. When true, `{{ value }}` prints a value as text, so a `<` or `&` in it is printed as that character, and `{{ value | raw }}` prints a value as HTML. New HTML templates default to true. Templates created before October 2026, or with API v1, default to false, which prints every value as HTML. Null for other templates.
163
196
  attr_accessor :html_escape_data
164
197
 
198
+ # A page design's layout: its page setup, its sections and the elements placed in them, in the Page Designer layout format (https://docspring.com/docs/page-designer/layout-format/). Its JSON Schema is at https://docspring.com/schemas/page-designer/layout.v1.json. Null for other templates. Setting it replaces the whole layout, and DocSpring adds a field for each value it reads. Left out when a page design is created, it starts with an empty page.
199
+ attr_accessor :layout
200
+
165
201
  # The token that opens the template in the embedded template editor.
166
202
  attr_accessor :embed_edit_token
167
203
 
@@ -229,11 +265,22 @@ module DocSpring
229
265
  :'public_submissions' => :'public_submissions',
230
266
  :'public_web_form' => :'public_web_form',
231
267
  :'redirect_url' => :'redirect_url',
268
+ :'signature_request_email_attachments' => :'signature_request_email_attachments',
269
+ :'signature_request_from_address' => :'signature_request_from_address',
270
+ :'signature_request_include_signing_token' => :'signature_request_include_signing_token',
271
+ :'signature_request_from_name' => :'signature_request_from_name',
272
+ :'signature_request_notification_emails' => :'signature_request_notification_emails',
273
+ :'signature_request_reply_to' => :'signature_request_reply_to',
274
+ :'signature_request_signing_url' => :'signature_request_signing_url',
275
+ :'success_title' => :'success_title',
276
+ :'success_message' => :'success_message',
277
+ :'show_fill_again_button' => :'show_fill_again_button',
232
278
  :'has_slack_webhook_url' => :'has_slack_webhook_url',
233
279
  :'last_changed_by' => :'last_changed_by',
234
280
  :'defaults' => :'defaults',
235
281
  :'field_dependencies' => :'field_dependencies',
236
282
  :'field_groups' => :'field_groups',
283
+ :'form_sections' => :'form_sections',
237
284
  :'predefined_fields' => :'predefined_fields',
238
285
  :'predefined_fields_sample_data' => :'predefined_fields_sample_data',
239
286
  :'html' => :'html',
@@ -242,6 +289,7 @@ module DocSpring
242
289
  :'footer_html' => :'footer_html',
243
290
  :'html_engine_options' => :'html_engine_options',
244
291
  :'html_escape_data' => :'html_escape_data',
292
+ :'layout' => :'layout',
245
293
  :'embed_edit_token' => :'embed_edit_token',
246
294
  :'versions' => :'versions'
247
295
  }
@@ -296,11 +344,22 @@ module DocSpring
296
344
  :'public_submissions' => :'Boolean',
297
345
  :'public_web_form' => :'Boolean',
298
346
  :'redirect_url' => :'String',
347
+ :'signature_request_email_attachments' => :'SignatureRequestEmailAttachments',
348
+ :'signature_request_from_address' => :'String',
349
+ :'signature_request_include_signing_token' => :'Boolean',
350
+ :'signature_request_from_name' => :'String',
351
+ :'signature_request_notification_emails' => :'Array<String>',
352
+ :'signature_request_reply_to' => :'String',
353
+ :'signature_request_signing_url' => :'String',
354
+ :'success_title' => :'String',
355
+ :'success_message' => :'String',
356
+ :'show_fill_again_button' => :'Boolean',
299
357
  :'has_slack_webhook_url' => :'Boolean',
300
358
  :'last_changed_by' => :'TemplateActor',
301
359
  :'defaults' => :'TemplateDefaults',
302
360
  :'field_dependencies' => :'Array<TemplateFieldDependency>',
303
361
  :'field_groups' => :'Array<FieldGroup>',
362
+ :'form_sections' => :'Array<TemplateFormSection>',
304
363
  :'predefined_fields' => :'Array<PredefinedField>',
305
364
  :'predefined_fields_sample_data' => :'Hash<String, Object>',
306
365
  :'html' => :'String',
@@ -309,6 +368,7 @@ module DocSpring
309
368
  :'footer_html' => :'String',
310
369
  :'html_engine_options' => :'HtmlEngineOptions',
311
370
  :'html_escape_data' => :'Boolean',
371
+ :'layout' => :'Hash<String, Object>',
312
372
  :'embed_edit_token' => :'String',
313
373
  :'versions' => :'Array<TemplateVersion>'
314
374
  }
@@ -327,6 +387,13 @@ module DocSpring
327
387
  :'version',
328
388
  :'ai_field_naming_language',
329
389
  :'redirect_url',
390
+ :'signature_request_email_attachments',
391
+ :'signature_request_from_address',
392
+ :'signature_request_from_name',
393
+ :'signature_request_reply_to',
394
+ :'signature_request_signing_url',
395
+ :'success_title',
396
+ :'success_message',
330
397
  :'last_changed_by',
331
398
  :'predefined_fields_sample_data',
332
399
  :'html',
@@ -335,6 +402,7 @@ module DocSpring
335
402
  :'footer_html',
336
403
  :'html_engine_options',
337
404
  :'html_escape_data',
405
+ :'layout',
338
406
  :'embed_edit_token',
339
407
  ])
340
408
  end
@@ -583,6 +651,68 @@ module DocSpring
583
651
  self.redirect_url = nil
584
652
  end
585
653
 
654
+ if attributes.key?(:'signature_request_email_attachments')
655
+ self.signature_request_email_attachments = attributes[:'signature_request_email_attachments']
656
+ else
657
+ self.signature_request_email_attachments = nil
658
+ end
659
+
660
+ if attributes.key?(:'signature_request_from_address')
661
+ self.signature_request_from_address = attributes[:'signature_request_from_address']
662
+ else
663
+ self.signature_request_from_address = nil
664
+ end
665
+
666
+ if attributes.key?(:'signature_request_include_signing_token')
667
+ self.signature_request_include_signing_token = attributes[:'signature_request_include_signing_token']
668
+ else
669
+ self.signature_request_include_signing_token = nil
670
+ end
671
+
672
+ if attributes.key?(:'signature_request_from_name')
673
+ self.signature_request_from_name = attributes[:'signature_request_from_name']
674
+ else
675
+ self.signature_request_from_name = nil
676
+ end
677
+
678
+ if attributes.key?(:'signature_request_notification_emails')
679
+ if (value = attributes[:'signature_request_notification_emails']).is_a?(Array)
680
+ self.signature_request_notification_emails = value
681
+ end
682
+ else
683
+ self.signature_request_notification_emails = nil
684
+ end
685
+
686
+ if attributes.key?(:'signature_request_reply_to')
687
+ self.signature_request_reply_to = attributes[:'signature_request_reply_to']
688
+ else
689
+ self.signature_request_reply_to = nil
690
+ end
691
+
692
+ if attributes.key?(:'signature_request_signing_url')
693
+ self.signature_request_signing_url = attributes[:'signature_request_signing_url']
694
+ else
695
+ self.signature_request_signing_url = nil
696
+ end
697
+
698
+ if attributes.key?(:'success_title')
699
+ self.success_title = attributes[:'success_title']
700
+ else
701
+ self.success_title = nil
702
+ end
703
+
704
+ if attributes.key?(:'success_message')
705
+ self.success_message = attributes[:'success_message']
706
+ else
707
+ self.success_message = nil
708
+ end
709
+
710
+ if attributes.key?(:'show_fill_again_button')
711
+ self.show_fill_again_button = attributes[:'show_fill_again_button']
712
+ else
713
+ self.show_fill_again_button = nil
714
+ end
715
+
586
716
  if attributes.key?(:'has_slack_webhook_url')
587
717
  self.has_slack_webhook_url = attributes[:'has_slack_webhook_url']
588
718
  else
@@ -617,6 +747,14 @@ module DocSpring
617
747
  self.field_groups = nil
618
748
  end
619
749
 
750
+ if attributes.key?(:'form_sections')
751
+ if (value = attributes[:'form_sections']).is_a?(Array)
752
+ self.form_sections = value
753
+ end
754
+ else
755
+ self.form_sections = nil
756
+ end
757
+
620
758
  if attributes.key?(:'predefined_fields')
621
759
  if (value = attributes[:'predefined_fields']).is_a?(Array)
622
760
  self.predefined_fields = value
@@ -669,6 +807,14 @@ module DocSpring
669
807
  self.html_escape_data = nil
670
808
  end
671
809
 
810
+ if attributes.key?(:'layout')
811
+ if (value = attributes[:'layout']).is_a?(Hash) || value.nil?
812
+ self.layout = value
813
+ end
814
+ else
815
+ self.layout = nil
816
+ end
817
+
672
818
  if attributes.key?(:'embed_edit_token')
673
819
  self.embed_edit_token = attributes[:'embed_edit_token']
674
820
  else
@@ -793,6 +939,18 @@ module DocSpring
793
939
  invalid_properties.push('invalid value for "public_web_form", public_web_form cannot be nil.')
794
940
  end
795
941
 
942
+ if @signature_request_include_signing_token.nil?
943
+ invalid_properties.push('invalid value for "signature_request_include_signing_token", signature_request_include_signing_token cannot be nil.')
944
+ end
945
+
946
+ if @signature_request_notification_emails.nil?
947
+ invalid_properties.push('invalid value for "signature_request_notification_emails", signature_request_notification_emails cannot be nil.')
948
+ end
949
+
950
+ if @show_fill_again_button.nil?
951
+ invalid_properties.push('invalid value for "show_fill_again_button", show_fill_again_button cannot be nil.')
952
+ end
953
+
796
954
  if @has_slack_webhook_url.nil?
797
955
  invalid_properties.push('invalid value for "has_slack_webhook_url", has_slack_webhook_url cannot be nil.')
798
956
  end
@@ -809,6 +967,10 @@ module DocSpring
809
967
  invalid_properties.push('invalid value for "field_groups", field_groups cannot be nil.')
810
968
  end
811
969
 
970
+ if @form_sections.nil?
971
+ invalid_properties.push('invalid value for "form_sections", form_sections cannot be nil.')
972
+ end
973
+
812
974
  if @predefined_fields.nil?
813
975
  invalid_properties.push('invalid value for "predefined_fields", predefined_fields cannot be nil.')
814
976
  end
@@ -850,10 +1012,14 @@ module DocSpring
850
1012
  return false if @parse_dates_using_template_date_format.nil?
851
1013
  return false if @public_submissions.nil?
852
1014
  return false if @public_web_form.nil?
1015
+ return false if @signature_request_include_signing_token.nil?
1016
+ return false if @signature_request_notification_emails.nil?
1017
+ return false if @show_fill_again_button.nil?
853
1018
  return false if @has_slack_webhook_url.nil?
854
1019
  return false if @defaults.nil?
855
1020
  return false if @field_dependencies.nil?
856
1021
  return false if @field_groups.nil?
1022
+ return false if @form_sections.nil?
857
1023
  return false if @predefined_fields.nil?
858
1024
  return false if @versions.nil?
859
1025
  true
@@ -1119,6 +1285,36 @@ module DocSpring
1119
1285
  @public_web_form = public_web_form
1120
1286
  end
1121
1287
 
1288
+ # Custom attribute writer method with validation
1289
+ # @param [Object] signature_request_include_signing_token Value to be assigned
1290
+ def signature_request_include_signing_token=(signature_request_include_signing_token)
1291
+ if signature_request_include_signing_token.nil?
1292
+ fail ArgumentError, 'signature_request_include_signing_token cannot be nil'
1293
+ end
1294
+
1295
+ @signature_request_include_signing_token = signature_request_include_signing_token
1296
+ end
1297
+
1298
+ # Custom attribute writer method with validation
1299
+ # @param [Object] signature_request_notification_emails Value to be assigned
1300
+ def signature_request_notification_emails=(signature_request_notification_emails)
1301
+ if signature_request_notification_emails.nil?
1302
+ fail ArgumentError, 'signature_request_notification_emails cannot be nil'
1303
+ end
1304
+
1305
+ @signature_request_notification_emails = signature_request_notification_emails
1306
+ end
1307
+
1308
+ # Custom attribute writer method with validation
1309
+ # @param [Object] show_fill_again_button Value to be assigned
1310
+ def show_fill_again_button=(show_fill_again_button)
1311
+ if show_fill_again_button.nil?
1312
+ fail ArgumentError, 'show_fill_again_button cannot be nil'
1313
+ end
1314
+
1315
+ @show_fill_again_button = show_fill_again_button
1316
+ end
1317
+
1122
1318
  # Custom attribute writer method with validation
1123
1319
  # @param [Object] has_slack_webhook_url Value to be assigned
1124
1320
  def has_slack_webhook_url=(has_slack_webhook_url)
@@ -1159,6 +1355,16 @@ module DocSpring
1159
1355
  @field_groups = field_groups
1160
1356
  end
1161
1357
 
1358
+ # Custom attribute writer method with validation
1359
+ # @param [Object] form_sections Value to be assigned
1360
+ def form_sections=(form_sections)
1361
+ if form_sections.nil?
1362
+ fail ArgumentError, 'form_sections cannot be nil'
1363
+ end
1364
+
1365
+ @form_sections = form_sections
1366
+ end
1367
+
1162
1368
  # Custom attribute writer method with validation
1163
1369
  # @param [Object] predefined_fields Value to be assigned
1164
1370
  def predefined_fields=(predefined_fields)
@@ -1220,11 +1426,22 @@ module DocSpring
1220
1426
  public_submissions == o.public_submissions &&
1221
1427
  public_web_form == o.public_web_form &&
1222
1428
  redirect_url == o.redirect_url &&
1429
+ signature_request_email_attachments == o.signature_request_email_attachments &&
1430
+ signature_request_from_address == o.signature_request_from_address &&
1431
+ signature_request_include_signing_token == o.signature_request_include_signing_token &&
1432
+ signature_request_from_name == o.signature_request_from_name &&
1433
+ signature_request_notification_emails == o.signature_request_notification_emails &&
1434
+ signature_request_reply_to == o.signature_request_reply_to &&
1435
+ signature_request_signing_url == o.signature_request_signing_url &&
1436
+ success_title == o.success_title &&
1437
+ success_message == o.success_message &&
1438
+ show_fill_again_button == o.show_fill_again_button &&
1223
1439
  has_slack_webhook_url == o.has_slack_webhook_url &&
1224
1440
  last_changed_by == o.last_changed_by &&
1225
1441
  defaults == o.defaults &&
1226
1442
  field_dependencies == o.field_dependencies &&
1227
1443
  field_groups == o.field_groups &&
1444
+ form_sections == o.form_sections &&
1228
1445
  predefined_fields == o.predefined_fields &&
1229
1446
  predefined_fields_sample_data == o.predefined_fields_sample_data &&
1230
1447
  html == o.html &&
@@ -1233,6 +1450,7 @@ module DocSpring
1233
1450
  footer_html == o.footer_html &&
1234
1451
  html_engine_options == o.html_engine_options &&
1235
1452
  html_escape_data == o.html_escape_data &&
1453
+ layout == o.layout &&
1236
1454
  embed_edit_token == o.embed_edit_token &&
1237
1455
  versions == o.versions
1238
1456
  end
@@ -1246,7 +1464,7 @@ module DocSpring
1246
1464
  # Calculates hash code according to all attributes.
1247
1465
  # @return [Integer] Hash code
1248
1466
  def hash
1249
- [id, name, description, template_type, output_format, ready, document, parent_folder_id, path, latest_version, version_published_at, locked, last_changed_at, created_at, updated_at, version, add_signature_request_submission_id_footers, ai_field_naming_language, allow_additional_properties, allow_skipping_optional_fields, default_form_mode, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs, has_encrypt_pdfs_password, expire_submissions, expire_after, expiration_interval, merge_audit_trail_pdf, parse_dates_using_template_date_format, public_submissions, public_web_form, redirect_url, has_slack_webhook_url, last_changed_by, defaults, field_dependencies, field_groups, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, embed_edit_token, versions].hash
1467
+ [id, name, description, template_type, output_format, ready, document, parent_folder_id, path, latest_version, version_published_at, locked, last_changed_at, created_at, updated_at, version, add_signature_request_submission_id_footers, ai_field_naming_language, allow_additional_properties, allow_skipping_optional_fields, default_form_mode, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs, has_encrypt_pdfs_password, expire_submissions, expire_after, expiration_interval, merge_audit_trail_pdf, parse_dates_using_template_date_format, public_submissions, public_web_form, redirect_url, signature_request_email_attachments, signature_request_from_address, signature_request_include_signing_token, signature_request_from_name, signature_request_notification_emails, signature_request_reply_to, signature_request_signing_url, success_title, success_message, show_fill_again_button, has_slack_webhook_url, last_changed_by, defaults, field_dependencies, field_groups, form_sections, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, layout, embed_edit_token, versions].hash
1250
1468
  end
1251
1469
 
1252
1470
  # Builds the object from hash
@@ -0,0 +1,254 @@
1
+ =begin
2
+ #DocSpring API
3
+
4
+ #Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
5
+
6
+ The version of the OpenAPI document: v2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0-DOCSPRING
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DocSpring
17
+ # A section of the template's web form, with its fields in order.
18
+ class TemplateFormSection < ApiModelBase
19
+ # The section's ID, unique among the template's sections. Any string you choose.
20
+ attr_accessor :id
21
+
22
+ # The section's heading on the web form.
23
+ attr_accessor :title
24
+
25
+ # Text shown under the section's heading. Null for none.
26
+ attr_accessor :description
27
+
28
+ # The IDs of the section's fields (Field's `id`), in the order the web form shows them. A field can be in one section only.
29
+ attr_accessor :field_ids
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'id' => :'id',
35
+ :'title' => :'title',
36
+ :'description' => :'description',
37
+ :'field_ids' => :'field_ids'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'id' => :'String',
55
+ :'title' => :'String',
56
+ :'description' => :'String',
57
+ :'field_ids' => :'Array<Integer>'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'description',
65
+ ])
66
+ end
67
+
68
+ # Returns attribute type mapping
69
+ def self.acceptable_openapi_types
70
+ openapi_types
71
+ end
72
+
73
+ # Returns the nullable attributes
74
+ def self.acceptable_openapi_nullable
75
+ openapi_nullable
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::TemplateFormSection` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::TemplateFormSection`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'id')
95
+ self.id = attributes[:'id']
96
+ else
97
+ self.id = nil
98
+ end
99
+
100
+ if attributes.key?(:'title')
101
+ self.title = attributes[:'title']
102
+ else
103
+ self.title = nil
104
+ end
105
+
106
+ if attributes.key?(:'description')
107
+ self.description = attributes[:'description']
108
+ else
109
+ self.description = nil
110
+ end
111
+
112
+ if attributes.key?(:'field_ids')
113
+ if (value = attributes[:'field_ids']).is_a?(Array)
114
+ self.field_ids = value
115
+ end
116
+ else
117
+ self.field_ids = nil
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
125
+ invalid_properties = Array.new
126
+ if @id.nil?
127
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
128
+ end
129
+
130
+ if @title.nil?
131
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
132
+ end
133
+
134
+ if @field_ids.nil?
135
+ invalid_properties.push('invalid value for "field_ids", field_ids cannot be nil.')
136
+ end
137
+
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ warn '[DEPRECATED] the `valid?` method is obsolete'
145
+ return false if @id.nil?
146
+ return false if @title.nil?
147
+ return false if @field_ids.nil?
148
+ true
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] id Value to be assigned
153
+ def id=(id)
154
+ if id.nil?
155
+ fail ArgumentError, 'id cannot be nil'
156
+ end
157
+
158
+ @id = id
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] title Value to be assigned
163
+ def title=(title)
164
+ if title.nil?
165
+ fail ArgumentError, 'title cannot be nil'
166
+ end
167
+
168
+ @title = title
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] field_ids Value to be assigned
173
+ def field_ids=(field_ids)
174
+ if field_ids.nil?
175
+ fail ArgumentError, 'field_ids cannot be nil'
176
+ end
177
+
178
+ @field_ids = field_ids
179
+ end
180
+
181
+ # Checks equality by comparing each attribute.
182
+ # @param [Object] Object to be compared
183
+ def ==(o)
184
+ return true if self.equal?(o)
185
+ self.class == o.class &&
186
+ id == o.id &&
187
+ title == o.title &&
188
+ description == o.description &&
189
+ field_ids == o.field_ids
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
+ [id, title, description, field_ids].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
+ # include attributes inherited from allOf parents (the nearest declaration wins)
211
+ map = acceptable_attribute_map
212
+ transformed_hash = {}
213
+ acceptable_openapi_types.each_pair do |key, type|
214
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
215
+ transformed_hash["#{key}"] = nil
216
+ elsif type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[map[key]].is_a?(Array)
220
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
221
+ end
222
+ elsif !attributes[map[key]].nil?
223
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
224
+ end
225
+ end
226
+ # Responses can include enum values added after this client was released, so the enum setters
227
+ # accept any value while the model is built from a response
228
+ allocate.tap do |model|
229
+ model.instance_variable_set(:@_skip_enum_validation, true)
230
+ model.send(:initialize, transformed_hash)
231
+ model.remove_instance_variable(:@_skip_enum_validation)
232
+ end
233
+ end
234
+
235
+ # Returns the object in the form of hash
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_hash
238
+ hash = {}
239
+ # include attributes inherited from allOf parents (the nearest declaration wins)
240
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ end
253
+
254
+ end