docspring 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +99 -0
  3. data/.travis.yml +1 -1
  4. data/AGENTS.md +3 -2
  5. data/CHANGELOG.md +64 -0
  6. data/Gemfile.lock +9 -9
  7. data/README.md +14 -1
  8. data/docs/AddTemplateFieldsRequest.md +18 -0
  9. data/docs/Client.md +917 -80
  10. data/docs/CombinedPdf.md +1 -1
  11. data/docs/CreateCombinedPdfRequest.md +1 -1
  12. data/docs/CreateSubmissionBatchRequest.md +2 -0
  13. data/docs/CreateSubmissionRequest.md +4 -2
  14. data/docs/CreateTemplatePreviewRequest.md +18 -0
  15. data/docs/CreateTemplateRequest.md +13 -3
  16. data/docs/ErrorDetail.md +1 -1
  17. data/docs/ErrorInfo.md +4 -4
  18. data/docs/Field.md +198 -0
  19. data/docs/FieldDependency.md +22 -0
  20. data/docs/FieldDependencyInput.md +22 -0
  21. data/docs/FieldGroup.md +32 -0
  22. data/docs/FieldGroupInput.md +30 -0
  23. data/docs/FieldGroupType.md +15 -0
  24. data/docs/FieldInput.md +196 -0
  25. data/docs/FieldType.md +15 -0
  26. data/docs/GenerateFilesFormat.md +15 -0
  27. data/docs/GenerateSubmissionFilesRequest.md +18 -0
  28. data/docs/OutputFormat.md +15 -0
  29. data/docs/PageImage.md +34 -0
  30. data/docs/PageImages.md +24 -0
  31. data/docs/PredefinedField.md +30 -0
  32. data/docs/PredefinedFieldInput.md +30 -0
  33. data/docs/RemoveTemplateFieldsRequest.md +18 -0
  34. data/docs/ReorderTemplateFieldsRequest.md +18 -0
  35. data/docs/Submission.md +16 -14
  36. data/docs/SubmissionFiles.md +3 -1
  37. data/docs/SubmissionInput.md +4 -2
  38. data/docs/SubmissionList.md +1 -1
  39. data/docs/SubmissionSummary.md +54 -0
  40. data/docs/SubmissionValidation.md +24 -0
  41. data/docs/Template.md +18 -10
  42. data/docs/TemplateActor.md +1 -1
  43. data/docs/TemplateDiff.md +30 -0
  44. data/docs/TemplateDiffSummary.md +28 -0
  45. data/docs/TemplateDocument.md +6 -6
  46. data/docs/TemplateDocumentSummary.md +24 -0
  47. data/docs/TemplateFieldChange.md +24 -0
  48. data/docs/TemplateFieldChanges.md +24 -0
  49. data/docs/TemplateFieldDependency.md +1 -1
  50. data/docs/TemplateFieldDependencyInput.md +1 -1
  51. data/docs/TemplateFieldMove.md +22 -0
  52. data/docs/TemplateFields.md +22 -0
  53. data/docs/TemplatePageImages.md +24 -0
  54. data/docs/TemplatePreview.md +32 -0
  55. data/docs/TemplatePreviewState.md +15 -0
  56. data/docs/TemplateSummary.md +2 -48
  57. data/docs/UpdateTemplateDocumentRequest.md +6 -2
  58. data/docs/UpdateTemplateFieldsRequest.md +18 -0
  59. data/docs/UpdateTemplateRequest.md +10 -2
  60. data/docs/ValidateSubmissionRequest.md +38 -0
  61. data/lib/docspring/api/client.rb +869 -51
  62. data/lib/docspring/api_client.rb +4 -2
  63. data/lib/docspring/date_time_values.rb +33 -0
  64. data/lib/docspring/models/add_template_fields_request.rb +187 -0
  65. data/lib/docspring/models/combined_pdf.rb +1 -1
  66. data/lib/docspring/models/create_combined_pdf_request.rb +1 -1
  67. data/lib/docspring/models/create_submission_batch_request.rb +23 -1
  68. data/lib/docspring/models/create_submission_request.rb +25 -3
  69. data/lib/docspring/models/create_template_preview_request.rb +187 -0
  70. data/lib/docspring/models/create_template_request.rb +59 -4
  71. data/lib/docspring/models/error_code.rb +3 -1
  72. data/lib/docspring/models/error_detail.rb +1 -1
  73. data/lib/docspring/models/error_info.rb +4 -4
  74. data/lib/docspring/models/field.rb +2217 -0
  75. data/lib/docspring/models/field_dependency.rb +246 -0
  76. data/lib/docspring/models/field_dependency_input.rb +246 -0
  77. data/lib/docspring/models/field_group.rb +368 -0
  78. data/lib/docspring/models/field_group_input.rb +247 -0
  79. data/lib/docspring/models/field_group_type.rb +41 -0
  80. data/lib/docspring/models/field_input.rb +1109 -0
  81. data/lib/docspring/models/field_type.rb +54 -0
  82. data/lib/docspring/models/generate_files_format.rb +40 -0
  83. data/lib/docspring/models/generate_submission_files_request.rb +187 -0
  84. data/lib/docspring/models/output_format.rb +41 -0
  85. data/lib/docspring/models/page_image.rb +359 -0
  86. data/lib/docspring/models/page_images.rb +248 -0
  87. data/lib/docspring/models/predefined_field.rb +287 -0
  88. data/lib/docspring/models/predefined_field_input.rb +287 -0
  89. data/lib/docspring/models/remove_template_fields_request.rb +187 -0
  90. data/lib/docspring/models/reorder_template_fields_request.rb +187 -0
  91. data/lib/docspring/models/submission.rb +146 -117
  92. data/lib/docspring/models/submission_files.rb +13 -4
  93. data/lib/docspring/models/submission_input.rb +25 -3
  94. data/lib/docspring/models/submission_list.rb +1 -1
  95. data/lib/docspring/models/submission_summary.rb +601 -0
  96. data/lib/docspring/models/submission_validation.rb +234 -0
  97. data/lib/docspring/models/template.rb +169 -83
  98. data/lib/docspring/models/template_actor.rb +1 -1
  99. data/lib/docspring/models/template_diff.rb +321 -0
  100. data/lib/docspring/models/template_diff_summary.rb +320 -0
  101. data/lib/docspring/models/template_document.rb +44 -44
  102. data/lib/docspring/models/template_document_state.rb +3 -1
  103. data/lib/docspring/models/template_document_summary.rb +260 -0
  104. data/lib/docspring/models/template_field_change.rb +266 -0
  105. data/lib/docspring/models/template_field_changes.rb +274 -0
  106. data/lib/docspring/models/template_field_dependency.rb +1 -1
  107. data/lib/docspring/models/template_field_dependency_input.rb +1 -1
  108. data/lib/docspring/models/template_field_move.rb +239 -0
  109. data/lib/docspring/models/template_fields.rb +227 -0
  110. data/lib/docspring/models/template_page_images.rb +254 -0
  111. data/lib/docspring/models/template_preview.rb +356 -0
  112. data/lib/docspring/models/template_preview_state.rb +42 -0
  113. data/lib/docspring/models/template_summary.rb +5 -572
  114. data/lib/docspring/models/update_template_document_request.rb +23 -20
  115. data/lib/docspring/models/update_template_fields_request.rb +187 -0
  116. data/lib/docspring/models/update_template_request.rb +53 -6
  117. data/lib/docspring/models/validate_submission_request.rb +288 -0
  118. data/lib/docspring/request_schemas.json +3465 -1588
  119. data/lib/docspring/version.rb +1 -1
  120. data/lib/docspring/webhook_signature.rb +45 -0
  121. data/lib/docspring.rb +34 -0
  122. data/spec/api/client_spec.rb +167 -13
  123. data/spec/models/add_template_fields_request_spec.rb +36 -0
  124. data/spec/models/create_submission_batch_request_spec.rb +6 -0
  125. data/spec/models/create_submission_request_spec.rb +6 -0
  126. data/spec/models/create_template_preview_request_spec.rb +36 -0
  127. data/spec/models/create_template_request_spec.rb +30 -0
  128. data/spec/models/field_dependency_input_spec.rb +48 -0
  129. data/spec/models/field_dependency_spec.rb +48 -0
  130. data/spec/models/field_group_input_spec.rb +72 -0
  131. data/spec/models/field_group_spec.rb +78 -0
  132. data/spec/models/field_group_type_spec.rb +30 -0
  133. data/spec/models/field_input_spec.rb +570 -0
  134. data/spec/models/field_spec.rb +576 -0
  135. data/spec/models/field_type_spec.rb +30 -0
  136. data/spec/models/generate_files_format_spec.rb +30 -0
  137. data/spec/models/generate_submission_files_request_spec.rb +36 -0
  138. data/spec/models/output_format_spec.rb +30 -0
  139. data/spec/models/page_image_spec.rb +84 -0
  140. data/spec/models/page_images_spec.rb +54 -0
  141. data/spec/models/predefined_field_input_spec.rb +72 -0
  142. data/spec/models/predefined_field_spec.rb +72 -0
  143. data/spec/models/remove_template_fields_request_spec.rb +36 -0
  144. data/spec/models/reorder_template_fields_request_spec.rb +36 -0
  145. data/spec/models/submission_files_spec.rb +6 -0
  146. data/spec/models/submission_input_spec.rb +6 -0
  147. data/spec/models/submission_spec.rb +17 -11
  148. data/spec/models/submission_summary_spec.rb +144 -0
  149. data/spec/models/submission_validation_spec.rb +54 -0
  150. data/spec/models/template_diff_spec.rb +72 -0
  151. data/spec/models/template_diff_summary_spec.rb +66 -0
  152. data/spec/models/template_document_spec.rb +5 -5
  153. data/spec/models/template_document_summary_spec.rb +54 -0
  154. data/spec/models/template_field_change_spec.rb +54 -0
  155. data/spec/models/template_field_changes_spec.rb +54 -0
  156. data/spec/models/template_field_move_spec.rb +48 -0
  157. data/spec/models/template_fields_spec.rb +48 -0
  158. data/spec/models/template_page_images_spec.rb +54 -0
  159. data/spec/models/template_preview_spec.rb +78 -0
  160. data/spec/models/template_preview_state_spec.rb +30 -0
  161. data/spec/models/template_spec.rb +34 -10
  162. data/spec/models/template_summary_spec.rb +0 -138
  163. data/spec/models/update_template_document_request_spec.rb +12 -0
  164. data/spec/models/update_template_fields_request_spec.rb +36 -0
  165. data/spec/models/update_template_request_spec.rb +24 -0
  166. data/spec/models/validate_submission_request_spec.rb +96 -0
  167. metadata +135 -1
