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
@@ -16,13 +16,13 @@ require 'time'
16
16
  module DocSpring
17
17
  # The submission's data and settings.
18
18
  class CreateSubmissionRequest < ApiModelBase
19
- # Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions.
19
+ # Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions, and the demo API token's are always live.
20
20
  attr_accessor :test
21
21
 
22
22
  # `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`.
23
23
  attr_accessor :editable
24
24
 
25
- # The values of the template's fields, by field name. Required for PDF and Word templates, unless `signature_requests` collects them (PDF templates only).
25
+ # The values of the template's fields, by field name. Required for PDF templates, Word templates and page designs, unless `signature_requests` collects them (PDF templates only). Signatures come only from signature requests: a value for a signature or initials field makes the submission `invalid_data`, in test mode too. To print an image or a name you send, use an Image or Text field.
26
26
  attr_accessor :data
27
27
 
28
28
  # Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`).
@@ -34,10 +34,10 @@ module DocSpring
34
34
  # What the submission makes: `pdf`, `docx` (a Word document, from a Word template), `odt` (an OpenDocument file, the format LibreOffice uses, converted from a Word template's Word document), and `png` (an image of each page of the PDF, up to 100 pages, which adds `pdf`) when you ask for it. Default `["pdf"]`, or a Word template's `output_format`. POST /submissions/{submission_id}/generate_files adds `png`, and a Word template's submission's `pdf`, `docx` or `odt`, to a processed submission.
35
35
  attr_accessor :output_formats
36
36
 
37
- # Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours.
37
+ # Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours. The demo API token's submissions expire within an hour: up to 3600, and that's their default.
38
38
  attr_accessor :expires_in
39
39
 
40
- # Changes to field settings for this submission only, by field name, such as `{"name": {"required": false, "font_size": 9}}`. A setting that identifies the field (`id`, `name`, `type`), that only the template sets (such as `description`), or that doesn't apply to the field's type and display type (such as `check_character` on a field displayed as text) is a 422. With `signature_requests`, `editable: true` is a 422, and a `default` for a signature or initials field makes the submission `invalid_data`.
40
+ # Changes to field settings for this submission only, by field name, such as `{"name": {"required": false, "font_size": 9}}`. A setting that identifies the field (`id`, `name`, `type`), that only the template sets (such as `description`), or that doesn't apply to the field's type and display type (such as `check_character` on a field displayed as text) is a 422. A `default` for a signature or initials field makes the submission `invalid_data`. With `signature_requests`, `editable: true` is a 422.
41
41
  attr_accessor :field_overrides
42
42
 
43
43
  # For an HTML template, HTML to use instead of the template's.
@@ -46,9 +46,58 @@ module DocSpring
46
46
  # For an HTML template, SCSS (plain CSS works too) added after the template's styles, on the page and in its header and footer. It doesn't replace them: its rules come later, so they win over the template's rules of the same specificity.
47
47
  attr_accessor :css
48
48
 
49
- # The people who sign the PDF, and fill in their fields first. The PDF is generated once every signature request is completed. PDF templates only. Without `role`s, the first signature request is `Signer 1`, the second `Signer 2`, and so on. To leave a signer out, give every signature request its `role` and leave that one's out. Only the signers sign: a value for a signature or initials field in `data` makes the submission `invalid_data`.
49
+ # The people who sign the PDF, and fill in their fields first. The PDF is generated once every signature request is completed. PDF templates only. Without `role`s, the first signature request is `Signer 1`, the second `Signer 2`, and so on. To leave a signer out, give every signature request its `role` and leave that one's out.
50
50
  attr_accessor :signature_requests
51
51
 
