docspring 4.0.0 → 4.1.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 (132) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +84 -0
  3. data/.travis.yml +1 -1
  4. data/CHANGELOG.md +24 -0
  5. data/Gemfile.lock +2 -2
  6. data/README.md +10 -1
  7. data/docs/AddTemplateFieldsRequest.md +18 -0
  8. data/docs/Client.md +704 -33
  9. data/docs/CreateSubmissionBatchRequest.md +2 -0
  10. data/docs/CreateSubmissionRequest.md +2 -0
  11. data/docs/CreateTemplateRequest.md +10 -2
  12. data/docs/Field.md +198 -0
  13. data/docs/FieldDependency.md +22 -0
  14. data/docs/FieldDependencyInput.md +22 -0
  15. data/docs/FieldGroup.md +32 -0
  16. data/docs/FieldGroupInput.md +30 -0
  17. data/docs/FieldGroupType.md +15 -0
  18. data/docs/FieldInput.md +196 -0
  19. data/docs/FieldType.md +15 -0
  20. data/docs/GenerateFilesFormat.md +15 -0
  21. data/docs/GenerateSubmissionFilesRequest.md +18 -0
  22. data/docs/OutputFormat.md +15 -0
  23. data/docs/PageImage.md +34 -0
  24. data/docs/PageImages.md +24 -0
  25. data/docs/PredefinedField.md +30 -0
  26. data/docs/PredefinedFieldInput.md +30 -0
  27. data/docs/RemoveTemplateFieldsRequest.md +18 -0
  28. data/docs/ReorderTemplateFieldsRequest.md +18 -0
  29. data/docs/Submission.md +3 -1
  30. data/docs/SubmissionFiles.md +3 -1
  31. data/docs/SubmissionInput.md +2 -0
  32. data/docs/SubmissionValidation.md +24 -0
  33. data/docs/Template.md +6 -0
  34. data/docs/TemplateDiff.md +30 -0
  35. data/docs/TemplateDiffSummary.md +28 -0
  36. data/docs/TemplateDocument.md +3 -3
  37. data/docs/TemplateFieldChange.md +24 -0
  38. data/docs/TemplateFieldChanges.md +24 -0
  39. data/docs/TemplateFieldDependency.md +1 -1
  40. data/docs/TemplateFieldDependencyInput.md +1 -1
  41. data/docs/TemplateFieldMove.md +22 -0
  42. data/docs/TemplateFields.md +22 -0
  43. data/docs/TemplatePageImages.md +24 -0
  44. data/docs/UpdateTemplateDocumentRequest.md +6 -2
  45. data/docs/UpdateTemplateFieldsRequest.md +18 -0
  46. data/docs/UpdateTemplateRequest.md +6 -0
  47. data/docs/ValidateSubmissionRequest.md +38 -0
  48. data/lib/docspring/api/client.rb +666 -18
  49. data/lib/docspring/api_client.rb +1 -1
  50. data/lib/docspring/models/add_template_fields_request.rb +187 -0
  51. data/lib/docspring/models/create_submission_batch_request.rb +23 -1
  52. data/lib/docspring/models/create_submission_request.rb +23 -1
  53. data/lib/docspring/models/create_template_request.rb +48 -3
  54. data/lib/docspring/models/field.rb +2217 -0
  55. data/lib/docspring/models/field_dependency.rb +246 -0
  56. data/lib/docspring/models/field_dependency_input.rb +246 -0
  57. data/lib/docspring/models/field_group.rb +368 -0
  58. data/lib/docspring/models/field_group_input.rb +247 -0
  59. data/lib/docspring/models/field_group_type.rb +41 -0
  60. data/lib/docspring/models/field_input.rb +1109 -0
  61. data/lib/docspring/models/field_type.rb +54 -0
  62. data/lib/docspring/models/generate_files_format.rb +40 -0
  63. data/lib/docspring/models/generate_submission_files_request.rb +187 -0
  64. data/lib/docspring/models/output_format.rb +41 -0
  65. data/lib/docspring/models/page_image.rb +359 -0
  66. data/lib/docspring/models/page_images.rb +248 -0
  67. data/lib/docspring/models/predefined_field.rb +287 -0
  68. data/lib/docspring/models/predefined_field_input.rb +287 -0
  69. data/lib/docspring/models/remove_template_fields_request.rb +187 -0
  70. data/lib/docspring/models/reorder_template_fields_request.rb +187 -0
  71. data/lib/docspring/models/submission.rb +31 -2
  72. data/lib/docspring/models/submission_files.rb +13 -4
  73. data/lib/docspring/models/submission_input.rb +23 -1
  74. data/lib/docspring/models/submission_validation.rb +234 -0
  75. data/lib/docspring/models/template.rb +74 -1
  76. data/lib/docspring/models/template_diff.rb +321 -0
  77. data/lib/docspring/models/template_diff_summary.rb +320 -0
  78. data/lib/docspring/models/template_document.rb +3 -3
  79. data/lib/docspring/models/template_document_state.rb +3 -1
  80. data/lib/docspring/models/template_field_change.rb +266 -0
  81. data/lib/docspring/models/template_field_changes.rb +274 -0
  82. data/lib/docspring/models/template_field_dependency.rb +1 -1
  83. data/lib/docspring/models/template_field_dependency_input.rb +1 -1
  84. data/lib/docspring/models/template_field_move.rb +239 -0
  85. data/lib/docspring/models/template_fields.rb +227 -0
  86. data/lib/docspring/models/template_page_images.rb +254 -0
  87. data/lib/docspring/models/update_template_document_request.rb +23 -20
  88. data/lib/docspring/models/update_template_fields_request.rb +187 -0
  89. data/lib/docspring/models/update_template_request.rb +38 -1
  90. data/lib/docspring/models/validate_submission_request.rb +288 -0
  91. data/lib/docspring/request_schemas.json +3364 -1584
  92. data/lib/docspring/version.rb +1 -1
  93. data/lib/docspring.rb +28 -0
  94. data/spec/api/client_spec.rb +128 -9
  95. data/spec/models/add_template_fields_request_spec.rb +36 -0
  96. data/spec/models/create_submission_batch_request_spec.rb +6 -0
  97. data/spec/models/create_submission_request_spec.rb +6 -0
  98. data/spec/models/create_template_request_spec.rb +24 -0
  99. data/spec/models/field_dependency_input_spec.rb +48 -0
  100. data/spec/models/field_dependency_spec.rb +48 -0
  101. data/spec/models/field_group_input_spec.rb +72 -0
  102. data/spec/models/field_group_spec.rb +78 -0
  103. data/spec/models/field_group_type_spec.rb +30 -0
  104. data/spec/models/field_input_spec.rb +570 -0
  105. data/spec/models/field_spec.rb +576 -0
  106. data/spec/models/field_type_spec.rb +30 -0
  107. data/spec/models/generate_files_format_spec.rb +30 -0
  108. data/spec/models/generate_submission_files_request_spec.rb +36 -0
  109. data/spec/models/output_format_spec.rb +30 -0
  110. data/spec/models/page_image_spec.rb +84 -0
  111. data/spec/models/page_images_spec.rb +54 -0
  112. data/spec/models/predefined_field_input_spec.rb +72 -0
  113. data/spec/models/predefined_field_spec.rb +72 -0
  114. data/spec/models/remove_template_fields_request_spec.rb +36 -0
  115. data/spec/models/reorder_template_fields_request_spec.rb +36 -0
  116. data/spec/models/submission_files_spec.rb +6 -0
  117. data/spec/models/submission_input_spec.rb +6 -0
  118. data/spec/models/submission_spec.rb +6 -0
  119. data/spec/models/submission_validation_spec.rb +54 -0
  120. data/spec/models/template_diff_spec.rb +72 -0
  121. data/spec/models/template_diff_summary_spec.rb +66 -0
  122. data/spec/models/template_field_change_spec.rb +54 -0
  123. data/spec/models/template_field_changes_spec.rb +54 -0
  124. data/spec/models/template_field_move_spec.rb +48 -0
  125. data/spec/models/template_fields_spec.rb +48 -0
  126. data/spec/models/template_page_images_spec.rb +54 -0
  127. data/spec/models/template_spec.rb +18 -0
  128. data/spec/models/update_template_document_request_spec.rb +12 -0
  129. data/spec/models/update_template_fields_request_spec.rb +36 -0
  130. data/spec/models/update_template_request_spec.rb +18 -0
  131. data/spec/models/validate_submission_request_spec.rb +96 -0
  132. metadata +113 -1