@@ -43,7 +43,7 @@ module DocSpring
43
43
  # `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`.
44
44
  attr_accessor :editable
45
45
 
46
- # The submission's data, with the values entered in completed signature requests. Lists leave it out (null) unless you pass `include_data=true`. Empty once the submission has expired.
46
+ # The submission's data, with the values entered in completed signature requests. Empty once the submission has expired. Null in a batch's submissions unless you pass `include_data=true`, and in the events of a webhook that leaves out submission data.
47
47
  attr_accessor :data
48
48
 
49
49
  # Why the data doesn't match the template's fields, when `state` is `invalid_data`: the same details as the 422 response that recorded it, with pointers into the request that created the submission (`/data/name`). Cleared once the submission has expired.
@@ -52,27 +52,12 @@ module DocSpring
52
52
  # Why the PDF couldn't be generated, when `state` is `error`.
53
53
  attr_accessor :error_message
54
54
 
55
- # Your own data about the submission, such as an ID from your app. It isn't printed on the PDF.
55
+ # 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`).
56
56
  attr_accessor :metadata
57
57
 
58
- # Whether the PDF needs a password to open (`password`).
59
- attr_accessor :has_password
60
-
61
- # The people asked to sign the submission (and fill in their fields), in order.
62
- attr_accessor :signature_requests
63
-
64
- # The uploads of the submission's PDF to your storage (account integrations).
65
- attr_accessor :actions
66
-
67
- # The text of each field that didn't fit in it, by field name. Left out (null) with `data`, and empty once the submission has expired.
68
- attr_accessor :truncated_text
69
-
70
- # The generated files: `pdf` once the submission has been processed, `audit_trail` once its signature requests are completed, and `preview` once a preview PDF has been generated. Empty once the submission has expired.
58
+ # The generated files: `pdf` once the submission has been processed, `png` (the images of the PDF's pages, when `output_formats` has it: `files.png.pages[0]` is page 1), `audit_trail` once its signature requests are completed, and `preview` once a preview PDF has been generated. Empty once the submission has expired.
71
59
  attr_accessor :files