52
+ # Whether DocSpring emails the signers their signing links, and sends the reminders and the completed document. Default true. Each signature request's own `send_email` overrides it. A test submission only emails your DocSpring team: every other address is a 422. `true` needs `signature_requests`. DocSpring doesn't email the signers of a form library template: leave `send_email` out, and send them their links yourself.
53
+ attr_accessor :send_email
54
+
55
+ # `parallel` (the default): everyone can sign at once. `sequential`: people sign one step at a time (`signing_step`), and DocSpring emails each step when the one before it is done. Needs `signature_requests`.
56
+ attr_accessor :signing_order
57
+
58
+ # The subject of the emails that ask people to sign. You can use `{{ signer.name }}`, `{{ signer.email }}`, `{{ document.name }}`, `{{ sender.name }}` and `{{ account.name }}`. Default "<sender> sent you <document> to sign" when you leave it out (a blank subject is a 422). Links and web addresses are shown as plain text (`example[.]com`).
59
+ attr_accessor :email_subject
60
+
61
+ # A message for the people who sign, shown above the signing button. It takes the same variables as `email_subject`. Links and web addresses are shown as plain text. Leave it out for none: a blank message is a 422.
62
+ attr_accessor :email_message
63
+
64
+ # People who get a copy of the completed document. They don't sign.
65
+ attr_accessor :cc
66
+
67
+ # Where replies to the emails go: a member of your DocSpring team, or an address at one of your verified email domains. Leave it out for the template's reply-to address (the account owner when it has none).
68
+ attr_accessor :reply_to
69
+
70
+ # Who DocSpring tells when the 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. Leave it out for the template's notification addresses (the account owner when it has none); an empty list means the account owner.
71
+ attr_accessor :notification_emails
72
+
73
+ # Also email `notification_emails` each time someone signs. Default false.
74
+ attr_accessor :notify_when_signed
75
+
76
+ # Remind people who haven't signed: every `interval_days` days, up to `max_count` times. Each reminder has a new signing link. Without it, DocSpring sends no reminders.
77
+ attr_accessor :reminders
78
+
79
+ class EnumAttributeValidator
80
+ attr_reader :datatype
81
+ attr_reader :allowable_values
82
+
83
+ def initialize(datatype, allowable_values)
84
+ @allowable_values = allowable_values.map do |value|
85
+ case datatype.to_s
86
+ when /Integer/i
87
+ value.to_i
88
+ when /Float/i
89
+ value.to_f
90
+ else
91
+ value
92
+ end
93
+ end
94
+ end
95
+
96
+ def valid?(value)
97
+ !value || allowable_values.include?(value)
98
+ end
99
+ end
100
+
52
101
  # Attribute mapping from ruby-style variable name to JSON key.
53
102
  def self.attribute_map
54
103
  {
@@ -62,7 +111,16 @@ module DocSpring
62
111
  :'field_overrides' => :'field_overrides',
63
112
  :'html' => :'html',
64
113
  :'css' => :'css',
65
- :'signature_requests' => :'signature_requests'
114
+ :'signature_requests' => :'signature_requests',
115
+ :'send_email' => :'send_email',
116
+ :'signing_order' => :'signing_order',
117
+ :'email_subject' => :'email_subject',
118
+ :'email_message' => :'email_message',
119
+ :'cc' => :'cc',
120
+ :'reply_to' => :'reply_to',
121
+ :'notification_emails' => :'notification_emails',
122
+ :'notify_when_signed' => :'notify_when_signed',
123
+ :'reminders' => :'reminders'
66
124
  }
67
125
  end
68
126
 
@@ -89,7 +147,16 @@ module DocSpring
89
147
  :'field_overrides' => :'Hash<String, FieldOverride>',
90
148
  :'html' => :'String',
91
149
  :'css' => :'String',
92
- :'signature_requests' => :'Array<SignatureRequestInput>'
150
+ :'signature_requests' => :'Array<SignatureRequestInput>',
151
+ :'send_email' => :'Boolean',
152
+ :'signing_order' => :'SigningOrder',
153
+ :'email_subject' => :'String',
154
+ :'email_message' => :'String',
155
+ :'cc' => :'Array<String>',
156
+ :'reply_to' => :'String',
157
+ :'notification_emails' => :'Array<String>',
158
+ :'notify_when_signed' => :'Boolean',
159
+ :'reminders' => :'SignatureRequestReminders'
93
160
  }
94
161
  end
95
162
 
