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
@@ -0,0 +1,254 @@
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
+ # 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`.
18
+ class TemplatePageImages < ApiModelBase
19
+ # The template's ID.
20
+ attr_accessor :template_id
21
+
22
+ # The published version the images are of, such as `1.2.0`. Null for the draft.
23
+ attr_accessor :version
24
+
25
+ # How many pages the PDF has.
26
+ attr_accessor :page_count
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.
29
+ attr_accessor :pages
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'template_id' => :'template_id',
35
+ :'version' => :'version',
36
+ :'page_count' => :'page_count',
37
+ :'pages' => :'pages'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'template_id' => :'String',
55
+ :'version' => :'String',
56
+ :'page_count' => :'Integer',
57
+ :'pages' => :'Array<PageImage>'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'version',
65
+ ])
66
+ end
67
+
68
+ # Returns attribute type mapping
69
+ def self.acceptable_openapi_types
70
+ openapi_types
71
+ end
72
+
73
+ # Returns the nullable attributes
74
+ def self.acceptable_openapi_nullable
75
+ openapi_nullable
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::TemplatePageImages` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::TemplatePageImages`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'template_id')
95
+ self.template_id = attributes[:'template_id']
96
+ else
97
+ self.template_id = nil
98
+ end
99
+
100
+ if attributes.key?(:'version')
101
+ self.version = attributes[:'version']
102
+ else
103
+ self.version = nil
104
+ end
105
+
106
+ if attributes.key?(:'page_count')
107
+ self.page_count = attributes[:'page_count']
108
+ else
109
+ self.page_count = nil
110
+ end
111
+
112
+ if attributes.key?(:'pages')
113
+ if (value = attributes[:'pages']).is_a?(Array)
114
+ self.pages = value
115
+ end
116
+ else
117
+ self.pages = nil
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
125
+ invalid_properties = Array.new
126
+ if @template_id.nil?
127
+ invalid_properties.push('invalid value for "template_id", template_id cannot be nil.')
128
+ end
129
+
130
+ if @page_count.nil?
131
+ invalid_properties.push('invalid value for "page_count", page_count cannot be nil.')
132
+ end
133
+
134
+ if @pages.nil?
135
+ invalid_properties.push('invalid value for "pages", pages cannot be nil.')
136
+ end
137
+
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ warn '[DEPRECATED] the `valid?` method is obsolete'
145
+ return false if @template_id.nil?
146
+ return false if @page_count.nil?
147
+ return false if @pages.nil?
148
+ true
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] template_id Value to be assigned
153
+ def template_id=(template_id)
154
+ if template_id.nil?
155
+ fail ArgumentError, 'template_id cannot be nil'
156
+ end
157
+
158
+ @template_id = template_id
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] page_count Value to be assigned
163
+ def page_count=(page_count)
164
+ if page_count.nil?
165
+ fail ArgumentError, 'page_count cannot be nil'
166
+ end
167
+
168
+ @page_count = page_count
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] pages Value to be assigned
173
+ def pages=(pages)
174
+ if pages.nil?
175
+ fail ArgumentError, 'pages cannot be nil'
176
+ end
177
+
178
+ @pages = pages
179
+ end
180
+
181
+ # Checks equality by comparing each attribute.
182
+ # @param [Object] Object to be compared
183
+ def ==(o)
184
+ return true if self.equal?(o)
185
+ self.class == o.class &&
186
+ template_id == o.template_id &&
187
+ version == o.version &&
188
+ page_count == o.page_count &&
189
+ pages == o.pages
190
+ end
191
+
192
+ # @see the `==` method
193
+ # @param [Object] Object to be compared
194
+ def eql?(o)
195
+ self == o
196
+ end
197
+
198
+ # Calculates hash code according to all attributes.
199
+ # @return [Integer] Hash code
200
+ def hash
201
+ [template_id, version, page_count, pages].hash
202
+ end
203
+
204
+ # Builds the object from hash
205
+ # @param [Hash] attributes Model attributes in the form of hash
206
+ # @return [Object] Returns the model itself
207
+ def self.build_from_hash(attributes)
208
+ return nil unless attributes.is_a?(Hash)
209
+ attributes = attributes.transform_keys(&:to_sym)
210
+ # include attributes inherited from allOf parents (the nearest declaration wins)
211
+ map = acceptable_attribute_map
212
+ transformed_hash = {}
213
+ acceptable_openapi_types.each_pair do |key, type|
214
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
215
+ transformed_hash["#{key}"] = nil
216
+ elsif type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[map[key]].is_a?(Array)
220
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
221
+ end
222
+ elsif !attributes[map[key]].nil?
223
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
224
+ end
225
+ end
226
+ # Responses can include enum values added after this client was released, so the enum setters
227
+ # accept any value while the model is built from a response
228
+ allocate.tap do |model|
229
+ model.instance_variable_set(:@_skip_enum_validation, true)
230
+ model.send(:initialize, transformed_hash)
231
+ model.remove_instance_variable(:@_skip_enum_validation)
232
+ end
233
+ end
234
+
235
+ # Returns the object in the form of hash
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_hash
238
+ hash = {}
239
+ # include attributes inherited from allOf parents (the nearest declaration wins)
240
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ end
253
+
254
+ end
@@ -0,0 +1,356 @@
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
+ # PNG images of a template's pages filled in with data you send (not a PDF), to check how an HTML or PDF template prints with your data before you publish a version or send live data. A preview makes no submission and uses no credits. Its pages are watermarked like a test submission's PDF, and it's deleted an hour after it's created.
18
+ class TemplatePreview < ApiModelBase
19
+ # The preview's ID.
20
+ attr_accessor :id
21
+
22
+ # The template's ID.
23
+ attr_accessor :template_id
24
+
25
+ # The published version that was rendered, such as `1.2.0`. Null for the draft.
26
+ attr_accessor :version
27
+
28
+ # `pending` while it renders (usually a few seconds), then `processed`, or `error` with an `error_message`.
29
+ attr_accessor :state
30
+
31
+ # Why the preview couldn't be rendered, such as an error in an HTML template's Liquid, or a value in the data that a field can't print.
32
+ attr_accessor :error_message
33
+
34
+ # How many pages the template printed, once it's processed.
35
+ attr_accessor :page_count
36
+
37
+ # A PNG image of each page once it's processed, in order: `pages[0]` is page 1. A preview has no PDF. Their `download_url`s expire, so get the preview again when you need them.
38
+ attr_accessor :pages
39
+
40
+ # When the preview and its images are deleted.
41
+ attr_accessor :expires_at
42
+
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
59
+
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'id' => :'id',
69
+ :'template_id' => :'template_id',
70
+ :'version' => :'version',
71
+ :'state' => :'state',
72
+ :'error_message' => :'error_message',
73
+ :'page_count' => :'page_count',
74
+ :'pages' => :'pages',
75
+ :'expires_at' => :'expires_at'
76
+ }
77
+ end
78
+
79
+ # Returns attribute mapping this model knows about
80
+ def self.acceptable_attribute_map
81
+ attribute_map
82
+ end
83
+
84
+ # Returns all the JSON keys this model knows about
85
+ def self.acceptable_attributes
86
+ acceptable_attribute_map.values
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.openapi_types
91
+ {
92
+ :'id' => :'String',
93
+ :'template_id' => :'String',
94
+ :'version' => :'String',
95
+ :'state' => :'TemplatePreviewState',
96
+ :'error_message' => :'String',
97
+ :'page_count' => :'Integer',
98
+ :'pages' => :'Array<PageImage>',
99
+ :'expires_at' => :'Time'
100
+ }
101
+ end
102
+
103
+ # List of attributes with nullable: true
104
+ def self.openapi_nullable
105
+ Set.new([
106
+ :'version',
107
+ :'error_message',
108
+ :'page_count',
109
+ ])
110
+ end
111
+
112
+ # Returns attribute type mapping
113
+ def self.acceptable_openapi_types
114
+ openapi_types
115
+ end
116
+
117
+ # Returns the nullable attributes
118
+ def self.acceptable_openapi_nullable
119
+ openapi_nullable
120
+ end
121
+
122
+ # Initializes the object
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ def initialize(attributes = {})
125
+ if (!attributes.is_a?(Hash))
126
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::TemplatePreview` initialize method"
127
+ end
128
+
129
+ # check to see if the attribute exists and convert string to symbol for hash key
130
+ acceptable_attribute_map = self.class.acceptable_attribute_map
131
+ attributes = attributes.each_with_object({}) { |(k, v), h|
132
+ if (!acceptable_attribute_map.key?(k.to_sym))
133
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::TemplatePreview`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
134
+ end
135
+ h[k.to_sym] = v
136
+ }
137
+
138
+ if attributes.key?(:'id')
139
+ self.id = attributes[:'id']
140
+ else
141
+ self.id = nil
142
+ end
143
+
144
+ if attributes.key?(:'template_id')
145
+ self.template_id = attributes[:'template_id']
146
+ else
147
+ self.template_id = nil
148
+ end
149
+
150
+ if attributes.key?(:'version')
151
+ self.version = attributes[:'version']
152
+ else
153
+ self.version = nil
154
+ end
155
+
156
+ if attributes.key?(:'state')
157
+ self.state = attributes[:'state']
158
+ else
159
+ self.state = nil
160
+ end
161
+
162
+ if attributes.key?(:'error_message')
163
+ self.error_message = attributes[:'error_message']
164
+ else
165
+ self.error_message = nil
166
+ end
167
+
168
+ if attributes.key?(:'page_count')
169
+ self.page_count = attributes[:'page_count']
170
+ else
171
+ self.page_count = nil
172
+ end
173
+
174
+ if attributes.key?(:'pages')
175
+ if (value = attributes[:'pages']).is_a?(Array)
176
+ self.pages = value
177
+ end
178
+ else
179
+ self.pages = nil
180
+ end
181
+
182
+ if attributes.key?(:'expires_at')
183
+ self.expires_at = attributes[:'expires_at']
184
+ else
185
+ self.expires_at = nil
186
+ end
187
+ end
188
+
189
+ # Show invalid properties with the reasons. Usually used together with valid?
190
+ # @return Array for valid properties with the reasons
191
+ def list_invalid_properties
192
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
193
+ invalid_properties = Array.new
194
+ if @id.nil?
195
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
196
+ end
197
+
198
+ if @template_id.nil?
199
+ invalid_properties.push('invalid value for "template_id", template_id cannot be nil.')
200
+ end
201
+
202
+ if @state.nil?
203
+ invalid_properties.push('invalid value for "state", state cannot be nil.')
204
+ end
205
+
206
+ if @pages.nil?
207
+ invalid_properties.push('invalid value for "pages", pages cannot be nil.')
208
+ end
209
+
210
+ if @expires_at.nil?
211
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
212
+ end
213
+
214
+ invalid_properties
215
+ end
216
+
217
+ # Check to see if the all the properties in the model are valid
218
+ # @return true if the model is valid
219
+ def valid?
220
+ warn '[DEPRECATED] the `valid?` method is obsolete'
221
+ return false if @id.nil?
222
+ return false if @template_id.nil?
223
+ return false if @state.nil?
224
+ return false if @pages.nil?
225
+ return false if @expires_at.nil?
226
+ true
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] id Value to be assigned
231
+ def id=(id)
232
+ if id.nil?
233
+ fail ArgumentError, 'id cannot be nil'
234
+ end
235
+
236
+ @id = id
237
+ end
238
+
239
+ # Custom attribute writer method with validation
240
+ # @param [Object] template_id Value to be assigned
241
+ def template_id=(template_id)
242
+ if template_id.nil?
243
+ fail ArgumentError, 'template_id cannot be nil'
244
+ end
245
+
246
+ @template_id = template_id
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] state Value to be assigned
251
+ def state=(state)
252
+ if state.nil?
253
+ fail ArgumentError, 'state cannot be nil'
254
+ end
255
+
256
+ @state = state
257
+ end
258
+
259
+ # Custom attribute writer method with validation
260
+ # @param [Object] pages Value to be assigned
261
+ def pages=(pages)
262
+ if pages.nil?
263
+ fail ArgumentError, 'pages cannot be nil'
264
+ end
265
+
266
+ @pages = pages
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] expires_at Value to be assigned
271
+ def expires_at=(expires_at)
272
+ if expires_at.nil?
273
+ fail ArgumentError, 'expires_at cannot be nil'
274
+ end
275
+
276
+ @expires_at = expires_at
277
+ end
278
+
279
+ # Checks equality by comparing each attribute.
280
+ # @param [Object] Object to be compared
281
+ def ==(o)
282
+ return true if self.equal?(o)
283
+ self.class == o.class &&
284
+ id == o.id &&
285
+ template_id == o.template_id &&
286
+ version == o.version &&
287
+ state == o.state &&
288
+ error_message == o.error_message &&
289
+ page_count == o.page_count &&
290
+ pages == o.pages &&
291
+ expires_at == o.expires_at
292
+ end
293
+
294
+ # @see the `==` method
295
+ # @param [Object] Object to be compared
296
+ def eql?(o)
297
+ self == o
298
+ end
299
+
300
+ # Calculates hash code according to all attributes.
301
+ # @return [Integer] Hash code
302
+ def hash
303
+ [id, template_id, version, state, error_message, page_count, pages, expires_at].hash
304
+ end
305
+
306
+ # Builds the object from hash
307
+ # @param [Hash] attributes Model attributes in the form of hash
308
+ # @return [Object] Returns the model itself
309
+ def self.build_from_hash(attributes)
310
+ return nil unless attributes.is_a?(Hash)
311
+ attributes = attributes.transform_keys(&:to_sym)
312
+ # include attributes inherited from allOf parents (the nearest declaration wins)
313
+ map = acceptable_attribute_map
314
+ transformed_hash = {}
315
+ acceptable_openapi_types.each_pair do |key, type|
316
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
317
+ transformed_hash["#{key}"] = nil
318
+ elsif type =~ /\AArray<(.*)>/i
319
+ # check to ensure the input is an array given that the attribute
320
+ # is documented as an array but the input is not
321
+ if attributes[map[key]].is_a?(Array)
322
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
323
+ end
324
+ elsif !attributes[map[key]].nil?
325
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
326
+ end
327
+ end
328
+ # Responses can include enum values added after this client was released, so the enum setters
329
+ # accept any value while the model is built from a response
330
+ allocate.tap do |model|
331
+ model.instance_variable_set(:@_skip_enum_validation, true)
332
+ model.send(:initialize, transformed_hash)
333
+ model.remove_instance_variable(:@_skip_enum_validation)
334
+ end
335
+ end
336
+
337
+ # Returns the object in the form of hash
338
+ # @return [Hash] Returns the object in the form of hash
339
+ def to_hash
340
+ hash = {}
341
+ # include attributes inherited from allOf parents (the nearest declaration wins)
342
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
343
+ value = self.send(attr)
344
+ if value.nil?
345
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
346
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
347
+ end
348
+
349
+ hash[param] = _to_hash(value)
350
+ end
351
+ hash
352
+ end
353
+
354
+ end
355
+
356
+ end
@@ -0,0 +1,42 @@
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
+ class TemplatePreviewState
18
+ PENDING = "pending".freeze
19
+ PROCESSED = "processed".freeze
20
+ ERROR = "error".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [PENDING, PROCESSED, ERROR].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