72
60
 
73
- # When the preview PDF was generated. Null if there is no preview.
74
- attr_accessor :preview_generated_at
75
-
76
61
  # An expired submission's data, metadata, password and PDF have been deleted.
77
62
  attr_accessor :expired
78
63
 
@@ -88,6 +73,24 @@ module DocSpring
88
73
  # When the submission was last updated.
89
74
  attr_accessor :updated_at
90
75
 
76
+ # Whether the PDF needs a password to open (`password`).
77
+ attr_accessor :has_password
78
+
79
+ # The people asked to sign the submission (and fill in their fields), in order.
80
+ attr_accessor :signature_requests
81
+
82
+ # The uploads of the submission's PDF to your storage (account integrations).
83
+ attr_accessor :actions
84
+
85
+ # The text of each field that didn't fit in it, by field name. Left out (null) with `data`, and empty once the submission has expired.
86
+ attr_accessor :truncated_text
87
+
88
+ # What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission.
89
+ attr_accessor :output_formats
90
+
91
+ # When the preview PDF was generated. Null if there is no preview.
92
+ attr_accessor :preview_generated_at
93
+
91
94
  class EnumAttributeValidator
92
95
  attr_reader :datatype
93
96
  attr_reader :allowable_values
@@ -126,17 +129,18 @@ module DocSpring
126
129
  :'data_errors' => :'data_errors',