@@ -33,7 +33,7 @@ module DocSpring
33
33
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
34
34
  def initialize(config = Configuration.default)
35
35
  @config = config
36
- @user_agent = "docspring-ruby-4.0.0"
36
+ @user_agent = "docspring-ruby-4.1.0"
37
37
  @default_headers = {
38
38
  'Content-Type' => 'application/json',
39
39
  'User-Agent' => @user_agent
@@ -0,0 +1,187 @@
1
+ =begin
2
+ #DocSpring API
3
+
4
+ #Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or 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
+ # The fields to add to the template's draft.
18
+ class AddTemplateFieldsRequest < ApiModelBase
19
+ # The fields to add. Settings left out have their defaults, except that a field with the name of other fields takes their shared settings. Shared settings it sets change them for every field with the name.
20
+ attr_accessor :fields
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'fields' => :'fields'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'fields' => :'Array<FieldInput>'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Returns attribute type mapping
53
+ def self.acceptable_openapi_types
54
+ openapi_types
55
+ end
56
+
57
+ # Returns the nullable attributes
58
+ def self.acceptable_openapi_nullable
59
+ openapi_nullable
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::AddTemplateFieldsRequest` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::AddTemplateFieldsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'fields')
79
+ if (value = attributes[:'fields']).is_a?(Array)
80
+ self.fields = value
81
+ end
82
+ else
83
+ self.fields = nil
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
91
+ invalid_properties = Array.new
92
+ if @fields.nil?
93
+ invalid_properties.push('invalid value for "fields", fields cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @fields.nil?
104
+ true
105
+ end
106
+
107
+ # Custom attribute writer method with validation
108
+ # @param [Object] fields Value to be assigned
109
+ def fields=(fields)
110
+ if fields.nil?
111
+ fail ArgumentError, 'fields cannot be nil'
112
+ end
113
+
114
+ @fields = fields
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ fields == o.fields
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [fields].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ attributes = attributes.transform_keys(&:to_sym)
143
+ # include attributes inherited from allOf parents (the nearest declaration wins)
144
+ map = acceptable_attribute_map
145
+ transformed_hash = {}
146
+ acceptable_openapi_types.each_pair do |key, type|
147
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
148
+ transformed_hash["#{key}"] = nil
149
+ elsif type =~ /\AArray<(.*)>/i
150
+ # check to ensure the input is an array given that the attribute
151
+ # is documented as an array but the input is not
152
+ if attributes[map[key]].is_a?(Array)
153
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
154
+ end
155
+ elsif !attributes[map[key]].nil?
156
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
157
+ end
158
+ end
159
+ # Responses can include enum values added after this client was released, so the enum setters
160
+ # accept any value while the model is built from a response
161
+ allocate.tap do |model|
162
+ model.instance_variable_set(:@_skip_enum_validation, true)
163
+ model.send(:initialize, transformed_hash)
164
+ model.remove_instance_variable(:@_skip_enum_validation)
165
+ end
166
+ end
167
+
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ # include attributes inherited from allOf parents (the nearest declaration wins)
173
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
174
+ value = self.send(attr)
175
+ if value.nil?
176
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
177
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
178
+ end
179
+
180
+ hash[param] = _to_hash(value)
181
+ end
182
+ hash
183
+ end
184
+
185
+ end
186
+
187
+ end
@@ -28,6 +28,9 @@ module DocSpring
28
28
  # The default `test` for each submission that doesn't set its own.
29
29
  attr_accessor :test
30
30
 
31
+ # The default `output_formats` for each submission that doesn't set its own.
32
+ attr_accessor :output_formats
33
+
31
34
  # Up to 50 submissions. Each one takes the properties of POST /templates/{template_id}/submissions except `signature_requests`, plus `template_id` and `template_version` when it uses a different template from the batch.
32
35
  attr_accessor :submissions
33
36
 
@@ -38,6 +41,7 @@ module DocSpring
38
41
  :'template_id' => :'template_id',
39
42
  :'template_version' => :'template_version',
40
43
  :'test' => :'test',
44
+ :'output_formats' => :'output_formats',
41
45
  :'submissions' => :'submissions'
42
46
  }
43
47
  end
@@ -59,6 +63,7 @@ module DocSpring
59
63
  :'template_id' => :'String',
60
64
  :'template_version' => :'String',
61
65
  :'test' => :'Boolean',
66
+ :'output_formats' => :'Array<OutputFormat>',
62
67
  :'submissions' => :'Array<SubmissionInput>'
63
68
  }
64
69
  end
@@ -113,6 +118,12 @@ module DocSpring
113
118
  self.test = attributes[:'test']
114
119
  end
115
120
 
121
+ if attributes.key?(:'output_formats')
122
+ if (value = attributes[:'output_formats']).is_a?(Array)
123
+ self.output_formats = value
124
+ end
125
+ end
126
+
116
127
  if attributes.key?(:'submissions')
117
128
  if (value = attributes[:'submissions']).is_a?(Array)
118
129
  self.submissions = value
@@ -142,6 +153,16 @@ module DocSpring
142
153
  true
143
154
  end
144
155
 
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] output_formats Value to be assigned
158
+ def output_formats=(output_formats)
159
+ if output_formats.nil?
160
+ fail ArgumentError, 'output_formats cannot be nil'
161
+ end
162
+
163
+ @output_formats = output_formats
164
+ end
165
+
145
166
  # Custom attribute writer method with validation
146
167
  # @param [Object] submissions Value to be assigned
147
168
  def submissions=(submissions)
@@ -161,6 +182,7 @@ module DocSpring
161
182
  template_id == o.template_id &&
162
183
  template_version == o.template_version &&
163
184
  test == o.test &&
185
+ output_formats == o.output_formats &&
164
186
  submissions == o.submissions
165
187
  end
166
188
 
@@ -173,7 +195,7 @@ module DocSpring
173
195
  # Calculates hash code according to all attributes.
174
196
  # @return [Integer] Hash code
175
197
  def hash
176
- [metadata, template_id, template_version, test, submissions].hash
198
+ [metadata, template_id, template_version, test, output_formats, submissions].hash
177
199
  end
178
200
 
179
201
  # Builds the object from hash
@@ -31,6 +31,9 @@ module DocSpring
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
 
@@ -54,6 +57,7 @@ module DocSpring
54
57
  :'data' => :'data',
55
58
  :'metadata' => :'metadata',
56
59
  :'password' => :'password',
60
+ :'output_formats' => :'output_formats',
57
61
  :'expires_in' => :'expires_in',
58
62
  :'field_overrides' => :'field_overrides',
59
63
  :'html' => :'html',
@@ -80,6 +84,7 @@ module DocSpring
80
84
  :'data' => :'Hash<String, Object>',
81
85
  :'metadata' => :'Hash<String, Object>',
82
86
  :'password' => :'String',
87
+ :'output_formats' => :'Array<OutputFormat>',
83
88
  :'expires_in' => :'Integer',
84
89
  :'field_overrides' => :'Hash<String, FieldOverride>',
85
90
  :'html' => :'String',
@@ -144,6 +149,12 @@ module DocSpring
144
149
  self.password = attributes[:'password']
145
150
  end
146
151
 
152
+ if attributes.key?(:'output_formats')
153
+ if (value = attributes[:'output_formats']).is_a?(Array)
154
+ self.output_formats = value
155
+ end
156
+ end
157
+
147
158
  if attributes.key?(:'expires_in')
148
159
  self.expires_in = attributes[:'expires_in']
149
160
  end
@@ -184,6 +195,16 @@ module DocSpring
184
195
  true
185
196
  end
186
197
 
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] output_formats Value to be assigned
200
+ def output_formats=(output_formats)
201
+ if output_formats.nil?
202
+ fail ArgumentError, 'output_formats cannot be nil'
203
+ end
204
+
205
+ @output_formats = output_formats
206
+ end
207
+
187
208
  # Checks equality by comparing each attribute.
188
209
  # @param [Object] Object to be compared
189
210
  def ==(o)
@@ -194,6 +215,7 @@ module DocSpring
194
215
  data == o.data &&
195
216
  metadata == o.metadata &&
196
217
  password == o.password &&
218
+ output_formats == o.output_formats &&
197
219
  expires_in == o.expires_in &&
198
220
  field_overrides == o.field_overrides &&
199
221
  html == o.html &&
@@ -210,7 +232,7 @@ module DocSpring
210
232
  # Calculates hash code according to all attributes.
211
233
  # @return [Integer] Hash code
212
234
  def hash
213
- [test, editable, data, metadata, password, expires_in, field_overrides, html, css, signature_requests].hash
235
+ [test, editable, data, metadata, password, output_formats, expires_in, field_overrides, html, css, signature_requests].hash
214
236
  end
215
237
 
216
238
  # Builds the object from hash
@@ -100,6 +100,12 @@ module DocSpring
100
100
  # The template's conditional logic rules. Setting them replaces all of the rules.
101
101
  attr_accessor :field_dependencies
102
102
 
103
+ # The field names that people using the embedded template editor choose from, each with the data type and settings a field gets when it's given that name. Setting it replaces the whole list; an empty list turns them off.
104
+ attr_accessor :predefined_fields
105
+
106
+ # 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.
107
+ attr_accessor :predefined_fields_sample_data
108
+
103
109
  # The HTML of an HTML template, as a Liquid template. Null for PDF templates.
104
110
  attr_accessor :html
105
111
 
@@ -115,10 +121,16 @@ module DocSpring
115
121
  # Null resets the options to their defaults.
116
122
  attr_accessor :html_engine_options
117
123
 
118
- # A PDF template's document: the `fields.key` of a file you uploaded with the presigned upload (GET /uploads/presign). Required for a PDF template. To upload the PDF with the request, use POST /templates/upload.
124
+ # A PDF template's document: the `fields.key` of a file you uploaded with the presigned upload (GET /uploads/presign). A PDF template needs one of `cache_id`, `document_url` and `document_base64`. To upload the PDF with the request, use POST /templates/upload.
119
125
  attr_accessor :cache_id
120
126
 
121
- # The PDF's file name, for a `cache_id` (presigned uploads don't send one).
127
+ # An https:// link to the template's PDF (up to 100 MB), instead of `cache_id`. DocSpring downloads it after responding, following redirects to other https:// links: the template's `document.state` is `downloading` until then (sync.api hosts wait for it). If it can't be downloaded, the state is `download_failed` and `document.error_message` says why.
128
+ attr_accessor :document_url
129
+
130
+ # The template's PDF, 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`.
131
+ attr_accessor :document_base64
132
+
133
+ # The PDF's file 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.
122
134
  attr_accessor :filename
123
135
 
124
136
  # Set up the PDF's fields as DocSpring's "Automatically detect fields" upload option does: import or detect the fields, name them with AI, and set up conditional logic. `field_source`, `field_naming` and `field_logic` choose how. Default false. `document.page_processing_statuses` and `document.field_logic_status` show how it's going, and `document.state` becomes `processed` once every page's fields are set up.
@@ -186,12 +198,16 @@ module DocSpring
186
198
  :'slack_webhook_url' => :'slack_webhook_url',
187
199
  :'defaults' => :'defaults',
188
200
  :'field_dependencies' => :'field_dependencies',
201
+ :'predefined_fields' => :'predefined_fields',
202
+ :'predefined_fields_sample_data' => :'predefined_fields_sample_data',
189
203
  :'html' => :'html',
190
204
  :'scss' => :'scss',
191
205
  :'header_html' => :'header_html',
192
206
  :'footer_html' => :'footer_html',
193
207
  :'html_engine_options' => :'html_engine_options',
194
208
  :'cache_id' => :'cache_id',
209
+ :'document_url' => :'document_url',
210
+ :'document_base64' => :'document_base64',
195
211
  :'filename' => :'filename',
196
212
  :'detect_fields' => :'detect_fields',
197
213
  :'field_source' => :'field_source',
@@ -241,12 +257,16 @@ module DocSpring
241
257
  :'slack_webhook_url' => :'String',
242
258
  :'defaults' => :'TemplateDefaultsInput',
243
259
  :'field_dependencies' => :'Array<TemplateFieldDependencyInput>',
260
+ :'predefined_fields' => :'Array<PredefinedFieldInput>',
261
+ :'predefined_fields_sample_data' => :'Hash<String, Object>',
244
262
  :'html' => :'String',
245
263
  :'scss' => :'String',
246
264
  :'header_html' => :'String',
247
265
  :'footer_html' => :'String',
248
266
  :'html_engine_options' => :'HtmlEngineOptionsInput',
249
267
  :'cache_id' => :'String',
268
+ :'document_url' => :'String',
269
+ :'document_base64' => :'String',
250
270
  :'filename' => :'String',
251
271
  :'detect_fields' => :'Boolean',
252
272
  :'field_source' => :'FieldSetupSource',
@@ -263,6 +283,7 @@ module DocSpring
263
283
  :'encrypt_pdfs_password',
264
284
  :'redirect_url',
265
285
  :'slack_webhook_url',
286
+ :'predefined_fields_sample_data',
266
287
  :'html',
267
288
  :'scss',
268
289
  :'header_html',
@@ -415,6 +436,18 @@ module DocSpring
415
436
  end
416
437
  end
417
438
 
439
+ if attributes.key?(:'predefined_fields')
440
+ if (value = attributes[:'predefined_fields']).is_a?(Array)
441
+ self.predefined_fields = value
442
+ end
443
+ end
444
+
445
+ if attributes.key?(:'predefined_fields_sample_data')
446
+ if (value = attributes[:'predefined_fields_sample_data']).is_a?(Hash) || value.nil?
447
+ self.predefined_fields_sample_data = value
448
+ end
449
+ end
450
+
418
451
  if attributes.key?(:'html')
419
452
  self.html = attributes[:'html']
420
453
  end
@@ -439,6 +472,14 @@ module DocSpring
439
472
  self.cache_id = attributes[:'cache_id']
440
473
  end
441
474
 
475
+ if attributes.key?(:'document_url')
476
+ self.document_url = attributes[:'document_url']
477
+ end
478
+
479
+ if attributes.key?(:'document_base64')
480
+ self.document_base64 = attributes[:'document_base64']
481
+ end
482
+
442
483
  if attributes.key?(:'filename')
443
484
  self.filename = attributes[:'filename']
444
485
  end
@@ -523,12 +564,16 @@ module DocSpring
523
564
  slack_webhook_url == o.slack_webhook_url &&
524
565
  defaults == o.defaults &&
525
566
  field_dependencies == o.field_dependencies &&
567
+ predefined_fields == o.predefined_fields &&
568
+ predefined_fields_sample_data == o.predefined_fields_sample_data &&
526
569
  html == o.html &&
527
570
  scss == o.scss &&
528
571
  header_html == o.header_html &&
529
572
  footer_html == o.footer_html &&
530
573
  html_engine_options == o.html_engine_options &&
531
574
  cache_id == o.cache_id &&
575
+ document_url == o.document_url &&
576
+ document_base64 == o.document_base64 &&
532
577
  filename == o.filename &&
533
578
  detect_fields == o.detect_fields &&
534
579
  field_source == o.field_source &&
@@ -545,7 +590,7 @@ module DocSpring
545
590
  # Calculates hash code according to all attributes.
546
591
  # @return [Integer] Hash code
547
592
  def hash
548
- [name, description, template_type, 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, html, scss, header_html, footer_html, html_engine_options, cache_id, filename, detect_fields, field_source, field_naming, field_logic].hash
593
+ [name, description, template_type, 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, cache_id, document_url, document_base64, filename, detect_fields, field_source, field_naming, field_logic].hash
549
594
  end
550
595
 
551
596
  # Builds the object from hash