@@ -178,6 +245,46 @@ module DocSpring
178
245
  self.signature_requests = value
179
246
  end
180
247
  end
248
+
249
+ if attributes.key?(:'send_email')
250
+ self.send_email = attributes[:'send_email']
251
+ end
252
+
253
+ if attributes.key?(:'signing_order')
254
+ self.signing_order = attributes[:'signing_order']
255
+ end
256
+
257
+ if attributes.key?(:'email_subject')
258
+ self.email_subject = attributes[:'email_subject']
259
+ end
260
+
261
+ if attributes.key?(:'email_message')
262
+ self.email_message = attributes[:'email_message']
263
+ end
264
+
265
+ if attributes.key?(:'cc')
266
+ if (value = attributes[:'cc']).is_a?(Array)
267
+ self.cc = value
268
+ end
269
+ end
270
+
271
+ if attributes.key?(:'reply_to')
272
+ self.reply_to = attributes[:'reply_to']
273
+ end
274
+
275
+ if attributes.key?(:'notification_emails')
276
+ if (value = attributes[:'notification_emails']).is_a?(Array)
277
+ self.notification_emails = value
278
+ end
279
+ end
280
+
281
+ if attributes.key?(:'notify_when_signed')
282
+ self.notify_when_signed = attributes[:'notify_when_signed']
283
+ end
284
+
285
+ if attributes.key?(:'reminders')
286
+ self.reminders = attributes[:'reminders']
287
+ end
181
288
  end
182
289
 
183
290
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -205,6 +312,26 @@ module DocSpring
205
312
  @output_formats = output_formats
206
313
  end
207
314
 
315
+ # Custom attribute writer method with validation
316
+ # @param [Object] cc Value to be assigned
317
+ def cc=(cc)
318
+ if cc.nil?
319
+ fail ArgumentError, 'cc cannot be nil'
320
+ end
321
+
322
+ @cc = cc
323
+ end
324
+
325
+ # Custom attribute writer method with validation
326
+ # @param [Object] notification_emails Value to be assigned
327
+ def notification_emails=(notification_emails)
328
+ if notification_emails.nil?
329
+ fail ArgumentError, 'notification_emails cannot be nil'
330
+ end
331
+
332
+ @notification_emails = notification_emails
333
+ end
334
+
208
335
  # Checks equality by comparing each attribute.
209
336
  # @param [Object] Object to be compared
210
337
  def ==(o)
@@ -220,7 +347,16 @@ module DocSpring
220
347
  field_overrides == o.field_overrides &&
221
348
  html == o.html &&
222
349
  css == o.css &&
223
- signature_requests == o.signature_requests
350
+ signature_requests == o.signature_requests &&
351
+ send_email == o.send_email &&
352
+ signing_order == o.signing_order &&
353
+ email_subject == o.email_subject &&
354
+ email_message == o.email_message &&
355
+ cc == o.cc &&
356
+ reply_to == o.reply_to &&
357
+ notification_emails == o.notification_emails &&
358
+ notify_when_signed == o.notify_when_signed &&
359
+ reminders == o.reminders
224
360
  end
225
361
 
226
362
  # @see the `==` method
@@ -232,7 +368,7 @@ module DocSpring
232
368
  # Calculates hash code according to all attributes.
233
369
  # @return [Integer] Hash code
234
370
  def hash
235
- [test, editable, data, metadata, password, output_formats, expires_in, field_overrides, html, css, signature_requests].hash
371
+ [test, editable, data, metadata, password, output_formats, expires_in, field_overrides, html, css, signature_requests, send_email, signing_order, email_subject, email_message, cc, reply_to, notification_emails, notify_when_signed, reminders].hash
236
372
  end
237
373
 
238
374
  # Builds the object from hash
@@ -22,10 +22,10 @@ module DocSpring
22
22
  # 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.
23
23
  attr_accessor :description
24
24
 
25
- # `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.
25
+ # `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.
26
26
  attr_accessor :template_type
27
27
 
28
- # 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.
28
+ # 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.
29
29
  attr_accessor :output_format