127
130
  :'error_message' => :'error_message',
128
131
  :'metadata' => :'metadata',
129
- :'has_password' => :'has_password',
130
- :'signature_requests' => :'signature_requests',
131
- :'actions' => :'actions',
132
- :'truncated_text' => :'truncated_text',
133
132
  :'files' => :'files',
134
- :'preview_generated_at' => :'preview_generated_at',
135
133
  :'expired' => :'expired',
136
134
  :'expires_at' => :'expires_at',
137
135
  :'processed_at' => :'processed_at',
138
136
  :'created_at' => :'created_at',
139
- :'updated_at' => :'updated_at'
137
+ :'updated_at' => :'updated_at',
138
+ :'has_password' => :'has_password',
139
+ :'signature_requests' => :'signature_requests',
140
+ :'actions' => :'actions',
141
+ :'truncated_text' => :'truncated_text',
142
+ :'output_formats' => :'output_formats',
143
+ :'preview_generated_at' => :'preview_generated_at'
140
144
  }
141
145
  end
142
146
 
@@ -166,17 +170,18 @@ module DocSpring
166
170
  :'data_errors' => :'Array<ErrorDetail>',
167
171
  :'error_message' => :'String',
168
172
  :'metadata' => :'Hash<String, Object>',
169
- :'has_password' => :'Boolean',
170
- :'signature_requests' => :'Array<SignatureRequest>',
171
- :'actions' => :'Array<SubmissionAction>',
172
- :'truncated_text' => :'Hash<String, Array<String>>',
173
173
  :'files' => :'SubmissionFiles',
174
- :'preview_generated_at' => :'Time',
175
174
  :'expired' => :'Boolean',
176
175
  :'expires_at' => :'Time',
177
176
  :'processed_at' => :'Time',
178
177
  :'created_at' => :'Time',
