docspring 4.7.0 → 4.8.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 (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +18 -1
  4. data/lib/docspring/api/client.rb +1354 -123
  5. data/lib/docspring/api_client.rb +1 -1
  6. data/lib/docspring/models/add_page_numbers_request.rb +279 -0
  7. data/lib/docspring/models/ask_support_help_request.rb +1 -1
  8. data/lib/docspring/models/base64_job_source.rb +222 -0
  9. data/lib/docspring/models/combined_pdf_job_source.rb +222 -0
  10. data/lib/docspring/models/compress_pdf_request.rb +207 -0
  11. data/lib/docspring/models/create_template_request.rb +22 -2
  12. data/lib/docspring/models/custom_file_job_source.rb +222 -0
  13. data/lib/docspring/models/decrypt_pdf_request.rb +217 -0
  14. data/lib/docspring/models/encrypt_pdf_request.rb +237 -0
  15. data/lib/docspring/models/error_info.rb +15 -5
  16. data/lib/docspring/models/extract_pages_request.rb +234 -0
  17. data/lib/docspring/models/field.rb +1 -1
  18. data/lib/docspring/models/field_input.rb +1 -1
  19. data/lib/docspring/models/flatten_pdf_request.rb +207 -0
  20. data/lib/docspring/models/html_engine_options.rb +1 -1
  21. data/lib/docspring/models/html_engine_options_input.rb +1 -1
  22. data/lib/docspring/models/htmlto_pdf_request.rb +322 -0
  23. data/lib/docspring/models/image_format.rb +41 -0
  24. data/lib/docspring/models/images_to_pdf_request.rb +241 -0
  25. data/lib/docspring/models/job.rb +508 -0
  26. data/lib/docspring/models/job_file.rb +308 -0
  27. data/lib/docspring/models/job_file_job_source.rb +232 -0
  28. data/lib/docspring/models/job_html_engine.rb +41 -0
  29. data/lib/docspring/models/job_list.rb +200 -0
  30. data/lib/docspring/models/job_operation.rb +53 -0
  31. data/lib/docspring/models/job_operation_filter.rb +53 -0
  32. data/lib/docspring/models/job_options.rb +392 -0
  33. data/lib/docspring/models/job_page_margin.rb +198 -0
  34. data/lib/docspring/models/job_page_size.rb +51 -0
  35. data/lib/docspring/models/job_source.rb +267 -0
  36. data/lib/docspring/models/job_source_input.rb +66 -0
  37. data/lib/docspring/models/job_source_type.rb +46 -0
  38. data/lib/docspring/models/job_state.rb +42 -0
  39. data/lib/docspring/models/markdown_to_pdf_request.rb +312 -0
  40. data/lib/docspring/models/page_image.rb +3 -3
  41. data/lib/docspring/models/page_number_position.rb +45 -0
  42. data/lib/docspring/models/page_size.rb +45 -0
  43. data/lib/docspring/models/pdf_permissions.rb +198 -0
  44. data/lib/docspring/models/pdf_permissions_input.rb +198 -0
  45. data/lib/docspring/models/pdfto_images_request.rb +269 -0
  46. data/lib/docspring/models/pdfto_text_request.rb +217 -0
  47. data/lib/docspring/models/rotate_pages_request.rb +244 -0
  48. data/lib/docspring/models/split_pdf_request.rb +229 -0
  49. data/lib/docspring/models/submission_job_source.rb +222 -0
  50. data/lib/docspring/models/template.rb +41 -2
  51. data/lib/docspring/models/template_blank_page.rb +212 -0
  52. data/lib/docspring/models/template_blank_page_input.rb +212 -0
  53. data/lib/docspring/models/template_document.rb +1 -1
  54. data/lib/docspring/models/template_html_engine.rb +41 -0
  55. data/lib/docspring/models/template_page_images.rb +3 -3
  56. data/lib/docspring/models/template_page_list.rb +243 -0
  57. data/lib/docspring/models/template_page_list_input.rb +243 -0
  58. data/lib/docspring/models/template_page_processing_status.rb +28 -1
  59. data/lib/docspring/models/update_template_request.rb +33 -2
  60. data/lib/docspring/models/upload_job_source.rb +222 -0
  61. data/lib/docspring/models/url_job_source.rb +222 -0
  62. data/lib/docspring/models/watermark_layer.rb +41 -0
  63. data/lib/docspring/models/watermark_pdf_request.rb +316 -0
  64. data/lib/docspring/models/webhook_event_type.rb +4 -1
  65. data/lib/docspring/request_schemas.json +1997 -45
  66. data/lib/docspring/version.rb +1 -1
  67. data/lib/docspring.rb +45 -0
  68. metadata +46 -1
@@ -61,6 +61,9 @@ module DocSpring
61
61
  # When the template was last updated.
62
62
  attr_accessor :updated_at
63
63
 
64
+ # A PDF template's pages in the order its generated PDFs have them, when they've been reordered or deleted, or blank pages added (the Pages tab in the template editor). Null when generated PDFs have the PDF's pages in order, and for other templates. Setting it to null puts the PDF's pages back in order and removes the blank pages. Replacing the PDF resets it. Fields stay on their pages: a deleted page's fields are kept, and left out of the template's fields, its schema and generated PDFs until the page is back. A blank page with fields can be deleted (left out of `pages`), but not removed from `blank_pages`.
65
+ attr_accessor :page_list
66
+
64
67
  # The published version this is, such as `1.2.0`. Null for the draft.
65
68
  attr_accessor :version
66
69
 
@@ -204,9 +207,15 @@ module DocSpring
204
207
  # How an HTML template's PDFs are printed. Null for other templates. Setting it replaces the whole object: options left out use their defaults.
205
208
  attr_accessor :html_engine_options
206
209
 
207
- # 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.
210
+ # 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 (except Markdown templates), default to false, which prints every value as HTML. Null for other templates.
208
211
  attr_accessor :html_escape_data
209
212
 
213
+ # Whether an HTML template's `html` is Markdown: GitHub Flavored Markdown, which can also hold HTML. DocSpring renders its Liquid, then converts it to HTML, and values it prints are never read as Markdown. The header and footer HTML stay HTML. A Markdown template created without `scss` gets DocSpring's Markdown stylesheet. Defaults to false. Null for other templates.
214
+ attr_accessor :markdown
215
+
216
+ # What renders an HTML template's PDFs: `standard` (DocSpring's own renderer, much faster, and its previews follow your changes in the template editor) or `chromium` (headless Chrome, for JavaScript and the CSS that `standard` doesn't support). New HTML templates use your account's default for new templates of their kind, Markdown or not (`standard` unless your account chose `chromium`). Null for other templates.
217
+ attr_accessor :html_engine
218
+
210
219
  # 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.
211
220
  attr_accessor :layout
212
221
 
@@ -259,6 +268,7 @@ module DocSpring
259
268
  :'last_changed_at' => :'last_changed_at',
260
269
  :'created_at' => :'created_at',
261
270
  :'updated_at' => :'updated_at',
271
+ :'page_list' => :'page_list',
262
272
  :'version' => :'version',
263
273
  :'add_signature_request_submission_id_footers' => :'add_signature_request_submission_id_footers',
264
274
  :'ai_field_naming_language' => :'ai_field_naming_language',
@@ -308,6 +318,8 @@ module DocSpring
308
318
  :'footer_html' => :'footer_html',
309
319
  :'html_engine_options' => :'html_engine_options',
310
320
  :'html_escape_data' => :'html_escape_data',
321
+ :'markdown' => :'markdown',
322
+ :'html_engine' => :'html_engine',
311
323
  :'layout' => :'layout',
312
324
  :'embed_edit_token' => :'embed_edit_token',
313
325
  :'versions' => :'versions',
@@ -343,6 +355,7 @@ module DocSpring
343
355
  :'last_changed_at' => :'Time',
344
356
  :'created_at' => :'Time',
345
357
  :'updated_at' => :'Time',
358
+ :'page_list' => :'TemplatePageList',
346
359
  :'version' => :'String',
347
360
  :'add_signature_request_submission_id_footers' => :'Boolean',
348
361
  :'ai_field_naming_language' => :'AiFieldNamingLanguage',
@@ -392,6 +405,8 @@ module DocSpring
392
405
  :'footer_html' => :'String',
393
406
  :'html_engine_options' => :'HtmlEngineOptions',
394
407
  :'html_escape_data' => :'Boolean',
408
+ :'markdown' => :'Boolean',
409
+ :'html_engine' => :'TemplateHTMLEngine',
395
410
  :'layout' => :'Hash<String, Object>',
396
411
  :'embed_edit_token' => :'String',
397
412
  :'versions' => :'Array<TemplateVersion>',
@@ -409,6 +424,7 @@ module DocSpring
409
424
  :'latest_version',
410
425
  :'version_published_at',
411
426
  :'last_changed_at',
427
+ :'page_list',
412
428
  :'version',
413
429
  :'ai_field_naming_language',
414
430
  :'redirect_url',
@@ -427,6 +443,8 @@ module DocSpring
427
443
  :'footer_html',
428
444
  :'html_engine_options',
429
445
  :'html_escape_data',
446
+ :'markdown',
447
+ :'html_engine',
430
448
  :'layout',
431
449
  :'embed_edit_token',
432
450
  ])