30
30
 
31
31
  # The ID of the folder the template is in. Null for a template at the root. Setting it moves the template and all of its published versions.
@@ -52,7 +52,7 @@ module DocSpring
52
52
  # Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it.
53
53
  attr_accessor :editable_submissions
54
54
 
55
- # 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.
55
+ # 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.
56
56
  attr_accessor :embed_domains
57
57
 
58
58
  # Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on).
@@ -91,9 +91,39 @@ module DocSpring
91
91
  # Allow anyone to fill in the template's web form.
92
92
  attr_accessor :public_web_form
93
93
 
94
- # Where the web form sends people after they submit it.
94
+ # 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.
95
95
  attr_accessor :redirect_url
96
96
 
97
+ # 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.
98
+ attr_accessor :signature_request_email_attachments
99
+
100
+ # 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.
101
+ attr_accessor :signature_request_from_address
102
+
103
+ # 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.
104
+ attr_accessor :signature_request_include_signing_token
105
+
106
+ # 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.
107
+ attr_accessor :signature_request_from_name
108
+
109
+ # 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.
110
+ attr_accessor :signature_request_notification_emails
111
+
112
+ # 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.
113
+ attr_accessor :signature_request_reply_to
114
+
115
+ # 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.
116
+ attr_accessor :signature_request_signing_url
117
+
118
+ # 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 }}`.
119
+ attr_accessor :success_title
120
+
121
+ # 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 }}`.
122
+ attr_accessor :success_message
123
+
124
+ # Whether the web form's success screen has a "Fill out again" button, which clears the form so someone can fill it in again.
125
+ attr_accessor :show_fill_again_button
126
+
97
127
  # A Slack incoming webhook URL that is notified about the template's submissions. It's never returned; `has_slack_webhook_url` says if it's set.
98
128
  attr_accessor :slack_webhook_url
99
129
 
@@ -109,7 +139,7 @@ module DocSpring
109
139
  # 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.
110
140
  attr_accessor :predefined_fields_sample_data
111
141
 
112
- # The HTML of an HTML template, as a Liquid template. Null for PDF and Word templates.
142
+ # The HTML of an HTML template, as a Liquid template. Null for other templates.
113
143
  attr_accessor :html
114
144
 
115
145
  # The SCSS of an HTML template.
@@ -124,16 +154,19 @@ module DocSpring
124
154
  # Null resets the options to their defaults.
125
155
  attr_accessor :html_engine_options
126
156
 
127
- # 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.
157
+ # 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.
128
158
  attr_accessor :html_escape_data
129
159
 
160
+ # 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.
161
+ attr_accessor :layout
162
+
130
163
  # The template's document, a PDF or a Word document (.docx or .odt): the `fields.key` of a file you uploaded with the presigned upload (GET /uploads/presign). PDF and Word templates need one of `cache_id`, `document_url` and `document_base64`. To upload the file with the request, use POST /templates/upload.
131
164
  attr_accessor :cache_id
132
165
 
133
166
  # An https:// link to the template's document, instead of `cache_id`: a PDF template's PDF (up to 100 MB) or a Word template's Word document (.docx or .odt, up to 50 MB). DocSpring downloads it after responding, following redirects to other https:// links: the template's `document.state` is `downloading` until then, and `converting` while an .odt is converted (sync.api hosts wait for both). If it can't be downloaded, the state is `download_failed` and `document.error_message` says why.
134
167
  attr_accessor :document_url
135
168
 
136
- # The template's document (a PDF, or a Word template's Word document), encoded as base64 (a `data:` URI works too), instead of `cache_id`. Up to 7 MB before it's encoded: send a larger file with `cache_id` or `document_url`.
169
+ # The template's document (a PDF, or a Word template's Word document), encoded as base64 (a `data:` URI works too), instead of `cache_id`. Line breaks and spaces in it are ignored. Up to 7 MB before it's encoded: send a larger file with `cache_id` or `document_url`.
137
170
  attr_accessor :document_base64
138
171
 