179
- :'updated_at' => :'Time'
178
+ :'updated_at' => :'Time',
179
+ :'has_password' => :'Boolean',
180
+ :'signature_requests' => :'Array<SignatureRequest>',
181
+ :'actions' => :'Array<SubmissionAction>',
182
+ :'truncated_text' => :'Hash<String, Array<String>>',
183
+ :'output_formats' => :'Array<OutputFormat>',
184
+ :'preview_generated_at' => :'Time'
180
185
  }
181
186
  end
182
187
 
@@ -188,10 +193,10 @@ module DocSpring
188
193
  :'batch_id',
189
194
  :'data',
190
195
  :'error_message',
191
- :'truncated_text',
192
- :'preview_generated_at',
193
196
  :'expires_at',
194
197
  :'processed_at',
198
+ :'truncated_text',
199
+ :'preview_generated_at'
195
200
  ])
196
201
  end
197
202
 
@@ -305,6 +310,42 @@ module DocSpring
305
310
  self.metadata = nil
306
311
  end
307
312
 
313
+ if attributes.key?(:'files')
314
+ self.files = attributes[:'files']
315
+ else
316
+ self.files = nil
317
+ end
318
+
319
+ if attributes.key?(:'expired')
320
+ self.expired = attributes[:'expired']
321
+ else
322
+ self.expired = nil
323
+ end
324
+
325
+ if attributes.key?(:'expires_at')
326
+ self.expires_at = attributes[:'expires_at']
327
+ else
328
+ self.expires_at = nil
329
+ end
330
+
331
+ if attributes.key?(:'processed_at')
332
+ self.processed_at = attributes[:'processed_at']
333
+ else
334
+ self.processed_at = nil
335
+ end
336
+
337
+ if attributes.key?(:'created_at')
338
+ self.created_at = attributes[:'created_at']
339
+ else
340
+ self.created_at = nil
341
+ end
342
+
343
+ if attributes.key?(:'updated_at')
344
+ self.updated_at = attributes[:'updated_at']
345
+ else
346
+ self.updated_at = nil
347
+ end
348
+
308
349
  if attributes.key?(:'has_password')
309
350
  self.has_password = attributes[:'has_password']
310
351
  else
@@ -335,10 +376,12 @@ module DocSpring
335
376
  self.truncated_text = nil
336
377
  end
337
378
 
338
- if attributes.key?(:'files')
339
- self.files = attributes[:'files']
379
+ if attributes.key?(:'output_formats')
380
+ if (value = attributes[:'output_formats']).is_a?(Array)
381
+ self.output_formats = value
382
+ end
340
383
  else
341
- self.files = nil
384
+ self.output_formats = nil
342
385
  end
343
386
 
344
387
  if attributes.key?(:'preview_generated_at')
@@ -346,36 +389,6 @@ module DocSpring
346
389
  else
347
390
  self.preview_generated_at = nil
348
391
  end
349
-
350
- if attributes.key?(:'expired')
351
- self.expired = attributes[:'expired']
352
- else
353
- self.expired = nil
354
- end
355
-
356
- if attributes.key?(:'expires_at')
357
- self.expires_at = attributes[:'expires_at']
358
- else
359
- self.expires_at = nil
360
- end
361
-
362
- if attributes.key?(:'processed_at')
363
- self.processed_at = attributes[:'processed_at']
364
- else
365
- self.processed_at = nil
366
- end
367
-
368
- if attributes.key?(:'created_at')
369
- self.created_at = attributes[:'created_at']
370
- else
371
- self.created_at = nil
372
- end
373
-
374
- if attributes.key?(:'updated_at')
375
- self.updated_at = attributes[:'updated_at']
376
- else
377
- self.updated_at = nil
378
- end
379
392
  end
380
393
 
381
394
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -415,18 +428,6 @@ module DocSpring
415
428
  invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
416
429
  end
417
430
 
418
- if @has_password.nil?
419
- invalid_properties.push('invalid value for "has_password", has_password cannot be nil.')
420
- end
421
-
422
- if @signature_requests.nil?
423
- invalid_properties.push('invalid value for "signature_requests", signature_requests cannot be nil.')
424
- end
425
-
426
- if @actions.nil?
427
- invalid_properties.push('invalid value for "actions", actions cannot be nil.')
428
- end
429
-
430
431
  if @files.nil?