@@ -548,6 +566,12 @@ module DocSpring
548
566
  self.updated_at = nil
549
567
  end
550
568
 
569
+ if attributes.key?(:'page_list')
570
+ self.page_list = attributes[:'page_list']
571
+ else
572
+ self.page_list = nil
573
+ end
574
+
551
575
  if attributes.key?(:'version')
552
576
  self.version = attributes[:'version']
553
577
  else
@@ -860,6 +884,18 @@ module DocSpring
860
884
  self.html_escape_data = nil
861
885
  end
862
886
 
887
+ if attributes.key?(:'markdown')
888
+ self.markdown = attributes[:'markdown']
889
+ else
890
+ self.markdown = nil
891
+ end
892
+
893
+ if attributes.key?(:'html_engine')
894
+ self.html_engine = attributes[:'html_engine']
895
+ else
896
+ self.html_engine = nil
897
+ end
898
+
863
899
  if attributes.key?(:'layout')
864
900
  if (value = attributes[:'layout']).is_a?(Hash) || value.nil?
865
901
  self.layout = value
@@ -1539,6 +1575,7 @@ module DocSpring
1539
1575
  last_changed_at == o.last_changed_at &&
1540
1576
  created_at == o.created_at &&
1541
1577
  updated_at == o.updated_at &&