139
172
  # The file's name, for a `cache_id` (presigned uploads don't send one) or `document_base64`. A `document_url`'s is the last part of its path unless you set it.
@@ -151,6 +184,9 @@ module DocSpring
151
184
  # With `detect_fields`, whether AI reads the whole form once the fields are named and sets up conditional logic and required fields (`ai`) or not (`none`). Default: your account's template settings.
152
185
  attr_accessor :field_logic
153
186
 
187
+ # With `detect_fields`, whether AI field setup keeps the fields that only the office receiving the form fills in, such as a "For office use only" box (`true`), or leaves them out (`false`). Default: your account's template settings.
188
+ attr_accessor :include_office_use_fields
189
+
154
190
  class EnumAttributeValidator
155
191
  attr_reader :datatype
156
192
  attr_reader :allowable_values
@@ -202,6 +238,16 @@ module DocSpring
202
238
  :'public_submissions' => :'public_submissions',
203
239
  :'public_web_form' => :'public_web_form',
204
240
  :'redirect_url' => :'redirect_url',
241
+ :'signature_request_email_attachments' => :'signature_request_email_attachments',
242
+ :'signature_request_from_address' => :'signature_request_from_address',
243
+ :'signature_request_include_signing_token' => :'signature_request_include_signing_token',
244
+ :'signature_request_from_name' => :'signature_request_from_name',
245
+ :'signature_request_notification_emails' => :'signature_request_notification_emails',
246
+ :'signature_request_reply_to' => :'signature_request_reply_to',
247
+ :'signature_request_signing_url' => :'signature_request_signing_url',
248
+ :'success_title' => :'success_title',
249
+ :'success_message' => :'success_message',
250
+ :'show_fill_again_button' => :'show_fill_again_button',
205
251
  :'slack_webhook_url' => :'slack_webhook_url',
206
252
  :'defaults' => :'defaults',
207
253
  :'field_dependencies' => :'field_dependencies',
@@ -213,6 +259,7 @@ module DocSpring
213
259
  :'footer_html' => :'footer_html',
214
260
  :'html_engine_options' => :'html_engine_options',
215
261
  :'html_escape_data' => :'html_escape_data',
262
+ :'layout' => :'layout',
216
263
  :'cache_id' => :'cache_id',
217
264
  :'document_url' => :'document_url',
218
265
  :'document_base64' => :'document_base64',
@@ -220,7 +267,8 @@ module DocSpring
220
267
  :'detect_fields' => :'detect_fields',
221
268
  :'field_source' => :'field_source',
222
269
  :'field_naming' => :'field_naming',
223
- :'field_logic' => :'field_logic'
270
+ :'field_logic' => :'field_logic',
271
+ :'include_office_use_fields' => :'include_office_use_fields'
224
272
  }
225
273
  end
226
274
 
@@ -263,6 +311,16 @@ module DocSpring
263
311
  :'public_submissions' => :'Boolean',
264
312
  :'public_web_form' => :'Boolean',
265
313
  :'redirect_url' => :'String',
314
+ :'signature_request_email_attachments' => :'SignatureRequestEmailAttachments',
315
+ :'signature_request_from_address' => :'String',
316
+ :'signature_request_include_signing_token' => :'Boolean',
317
+ :'signature_request_from_name' => :'String',
318
+ :'signature_request_notification_emails' => :'Array<String>',
319
+ :'signature_request_reply_to' => :'String',
320
+ :'signature_request_signing_url' => :'String',
321
+ :'success_title' => :'String',
322
+ :'success_message' => :'String',
323
+ :'show_fill_again_button' => :'Boolean',
266
324
  :'slack_webhook_url' => :'String',
267
325
  :'defaults' => :'TemplateDefaultsInput',
268
326
  :'field_dependencies' => :'Array<TemplateFieldDependencyInput>',
@@ -274,6 +332,7 @@ module DocSpring
274
332
  :'footer_html' => :'String',
275
333
  :'html_engine_options' => :'HtmlEngineOptionsInput',
276
334
  :'html_escape_data' => :'Boolean',