431
432
  invalid_properties.push('invalid value for "files", files cannot be nil.')
432
433
  end
@@ -443,6 +444,22 @@ module DocSpring
443
444
  invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
444
445
  end
445
446
 
447
+ if @has_password.nil?
448
+ invalid_properties.push('invalid value for "has_password", has_password cannot be nil.')
449
+ end
450
+
451
+ if @signature_requests.nil?
452
+ invalid_properties.push('invalid value for "signature_requests", signature_requests cannot be nil.')
453
+ end
454
+
455
+ if @actions.nil?
456
+ invalid_properties.push('invalid value for "actions", actions cannot be nil.')
457
+ end
458
+
459
+ if @output_formats.nil?
460
+ invalid_properties.push('invalid value for "output_formats", output_formats cannot be nil.')
461
+ end
462
+
446
463
  invalid_properties
447
464
  end
448
465
 
@@ -458,13 +475,14 @@ module DocSpring
458
475
  return false if @editable.nil?
459
476
  return false if @data_errors.nil?
460
477
  return false if @metadata.nil?
461
- return false if @has_password.nil?
462
- return false if @signature_requests.nil?
463
- return false if @actions.nil?
464
478
  return false if @files.nil?
465
479
  return false if @expired.nil?
466
480
  return false if @created_at.nil?
467
481
  return false if @updated_at.nil?
482
+ return false if @has_password.nil?
483
+ return false if @signature_requests.nil?
484
+ return false if @actions.nil?
485
+ return false if @output_formats.nil?
468
486
  true
469
487
  end
470
488
 
@@ -548,36 +566,6 @@ module DocSpring
548
566
  @metadata = metadata
549
567
  end
550
568
 
551
- # Custom attribute writer method with validation
552
- # @param [Object] has_password Value to be assigned
553
- def has_password=(has_password)
554
- if has_password.nil?
555
- fail ArgumentError, 'has_password cannot be nil'
556
- end
557
-
558
- @has_password = has_password
559
- end
560
-
561
- # Custom attribute writer method with validation
562
- # @param [Object] signature_requests Value to be assigned
563
- def signature_requests=(signature_requests)
564
- if signature_requests.nil?
565
- fail ArgumentError, 'signature_requests cannot be nil'
566
- end
567
-
568
- @signature_requests = signature_requests
569
- end
570
-
571
- # Custom attribute writer method with validation
572
- # @param [Object] actions Value to be assigned
573
- def actions=(actions)
574
- if actions.nil?
575
- fail ArgumentError, 'actions cannot be nil'
576
- end
577
-
578
- @actions = actions
579
- end
580
-
581
569
  # Custom attribute writer method with validation
582
570
  # @param [Object] files Value to be assigned
583
571
  def files=(files)
@@ -618,6 +606,46 @@ module DocSpring
618
606
  @updated_at = updated_at
619
607
  end
620
608
 
609
+ # Custom attribute writer method with validation
610
+ # @param [Object] has_password Value to be assigned
611
+ def has_password=(has_password)
612
+ if has_password.nil?
613
+ fail ArgumentError, 'has_password cannot be nil'
614
+ end
615
+
616
+ @has_password = has_password
617
+ end
618
+
619
+ # Custom attribute writer method with validation
620
+ # @param [Object] signature_requests Value to be assigned
621
+ def signature_requests=(signature_requests)
622
+ if signature_requests.nil?
623
+ fail ArgumentError, 'signature_requests cannot be nil'
624
+ end
625
+
626
+ @signature_requests = signature_requests
627
+ end
628
+
629
+ # Custom attribute writer method with validation
630
+ # @param [Object] actions Value to be assigned
631
+ def actions=(actions)
632
+ if actions.nil?
633
+ fail ArgumentError, 'actions cannot be nil'
634
+ end
635
+
636
+ @actions = actions
637
+ end
638
+
639
+ # Custom attribute writer method with validation
640
+ # @param [Object] output_formats Value to be assigned
641
+ def output_formats=(output_formats)
642
+ if output_formats.nil?
643
+ fail ArgumentError, 'output_formats cannot be nil'
644
+ end
645
+
646
+ @output_formats = output_formats
647
+ end
648
+
621
649
  # Checks equality by comparing each attribute.