1578
+ page_list == o.page_list &&
1542
1579
  version == o.version &&
1543
1580
  add_signature_request_submission_id_footers == o.add_signature_request_submission_id_footers &&
1544
1581
  ai_field_naming_language == o.ai_field_naming_language &&
@@ -1588,6 +1625,8 @@ module DocSpring
1588
1625
  footer_html == o.footer_html &&
1589
1626
  html_engine_options == o.html_engine_options &&
1590
1627
  html_escape_data == o.html_escape_data &&
1628
+ markdown == o.markdown &&
1629
+ html_engine == o.html_engine &&
1591
1630
  layout == o.layout &&
1592
1631
  embed_edit_token == o.embed_edit_token &&
1593
1632
  versions == o.versions &&
@@ -1603,7 +1642,7 @@ module DocSpring
1603
1642
  # Calculates hash code according to all attributes.
1604
1643
  # @return [Integer] Hash code
1605
1644
  def hash
1606
- [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, continue_before_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, form_sections_in_order, has_slack_webhook_url, last_changed_by, defaults, field_dependencies, field_groups, form_sections, signer_roles, signature_request_cc, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, layout, embed_edit_token, versions, override_account_expiry].hash
1645
+ [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, page_list, version, add_signature_request_submission_id_footers, ai_field_naming_language, allow_additional_properties, allow_skipping_optional_fields, continue_before_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, form_sections_in_order, has_slack_webhook_url, last_changed_by, defaults, field_dependencies, field_groups, form_sections, signer_roles, signature_request_cc, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, markdown, html_engine, layout, embed_edit_token, versions, override_account_expiry].hash
1607
1646
  end
1608
1647
 
1609
1648
  # Builds the object from hash