335
+ :'layout' => :'Hash<String, Object>',
277
336
  :'cache_id' => :'String',
278
337
  :'document_url' => :'String',
279
338
  :'document_base64' => :'String',
@@ -281,7 +340,8 @@ module DocSpring
281
340
  :'detect_fields' => :'Boolean',
282
341
  :'field_source' => :'FieldSetupSource',
283
342
  :'field_naming' => :'FieldSetupNaming',
284
- :'field_logic' => :'FieldSetupLogic'
343
+ :'field_logic' => :'FieldSetupLogic',
344
+ :'include_office_use_fields' => :'Boolean'
285
345
  }
286
346
  end
287
347
 
@@ -292,6 +352,13 @@ module DocSpring
292
352
  :'parent_folder_id',
293
353
  :'encrypt_pdfs_password',
294
354
  :'redirect_url',
355
+ :'signature_request_email_attachments',
356
+ :'signature_request_from_address',
357
+ :'signature_request_from_name',
358
+ :'signature_request_reply_to',
359
+ :'signature_request_signing_url',
360
+ :'success_title',
361
+ :'success_message',
295
362
  :'slack_webhook_url',
296
363
  :'predefined_fields_sample_data',
297
364
  :'html',
@@ -299,6 +366,7 @@ module DocSpring
299
366
  :'header_html',
300
367
  :'footer_html',
301
368
  :'html_engine_options',
369
+ :'layout',
302
370
  ])
303
371
  end
304
372
 
@@ -436,6 +504,48 @@ module DocSpring
436
504
  self.redirect_url = attributes[:'redirect_url']
437
505
  end
438
506
 
507
+ if attributes.key?(:'signature_request_email_attachments')
508
+ self.signature_request_email_attachments = attributes[:'signature_request_email_attachments']
509
+ end
510
+
511
+ if attributes.key?(:'signature_request_from_address')
512
+ self.signature_request_from_address = attributes[:'signature_request_from_address']
513
+ end
514
+
515
+ if attributes.key?(:'signature_request_include_signing_token')
516
+ self.signature_request_include_signing_token = attributes[:'signature_request_include_signing_token']
517
+ end
518
+
519
+ if attributes.key?(:'signature_request_from_name')
520
+ self.signature_request_from_name = attributes[:'signature_request_from_name']
521
+ end
522
+
523
+ if attributes.key?(:'signature_request_notification_emails')
524
+ if (value = attributes[:'signature_request_notification_emails']).is_a?(Array)
525
+ self.signature_request_notification_emails = value
526
+ end
527
+ end
528
+
529
+ if attributes.key?(:'signature_request_reply_to')
530
+ self.signature_request_reply_to = attributes[:'signature_request_reply_to']
531
+ end
532
+
533
+ if attributes.key?(:'signature_request_signing_url')
534
+ self.signature_request_signing_url = attributes[:'signature_request_signing_url']
535
+ end
536
+
537
+ if attributes.key?(:'success_title')
538
+ self.success_title = attributes[:'success_title']
539
+ end
540
+
541
+ if attributes.key?(:'success_message')
542
+ self.success_message = attributes[:'success_message']
543
+ end
544
+
545
+ if attributes.key?(:'show_fill_again_button')
546
+ self.show_fill_again_button = attributes[:'show_fill_again_button']
547
+ end
548
+
439
549
  if attributes.key?(:'slack_webhook_url')
440
550
  self.slack_webhook_url = attributes[:'slack_webhook_url']
441
551
  end
@@ -486,6 +596,12 @@ module DocSpring
486
596
  self.html_escape_data = attributes[:'html_escape_data']
487
597
  end
488
598
 
599
+ if attributes.key?(:'layout')
600
+ if (value = attributes[:'layout']).is_a?(Hash) || value.nil?
601
+ self.layout = value
602
+ end
603
+ end
604
+
489
605
  if attributes.key?(:'cache_id')
490
606
  self.cache_id = attributes[:'cache_id']
491
607
  end
@@ -517,6 +633,10 @@ module DocSpring
517
633
  if attributes.key?(:'field_logic')