622
650
  # @param [Object] Object to be compared
623
651
  def ==(o)
@@ -636,17 +664,18 @@ module DocSpring
636
664
  data_errors == o.data_errors &&
637
665
  error_message == o.error_message &&
638
666
  metadata == o.metadata &&
639
- has_password == o.has_password &&
640
- signature_requests == o.signature_requests &&
641
- actions == o.actions &&
642
- truncated_text == o.truncated_text &&
643
667
  files == o.files &&
644
- preview_generated_at == o.preview_generated_at &&
645
668
  expired == o.expired &&
646
669
  expires_at == o.expires_at &&
647
670
  processed_at == o.processed_at &&
648
671
  created_at == o.created_at &&
649
- updated_at == o.updated_at
672
+ updated_at == o.updated_at &&
673
+ has_password == o.has_password &&
674
+ signature_requests == o.signature_requests &&
675
+ actions == o.actions &&
676
+ truncated_text == o.truncated_text &&
677
+ output_formats == o.output_formats &&
678
+ preview_generated_at == o.preview_generated_at
650
679
  end
651
680
 
652
681
  # @see the `==` method
@@ -658,7 +687,7 @@ module DocSpring
658
687
  # Calculates hash code according to all attributes.
659
688
  # @return [Integer] Hash code
660
689
  def hash
661
- [id, template_id, template_type, template_version, batch_id, source, state, test, editable, data, data_errors, error_message, metadata, has_password, signature_requests, actions, truncated_text, files, preview_generated_at, expired, expires_at, processed_at, created_at, updated_at].hash
690
+ [id, template_id, template_type, template_version, batch_id, source, state, test, editable, data, data_errors, error_message, metadata, files, expired, expires_at, processed_at, created_at, updated_at, has_password, signature_requests, actions, truncated_text, output_formats, preview_generated_at].hash
662
691
  end
663
692
 
664
693
  # Builds the object from hash
@@ -25,12 +25,15 @@ module DocSpring
25
25
  # The preview PDF from POST /submissions/{submission_id}/generate_preview, such as for a submission still waiting for its signature requests.
26
26
  attr_accessor :preview
27
27
 
28
+ attr_accessor :png
29
+
28
30
  # Attribute mapping from ruby-style variable name to JSON key.
29
31
  def self.attribute_map
30
32
  {
31
33
  :'pdf' => :'pdf',
32
34
  :'audit_trail' => :'audit_trail',
33
- :'preview' => :'preview'
35
+ :'preview' => :'preview',
36
+ :'png' => :'png'
34
37
  }
35
38
  end
36
39
 
@@ -49,7 +52,8 @@ module DocSpring
49
52
  {
50
53
  :'pdf' => :'GeneratedFile',
51
54
  :'audit_trail' => :'GeneratedFile',
52
- :'preview' => :'GeneratedFile'
55
+ :'preview' => :'GeneratedFile',
56
+ :'png' => :'PageImages'
53
57
  }
54
58
  end
55
59
 
@@ -96,6 +100,10 @@ module DocSpring
96
100
  if attributes.key?(:'preview')
97
101
  self.preview = attributes[:'preview']
98
102
  end
103
+
104
+ if attributes.key?(:'png')
105
+ self.png = attributes[:'png']
106
+ end
99
107
  end
100
108
 
101
109
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -120,7 +128,8 @@ module DocSpring
120
128
  self.class == o.class &&
121
129
  pdf == o.pdf &&
122
130
  audit_trail == o.audit_trail &&
123
- preview == o.preview
131
+ preview == o.preview &&
132
+ png == o.png
124
133
  end
125
134
 
126
135
  # @see the `==` method
@@ -132,7 +141,7 @@ module DocSpring
132
141
  # Calculates hash code according to all attributes.
133
142
  # @return [Integer] Hash code