@@ -0,0 +1,212 @@
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 blank page added to a PDF template.
18
+ class TemplateBlankPage < ApiModelBase
19
+ # The page's width in PDF points.
20
+ attr_accessor :width
21
+
22
+ # The page's height in PDF points.
23
+ attr_accessor :height
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'width' => :'width',
29
+ :'height' => :'height'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'width' => :'Float',
47
+ :'height' => :'Float'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Returns attribute type mapping
58
+ def self.acceptable_openapi_types
59
+ openapi_types
60
+ end
61
+
62
+ # Returns the nullable attributes
63
+ def self.acceptable_openapi_nullable
64
+ openapi_nullable
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::TemplateBlankPage` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::TemplateBlankPage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'width')
84
+ self.width = attributes[:'width']
85
+ else
86
+ self.width = nil
87
+ end
88
+
89
+ if attributes.key?(:'height')
90
+ self.height = attributes[:'height']
91
+ else
92
+ self.height = nil
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if @width.nil?
102
+ invalid_properties.push('invalid value for "width", width cannot be nil.')
103
+ end
104
+
105
+ if @height.nil?
106
+ invalid_properties.push('invalid value for "height", height cannot be nil.')
107
+ end
108
+
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ warn '[DEPRECATED] the `valid?` method is obsolete'
116
+ return false if @width.nil?
117
+ return false if @height.nil?
118
+ true
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] width Value to be assigned
123
+ def width=(width)
124
+ if width.nil?
125
+ fail ArgumentError, 'width cannot be nil'
126
+ end
127
+
128
+ @width = width
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] height Value to be assigned
133
+ def height=(height)
134
+ if height.nil?
135
+ fail ArgumentError, 'height cannot be nil'
136
+ end
137
+
138
+ @height = height
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ width == o.width &&
147
+ height == o.height
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [width, height].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ return nil unless attributes.is_a?(Hash)
167
+ attributes = attributes.transform_keys(&:to_sym)
168
+ # include attributes inherited from allOf parents (the nearest declaration wins)
169
+ map = acceptable_attribute_map
170
+ transformed_hash = {}
171
+ acceptable_openapi_types.each_pair do |key, type|
172
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
173
+ transformed_hash["#{key}"] = nil
174
+ elsif type =~ /\AArray<(.*)>/i
175
+ # check to ensure the input is an array given that the attribute
176
+ # is documented as an array but the input is not
177
+ if attributes[map[key]].is_a?(Array)
178
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
179
+ end
180
+ elsif !attributes[map[key]].nil?
181
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
182
+ end
183
+ end
184
+ # Responses can include enum values added after this client was released, so the enum setters
185
+ # accept any value while the model is built from a response
186
+ allocate.tap do |model|
187
+ model.instance_variable_set(:@_skip_enum_validation, true)
188
+ model.send(:initialize, transformed_hash)
189
+ model.remove_instance_variable(:@_skip_enum_validation)
190
+ end
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ # include attributes inherited from allOf parents (the nearest declaration wins)
198
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ end
211
+
212
+ end
@@ -0,0 +1,212 @@
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 blank page added to a PDF template.
18
+ class TemplateBlankPageInput < ApiModelBase
19
+ # The page's width in PDF points.
20
+ attr_accessor :width
21
+
22
+ # The page's height in PDF points.
23
+ attr_accessor :height
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'width' => :'width',
29
+ :'height' => :'height'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'width' => :'Float',
47
+ :'height' => :'Float'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Returns attribute type mapping
58
+ def self.acceptable_openapi_types
59
+ openapi_types
60
+ end
61
+
62
+ # Returns the nullable attributes
63
+ def self.acceptable_openapi_nullable
64
+ openapi_nullable
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::TemplateBlankPageInput` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::TemplateBlankPageInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'width')
84
+ self.width = attributes[:'width']
85
+ else
86
+ self.width = nil
87
+ end
88
+
89
+ if attributes.key?(:'height')
90
+ self.height = attributes[:'height']
91
+ else
92
+ self.height = nil
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if @width.nil?
102
+ invalid_properties.push('invalid value for "width", width cannot be nil.')
103
+ end
104
+
105
+ if @height.nil?
106
+ invalid_properties.push('invalid value for "height", height cannot be nil.')
107
+ end
108
+
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ warn '[DEPRECATED] the `valid?` method is obsolete'
116
+ return false if @width.nil?
117
+ return false if @height.nil?
118
+ true
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] width Value to be assigned
123
+ def width=(width)
124
+ if width.nil?
125
+ fail ArgumentError, 'width cannot be nil'
126
+ end
127
+
128
+ @width = width
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] height Value to be assigned
133
+ def height=(height)
134
+ if height.nil?
135
+ fail ArgumentError, 'height cannot be nil'
136
+ end
137
+
138
+ @height = height
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ width == o.width &&
147
+ height == o.height
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [width, height].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ return nil unless attributes.is_a?(Hash)
167
+ attributes = attributes.transform_keys(&:to_sym)
168
+ # include attributes inherited from allOf parents (the nearest declaration wins)
169
+ map = acceptable_attribute_map
170
+ transformed_hash = {}
171
+ acceptable_openapi_types.each_pair do |key, type|
172
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
173
+ transformed_hash["#{key}"] = nil
174
+ elsif type =~ /\AArray<(.*)>/i
175
+ # check to ensure the input is an array given that the attribute
176
+ # is documented as an array but the input is not
177
+ if attributes[map[key]].is_a?(Array)
178
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
179
+ end
180
+ elsif !attributes[map[key]].nil?
181
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
182
+ end
183
+ end
184
+ # Responses can include enum values added after this client was released, so the enum setters
185
+ # accept any value while the model is built from a response
186
+ allocate.tap do |model|
187
+ model.instance_variable_set(:@_skip_enum_validation, true)
188
+ model.send(:initialize, transformed_hash)
189
+ model.remove_instance_variable(:@_skip_enum_validation)
190
+ end
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ # include attributes inherited from allOf parents (the nearest declaration wins)
198
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ end
211
+
212
+ end
@@ -34,7 +34,7 @@ module DocSpring
34
34
  # Whether the fields are being re-imported from this PDF (`reimport_fields` when the PDF was replaced): `requested` while DocSpring processes the PDF, then `imported`, or `no_fields` when the PDF had no fillable fields and the template kept its fields. `none` when no re-import was asked for, or when it couldn't run (the PDF couldn't be processed, or the template was locked or published while it was).