518
634
  self.field_logic = attributes[:'field_logic']
519
635
  end
636
+
637
+ if attributes.key?(:'include_office_use_fields')
638
+ self.include_office_use_fields = attributes[:'include_office_use_fields']
639
+ end
520
640
  end
521
641
 
522
642
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -549,6 +669,16 @@ module DocSpring
549
669
  @template_type = template_type
550
670
  end
551
671
 
672
+ # Custom attribute writer method with validation
673
+ # @param [Object] signature_request_notification_emails Value to be assigned
674
+ def signature_request_notification_emails=(signature_request_notification_emails)
675
+ if signature_request_notification_emails.nil?
676
+ fail ArgumentError, 'signature_request_notification_emails cannot be nil'
677
+ end
678
+
679
+ @signature_request_notification_emails = signature_request_notification_emails
680
+ end
681
+
552
682
  # Checks equality by comparing each attribute.
553
683
  # @param [Object] Object to be compared
554
684
  def ==(o)
@@ -580,6 +710,16 @@ module DocSpring
580
710
  public_submissions == o.public_submissions &&
581
711
  public_web_form == o.public_web_form &&
582
712
  redirect_url == o.redirect_url &&
713
+ signature_request_email_attachments == o.signature_request_email_attachments &&
714
+ signature_request_from_address == o.signature_request_from_address &&
715
+ signature_request_include_signing_token == o.signature_request_include_signing_token &&
716
+ signature_request_from_name == o.signature_request_from_name &&
717
+ signature_request_notification_emails == o.signature_request_notification_emails &&
718
+ signature_request_reply_to == o.signature_request_reply_to &&
719
+ signature_request_signing_url == o.signature_request_signing_url &&
720
+ success_title == o.success_title &&
721
+ success_message == o.success_message &&
722
+ show_fill_again_button == o.show_fill_again_button &&
583
723
  slack_webhook_url == o.slack_webhook_url &&
584
724
  defaults == o.defaults &&
585
725
  field_dependencies == o.field_dependencies &&
@@ -591,6 +731,7 @@ module DocSpring
591
731
  footer_html == o.footer_html &&
592
732
  html_engine_options == o.html_engine_options &&
593
733
  html_escape_data == o.html_escape_data &&
734
+ layout == o.layout &&
594
735
  cache_id == o.cache_id &&
595
736
  document_url == o.document_url &&
596
737
  document_base64 == o.document_base64 &&
@@ -598,7 +739,8 @@ module DocSpring
598
739
  detect_fields == o.detect_fields &&
599
740
  field_source == o.field_source &&
600
741
  field_naming == o.field_naming &&
601
- field_logic == o.field_logic
742
+ field_logic == o.field_logic &&
743
+ include_office_use_fields == o.include_office_use_fields
602
744
  end
603
745
 
604
746
  # @see the `==` method
@@ -610,7 +752,7 @@ module DocSpring
610
752
  # Calculates hash code according to all attributes.
611
753
  # @return [Integer] Hash code
612
754
  def hash
613
- [name, description, template_type, output_format, parent_folder_id, locked, 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, 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, slack_webhook_url, defaults, field_dependencies, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, cache_id, document_url, document_base64, filename, detect_fields, field_source, field_naming, field_logic].hash
755
+ [name, description, template_type, output_format, parent_folder_id, locked, 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, 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, slack_webhook_url, defaults, field_dependencies, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, layout, cache_id, document_url, document_base64, filename, detect_fields, field_source, field_naming, field_logic, include_office_use_fields].hash
614
756
  end
615
757
 
616
758
  # Builds the object from hash
@@ -0,0 +1,42 @@
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
+ class DnsRecordType
18
+ CNAME = "CNAME".freeze
19
+ MX = "MX".freeze
20
+ TXT = "TXT".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [CNAME, MX, TXT].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ # Only responses are built from hashes, and a value added to the API after this client was released is kept as it
38
+ # is: the constants are the values this client knows
39
+ value
40
+ end
41
+ end
42
+ end