134
143
  def hash
135
- [pdf, audit_trail, preview].hash
144
+ [pdf, audit_trail, preview, png].hash
136
145
  end
137
146
 
138
147
  # Builds the object from hash
@@ -25,12 +25,15 @@ module DocSpring
25
25
  # The values of the template's fields, by field name. Required for a PDF template.
26
26
  attr_accessor :data
27
27
 
28
- # Your own data about the submission, such as an ID from your app. It isn't printed on the PDF.
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`).
29
29
  attr_accessor :metadata
30
30
 
31
31
  # A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set.
32
32
  attr_accessor :password
33
33
 
34
+ # What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission.
35
+ attr_accessor :output_formats
36
+
34
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.
35
38
  attr_accessor :expires_in
36
39
 
@@ -40,7 +43,7 @@ module DocSpring
40
43
  # For an HTML template, HTML to use instead of the template's.
41
44
  attr_accessor :html
42
45
 
43
- # For an HTML template, CSS to use instead of the template's.
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.
44
47
  attr_accessor :css
45
48
 
46
49
  # The submission's template. Default the batch's `template_id`.
@@ -57,6 +60,7 @@ module DocSpring
57
60
  :'data' => :'data',
58
61
  :'metadata' => :'metadata',
59
62
  :'password' => :'password',
63
+ :'output_formats' => :'output_formats',
60
64
  :'expires_in' => :'expires_in',
61
65
  :'field_overrides' => :'field_overrides',
62
66
  :'html' => :'html',
@@ -84,6 +88,7 @@ module DocSpring
84
88
  :'data' => :'Hash<String, Object>',
85
89
  :'metadata' => :'Hash<String, Object>',
86
90
  :'password' => :'String',
91
+ :'output_formats' => :'Array<OutputFormat>',
87
92
  :'expires_in' => :'Integer',
88
93
  :'field_overrides' => :'Hash<String, FieldOverride>',
89
94
  :'html' => :'String',
@@ -149,6 +154,12 @@ module DocSpring
149
154
  self.password = attributes[:'password']
150
155
  end
151
156
 
157
+ if attributes.key?(:'output_formats')
158
+ if (value = attributes[:'output_formats']).is_a?(Array)
159
+ self.output_formats = value
160
+ end
161
+ end
162
+
152
163
  if attributes.key?(:'expires_in')
153
164
  self.expires_in = attributes[:'expires_in']
154
165
  end
@@ -191,6 +202,16 @@ module DocSpring
191
202
  true
192
203
  end
193
204
 
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] output_formats Value to be assigned
207
+ def output_formats=(output_formats)
208
+ if output_formats.nil?
209
+ fail ArgumentError, 'output_formats cannot be nil'
210
+ end
211
+
212
+ @output_formats = output_formats
213
+ end
214
+
194
215
  # Checks equality by comparing each attribute.
195
216
  # @param [Object] Object to be compared
196
217
  def ==(o)
@@ -201,6 +222,7 @@ module DocSpring
201
222
  data == o.data &&
202
223
  metadata == o.metadata &&
203
224
  password == o.password &&
225
+ output_formats == o.output_formats &&
204
226
  expires_in == o.expires_in &&
205
227
  field_overrides == o.field_overrides &&
206
228
  html == o.html &&
@@ -218,7 +240,7 @@ module DocSpring
218
240
  # Calculates hash code according to all attributes.
219
241
  # @return [Integer] Hash code
220
242
  def hash
221
- [test, editable, data, metadata, password, expires_in, field_overrides, html, css, template_id, template_version].hash
243
+ [test, editable, data, metadata, password, output_formats, expires_in, field_overrides, html, css, template_id, template_version].hash
222
244
  end
223
245
 
224
246
  # Builds the object from hash
@@ -43,7 +43,7 @@ module DocSpring
43
43
  # Attribute type mapping.
44
44
  def self.openapi_types
45
45
  {
46
- :'data' => :'Array<Submission>',
46
+ :'data' => :'Array<SubmissionSummary>',
47
47
  :'next_cursor' => :'String'
48
48
  }
49
49
  end