35
35
  attr_accessor :field_reimport_state
36
36
 
37
- # Each page's width and height in PDF points. Null until the PDF has been processed.
37
+ # The width and height in PDF points of each page of the PDF, in the PDF's own order: with a `page_list`, page 1 of the generated PDFs is the page `page_list.pages[0]` names. Null until the PDF has been processed.
38
38
  attr_accessor :page_dimensions
39
39
 
40
40
  # Whether the PDF has fillable form fields. Null until DocSpring has read the PDF, and for a Word document.
@@ -0,0 +1,41 @@
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 TemplateHTMLEngine
18
+ STANDARD = "standard".freeze
19
+ CHROMIUM = "chromium".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [STANDARD, CHROMIUM].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ # Only responses are built from hashes, and a value added to the API after this client was released is kept as it
37
+ # is: the constants are the values this client knows
38
+ value
39
+ end
40
+ end
41
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DocSpring
17
- # A JPEG image of each page of a PDF template's PDF, at 140 DPI (a US Letter page is 1190 x 1540 pixels), to see the pages that fields are placed on. The template's `document.page_dimensions` gives each page's size in PDF points. Fields are placed in units where every page is 2480 wide: to place a field at a point on an image, multiply the point's pixel coordinates by 2480 and divide them by the image's `width`.
17
+ # A JPEG image of each page of a PDF template, at 140 DPI (a US Letter page is 1190 x 1540 pixels), to see the pages that fields are placed on. They're the pages its generated PDFs have, in their order: a template with a `page_list` leaves out its deleted pages, and a blank page that was added has no image file (its `download_url` is null, and the page is white, `width` by `height` pixels). Fields are placed in units where every page is 2480 wide: to place a field at a point on an image, multiply the point's pixel coordinates by 2480 and divide them by the image's `width`.
18
18
  class TemplatePageImages < ApiModelBase
19
19
  # The template's ID.
20
20
  attr_accessor :template_id
@@ -22,10 +22,10 @@ module DocSpring
22
22
  # The published version the images are of, such as `1.2.0`. Null for the draft.
23
23
  attr_accessor :version
24
24
 
25
- # How many pages the PDF has.
25
+ # How many pages the template's generated PDFs have. With a `page_list`, this can differ from the PDF's own `document.page_count`.
26
26
  attr_accessor :page_count
27
27
 
28
- # An image of each page, in order: `pages[0]` is page 1. Their `download_url`s expire, so get them again when you need them.
28
+ # An image of each page, in order: `pages[0]` is page 1, the page a field's `page` 1 is. Their `download_url`s expire, so get them again when you need them.
29
29
  attr_accessor :pages
30
30
 
31
31
  # Attribute mapping from ruby-style variable name to JSON key.