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.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +84 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +24 -0
- data/Gemfile.lock +2 -2
- data/README.md +10 -1
- data/docs/AddTemplateFieldsRequest.md +18 -0
- data/docs/Client.md +704 -33
- data/docs/CreateSubmissionBatchRequest.md +2 -0
- data/docs/CreateSubmissionRequest.md +2 -0
- data/docs/CreateTemplateRequest.md +10 -2
- data/docs/Field.md +198 -0
- data/docs/FieldDependency.md +22 -0
- data/docs/FieldDependencyInput.md +22 -0
- data/docs/FieldGroup.md +32 -0
- data/docs/FieldGroupInput.md +30 -0
- data/docs/FieldGroupType.md +15 -0
- data/docs/FieldInput.md +196 -0
- data/docs/FieldType.md +15 -0
- data/docs/GenerateFilesFormat.md +15 -0
- data/docs/GenerateSubmissionFilesRequest.md +18 -0
- data/docs/OutputFormat.md +15 -0
- data/docs/PageImage.md +34 -0
- data/docs/PageImages.md +24 -0
- data/docs/PredefinedField.md +30 -0
- data/docs/PredefinedFieldInput.md +30 -0
- data/docs/RemoveTemplateFieldsRequest.md +18 -0
- data/docs/ReorderTemplateFieldsRequest.md +18 -0
- data/docs/Submission.md +3 -1
- data/docs/SubmissionFiles.md +3 -1
- data/docs/SubmissionInput.md +2 -0
- data/docs/SubmissionValidation.md +24 -0
- data/docs/Template.md +6 -0
- data/docs/TemplateDiff.md +30 -0
- data/docs/TemplateDiffSummary.md +28 -0
- data/docs/TemplateDocument.md +3 -3
- data/docs/TemplateFieldChange.md +24 -0
- data/docs/TemplateFieldChanges.md +24 -0
- data/docs/TemplateFieldDependency.md +1 -1
- data/docs/TemplateFieldDependencyInput.md +1 -1
- data/docs/TemplateFieldMove.md +22 -0
- data/docs/TemplateFields.md +22 -0
- data/docs/TemplatePageImages.md +24 -0
- data/docs/UpdateTemplateDocumentRequest.md +6 -2
- data/docs/UpdateTemplateFieldsRequest.md +18 -0
- data/docs/UpdateTemplateRequest.md +6 -0
- data/docs/ValidateSubmissionRequest.md +38 -0
- data/lib/docspring/api/client.rb +666 -18
- data/lib/docspring/api_client.rb +1 -1
- data/lib/docspring/models/add_template_fields_request.rb +187 -0
- data/lib/docspring/models/create_submission_batch_request.rb +23 -1
- data/lib/docspring/models/create_submission_request.rb +23 -1
- data/lib/docspring/models/create_template_request.rb +48 -3
- data/lib/docspring/models/field.rb +2217 -0
- data/lib/docspring/models/field_dependency.rb +246 -0
- data/lib/docspring/models/field_dependency_input.rb +246 -0
- data/lib/docspring/models/field_group.rb +368 -0
- data/lib/docspring/models/field_group_input.rb +247 -0
- data/lib/docspring/models/field_group_type.rb +41 -0
- data/lib/docspring/models/field_input.rb +1109 -0
- data/lib/docspring/models/field_type.rb +54 -0
- data/lib/docspring/models/generate_files_format.rb +40 -0
- data/lib/docspring/models/generate_submission_files_request.rb +187 -0
- data/lib/docspring/models/output_format.rb +41 -0
- data/lib/docspring/models/page_image.rb +359 -0
- data/lib/docspring/models/page_images.rb +248 -0
- data/lib/docspring/models/predefined_field.rb +287 -0
- data/lib/docspring/models/predefined_field_input.rb +287 -0
- data/lib/docspring/models/remove_template_fields_request.rb +187 -0
- data/lib/docspring/models/reorder_template_fields_request.rb +187 -0
- data/lib/docspring/models/submission.rb +31 -2
- data/lib/docspring/models/submission_files.rb +13 -4
- data/lib/docspring/models/submission_input.rb +23 -1
- data/lib/docspring/models/submission_validation.rb +234 -0
- data/lib/docspring/models/template.rb +74 -1
- data/lib/docspring/models/template_diff.rb +321 -0
- data/lib/docspring/models/template_diff_summary.rb +320 -0
- data/lib/docspring/models/template_document.rb +3 -3
- data/lib/docspring/models/template_document_state.rb +3 -1
- data/lib/docspring/models/template_field_change.rb +266 -0
- data/lib/docspring/models/template_field_changes.rb +274 -0
- data/lib/docspring/models/template_field_dependency.rb +1 -1
- data/lib/docspring/models/template_field_dependency_input.rb +1 -1
- data/lib/docspring/models/template_field_move.rb +239 -0
- data/lib/docspring/models/template_fields.rb +227 -0
- data/lib/docspring/models/template_page_images.rb +254 -0
- data/lib/docspring/models/update_template_document_request.rb +23 -20
- data/lib/docspring/models/update_template_fields_request.rb +187 -0
- data/lib/docspring/models/update_template_request.rb +38 -1
- data/lib/docspring/models/validate_submission_request.rb +288 -0
- data/lib/docspring/request_schemas.json +3364 -1584
- data/lib/docspring/version.rb +1 -1
- data/lib/docspring.rb +28 -0
- data/spec/api/client_spec.rb +128 -9
- data/spec/models/add_template_fields_request_spec.rb +36 -0
- data/spec/models/create_submission_batch_request_spec.rb +6 -0
- data/spec/models/create_submission_request_spec.rb +6 -0
- data/spec/models/create_template_request_spec.rb +24 -0
- data/spec/models/field_dependency_input_spec.rb +48 -0
- data/spec/models/field_dependency_spec.rb +48 -0
- data/spec/models/field_group_input_spec.rb +72 -0
- data/spec/models/field_group_spec.rb +78 -0
- data/spec/models/field_group_type_spec.rb +30 -0
- data/spec/models/field_input_spec.rb +570 -0
- data/spec/models/field_spec.rb +576 -0
- data/spec/models/field_type_spec.rb +30 -0
- data/spec/models/generate_files_format_spec.rb +30 -0
- data/spec/models/generate_submission_files_request_spec.rb +36 -0
- data/spec/models/output_format_spec.rb +30 -0
- data/spec/models/page_image_spec.rb +84 -0
- data/spec/models/page_images_spec.rb +54 -0
- data/spec/models/predefined_field_input_spec.rb +72 -0
- data/spec/models/predefined_field_spec.rb +72 -0
- data/spec/models/remove_template_fields_request_spec.rb +36 -0
- data/spec/models/reorder_template_fields_request_spec.rb +36 -0
- data/spec/models/submission_files_spec.rb +6 -0
- data/spec/models/submission_input_spec.rb +6 -0
- data/spec/models/submission_spec.rb +6 -0
- data/spec/models/submission_validation_spec.rb +54 -0
- data/spec/models/template_diff_spec.rb +72 -0
- data/spec/models/template_diff_summary_spec.rb +66 -0
- data/spec/models/template_field_change_spec.rb +54 -0
- data/spec/models/template_field_changes_spec.rb +54 -0
- data/spec/models/template_field_move_spec.rb +48 -0
- data/spec/models/template_fields_spec.rb +48 -0
- data/spec/models/template_page_images_spec.rb +54 -0
- data/spec/models/template_spec.rb +18 -0
- data/spec/models/update_template_document_request_spec.rb +12 -0
- data/spec/models/update_template_fields_request_spec.rb +36 -0
- data/spec/models/update_template_request_spec.rb +18 -0
- data/spec/models/validate_submission_request_spec.rb +96 -0
- metadata +113 -1
|
@@ -0,0 +1,368 @@
|
|
|
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 group of a template's fields: the fields whose names start with the group's name and a `/`. In submission data, a group is an object, or an array for a list.
|
|
18
|
+
class FieldGroup < ApiModelBase
|
|
19
|
+
# The group's name: `address` for the field `address/city`. A list's item numbers are written as `~`, so the fields `items/0/price` and `items/1/price` are in the groups `items` and `items/~`, the list's items.
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
# `array` for a list, whose fields' names number its items after the group's name (`items/0/price`, or `items/~/price` in an HTML template), and `object` for the other groups.
|
|
23
|
+
attr_accessor :type
|
|
24
|
+
|
|
25
|
+
# The group's title in the template's data schema and on forms. When it's empty, a title is made from the group's name.
|
|
26
|
+
attr_accessor :title
|
|
27
|
+
|
|
28
|
+
# Help text for the group, added to the template's data schema and shown on forms.
|
|
29
|
+
attr_accessor :description
|
|
30
|
+
|
|
31
|
+
# Text for your own use, added to the template's data schema as `x-metadata`. DocSpring doesn't use it.
|
|
32
|
+
attr_accessor :metadata
|
|
33
|
+
|
|
34
|
+
# Lists only (`type` `array`): the fewest items submission data must have. Null for no minimum.
|
|
35
|
+
attr_accessor :min_items
|
|
36
|
+
|
|
37
|
+
# HTML templates' lists only: the most items submission data can have. Null for no limit. A PDF template's list takes as many items as its fields are numbered for, or more with `allow_additional_items`.
|
|
38
|
+
attr_accessor :max_items
|
|
39
|
+
|
|
40
|
+
# PDF templates' lists only: submission data can have more items than the list's fields are numbered for. Default false.
|
|
41
|
+
attr_accessor :allow_additional_items
|
|
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
|
+
:'name' => :'name',
|
|
69
|
+
:'type' => :'type',
|
|
70
|
+
:'title' => :'title',
|
|
71
|
+
:'description' => :'description',
|
|
72
|
+
:'metadata' => :'metadata',
|
|
73
|
+
:'min_items' => :'min_items',
|
|
74
|
+
:'max_items' => :'max_items',
|
|
75
|
+
:'allow_additional_items' => :'allow_additional_items'
|
|
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
|
+
:'name' => :'String',
|
|
93
|
+
:'type' => :'FieldGroupType',
|
|
94
|
+
:'title' => :'String',
|
|
95
|
+
:'description' => :'String',
|
|
96
|
+
:'metadata' => :'String',
|
|
97
|
+
:'min_items' => :'Integer',
|
|
98
|
+
:'max_items' => :'Integer',
|
|
99
|
+
:'allow_additional_items' => :'Boolean'
|
|
100
|
+
}
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# List of attributes with nullable: true
|
|
104
|
+
def self.openapi_nullable
|
|
105
|
+
Set.new([
|
|
106
|
+
:'min_items',
|
|
107
|
+
:'max_items',
|
|
108
|
+
])
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Returns attribute type mapping
|
|
112
|
+
def self.acceptable_openapi_types
|
|
113
|
+
openapi_types
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Returns the nullable attributes
|
|
117
|
+
def self.acceptable_openapi_nullable
|
|
118
|
+
openapi_nullable
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Initializes the object
|
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
123
|
+
def initialize(attributes = {})
|
|
124
|
+
if (!attributes.is_a?(Hash))
|
|
125
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::FieldGroup` initialize method"
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
129
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
130
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
131
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
132
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::FieldGroup`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
133
|
+
end
|
|
134
|
+
h[k.to_sym] = v
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'name')
|
|
138
|
+
self.name = attributes[:'name']
|
|
139
|
+
else
|
|
140
|
+
self.name = nil
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'type')
|
|
144
|
+
self.type = attributes[:'type']
|
|
145
|
+
else
|
|
146
|
+
self.type = nil
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'title')
|
|
150
|
+
self.title = attributes[:'title']
|
|
151
|
+
else
|
|
152
|
+
self.title = nil
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.key?(:'description')
|
|
156
|
+
self.description = attributes[:'description']
|
|
157
|
+
else
|
|
158
|
+
self.description = nil
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'metadata')
|
|
162
|
+
self.metadata = attributes[:'metadata']
|
|
163
|
+
else
|
|
164
|
+
self.metadata = nil
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'min_items')
|
|
168
|
+
self.min_items = attributes[:'min_items']
|
|
169
|
+
else
|
|
170
|
+
self.min_items = nil
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'max_items')
|
|
174
|
+
self.max_items = attributes[:'max_items']
|
|
175
|
+
else
|
|
176
|
+
self.max_items = nil
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'allow_additional_items')
|
|
180
|
+
self.allow_additional_items = attributes[:'allow_additional_items']
|
|
181
|
+
else
|
|
182
|
+
self.allow_additional_items = nil
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
187
|
+
# @return Array for valid properties with the reasons
|
|
188
|
+
def list_invalid_properties
|
|
189
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
190
|
+
invalid_properties = Array.new
|
|
191
|
+
if @name.nil?
|
|
192
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if @type.nil?
|
|
196
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if @title.nil?
|
|
200
|
+
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if @description.nil?
|
|
204
|
+
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if @metadata.nil?
|
|
208
|
+
invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if @allow_additional_items.nil?
|
|
212
|
+
invalid_properties.push('invalid value for "allow_additional_items", allow_additional_items cannot be nil.')
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
invalid_properties
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Check to see if the all the properties in the model are valid
|
|
219
|
+
# @return true if the model is valid
|
|
220
|
+
def valid?
|
|
221
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
222
|
+
return false if @name.nil?
|
|
223
|
+
return false if @type.nil?
|
|
224
|
+
return false if @title.nil?
|
|
225
|
+
return false if @description.nil?
|
|
226
|
+
return false if @metadata.nil?
|
|
227
|
+
return false if @allow_additional_items.nil?
|
|
228
|
+
true
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Custom attribute writer method with validation
|
|
232
|
+
# @param [Object] name Value to be assigned
|
|
233
|
+
def name=(name)
|
|
234
|
+
if name.nil?
|
|
235
|
+
fail ArgumentError, 'name cannot be nil'
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
@name = name
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Custom attribute writer method with validation
|
|
242
|
+
# @param [Object] type Value to be assigned
|
|
243
|
+
def type=(type)
|
|
244
|
+
if type.nil?
|
|
245
|
+
fail ArgumentError, 'type cannot be nil'
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
@type = type
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Custom attribute writer method with validation
|
|
252
|
+
# @param [Object] title Value to be assigned
|
|
253
|
+
def title=(title)
|
|
254
|
+
if title.nil?
|
|
255
|
+
fail ArgumentError, 'title cannot be nil'
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
@title = title
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Custom attribute writer method with validation
|
|
262
|
+
# @param [Object] description Value to be assigned
|
|
263
|
+
def description=(description)
|
|
264
|
+
if description.nil?
|
|
265
|
+
fail ArgumentError, 'description cannot be nil'
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
@description = description
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Custom attribute writer method with validation
|
|
272
|
+
# @param [Object] metadata Value to be assigned
|
|
273
|
+
def metadata=(metadata)
|
|
274
|
+
if metadata.nil?
|
|
275
|
+
fail ArgumentError, 'metadata cannot be nil'
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
@metadata = metadata
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Custom attribute writer method with validation
|
|
282
|
+
# @param [Object] allow_additional_items Value to be assigned
|
|
283
|
+
def allow_additional_items=(allow_additional_items)
|
|
284
|
+
if allow_additional_items.nil?
|
|
285
|
+
fail ArgumentError, 'allow_additional_items cannot be nil'
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
@allow_additional_items = allow_additional_items
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Checks equality by comparing each attribute.
|
|
292
|
+
# @param [Object] Object to be compared
|
|
293
|
+
def ==(o)
|
|
294
|
+
return true if self.equal?(o)
|
|
295
|
+
self.class == o.class &&
|
|
296
|
+
name == o.name &&
|
|
297
|
+
type == o.type &&
|
|
298
|
+
title == o.title &&
|
|
299
|
+
description == o.description &&
|
|
300
|
+
metadata == o.metadata &&
|
|
301
|
+
min_items == o.min_items &&
|
|
302
|
+
max_items == o.max_items &&
|
|
303
|
+
allow_additional_items == o.allow_additional_items
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# @see the `==` method
|
|
307
|
+
# @param [Object] Object to be compared
|
|
308
|
+
def eql?(o)
|
|
309
|
+
self == o
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Calculates hash code according to all attributes.
|
|
313
|
+
# @return [Integer] Hash code
|
|
314
|
+
def hash
|
|
315
|
+
[name, type, title, description, metadata, min_items, max_items, allow_additional_items].hash
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Builds the object from hash
|
|
319
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
320
|
+
# @return [Object] Returns the model itself
|
|
321
|
+
def self.build_from_hash(attributes)
|
|
322
|
+
return nil unless attributes.is_a?(Hash)
|
|
323
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
324
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
325
|
+
map = acceptable_attribute_map
|
|
326
|
+
transformed_hash = {}
|
|
327
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
328
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
329
|
+
transformed_hash["#{key}"] = nil
|
|
330
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
331
|
+
# check to ensure the input is an array given that the attribute
|
|
332
|
+
# is documented as an array but the input is not
|
|
333
|
+
if attributes[map[key]].is_a?(Array)
|
|
334
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
335
|
+
end
|
|
336
|
+
elsif !attributes[map[key]].nil?
|
|
337
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
338
|
+
end
|
|
339
|
+
end
|
|
340
|
+
# Responses can include enum values added after this client was released, so the enum setters
|
|
341
|
+
# accept any value while the model is built from a response
|
|
342
|
+
allocate.tap do |model|
|
|
343
|
+
model.instance_variable_set(:@_skip_enum_validation, true)
|
|
344
|
+
model.send(:initialize, transformed_hash)
|
|
345
|
+
model.remove_instance_variable(:@_skip_enum_validation)
|
|
346
|
+
end
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
# Returns the object in the form of hash
|
|
350
|
+
# @return [Hash] Returns the object in the form of hash
|
|
351
|
+
def to_hash
|
|
352
|
+
hash = {}
|
|
353
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
354
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
355
|
+
value = self.send(attr)
|
|
356
|
+
if value.nil?
|
|
357
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
358
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
hash[param] = _to_hash(value)
|
|
362
|
+
end
|
|
363
|
+
hash
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
end
|
|
@@ -0,0 +1,247 @@
|
|
|
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 group of a template's fields: the fields whose names start with the group's name and a `/`. In submission data, a group is an object, or an array for a list.
|
|
18
|
+
class FieldGroupInput < ApiModelBase
|
|
19
|
+
# The group's name: `address` for the field `address/city`. A list's item numbers are written as `~`, so the fields `items/0/price` and `items/1/price` are in the groups `items` and `items/~`, the list's items.
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
# The group's title in the template's data schema and on forms. When it's empty, a title is made from the group's name.
|
|
23
|
+
attr_accessor :title
|
|
24
|
+
|
|
25
|
+
# Help text for the group, added to the template's data schema and shown on forms.
|
|
26
|
+
attr_accessor :description
|
|
27
|
+
|
|
28
|
+
# Text for your own use, added to the template's data schema as `x-metadata`. DocSpring doesn't use it.
|
|
29
|
+
attr_accessor :metadata
|
|
30
|
+
|
|
31
|
+
# Lists only (`type` `array`): the fewest items submission data must have. Null for no minimum.
|
|
32
|
+
attr_accessor :min_items
|
|
33
|
+
|
|
34
|
+
# HTML templates' lists only: the most items submission data can have. Null for no limit. A PDF template's list takes as many items as its fields are numbered for, or more with `allow_additional_items`.
|
|
35
|
+
attr_accessor :max_items
|
|
36
|
+
|
|
37
|
+
# PDF templates' lists only: submission data can have more items than the list's fields are numbered for. Default false.
|
|
38
|
+
attr_accessor :allow_additional_items
|
|
39
|
+
|
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
|
+
def self.attribute_map
|
|
42
|
+
{
|
|
43
|
+
:'name' => :'name',
|
|
44
|
+
:'title' => :'title',
|
|
45
|
+
:'description' => :'description',
|
|
46
|
+
:'metadata' => :'metadata',
|
|
47
|
+
:'min_items' => :'min_items',
|
|
48
|
+
:'max_items' => :'max_items',
|
|
49
|
+
:'allow_additional_items' => :'allow_additional_items'
|
|
50
|
+
}
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns attribute mapping this model knows about
|
|
54
|
+
def self.acceptable_attribute_map
|
|
55
|
+
attribute_map
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns all the JSON keys this model knows about
|
|
59
|
+
def self.acceptable_attributes
|
|
60
|
+
acceptable_attribute_map.values
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Attribute type mapping.
|
|
64
|
+
def self.openapi_types
|
|
65
|
+
{
|
|
66
|
+
:'name' => :'String',
|
|
67
|
+
:'title' => :'String',
|
|
68
|
+
:'description' => :'String',
|
|
69
|
+
:'metadata' => :'String',
|
|
70
|
+
:'min_items' => :'Integer',
|
|
71
|
+
:'max_items' => :'Integer',
|
|
72
|
+
:'allow_additional_items' => :'Boolean'
|
|
73
|
+
}
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# List of attributes with nullable: true
|
|
77
|
+
def self.openapi_nullable
|
|
78
|
+
Set.new([
|
|
79
|
+
:'min_items',
|
|
80
|
+
:'max_items',
|
|
81
|
+
])
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Returns attribute type mapping
|
|
85
|
+
def self.acceptable_openapi_types
|
|
86
|
+
openapi_types
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Returns the nullable attributes
|
|
90
|
+
def self.acceptable_openapi_nullable
|
|
91
|
+
openapi_nullable
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Initializes the object
|
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
96
|
+
def initialize(attributes = {})
|
|
97
|
+
if (!attributes.is_a?(Hash))
|
|
98
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::FieldGroupInput` initialize method"
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
102
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
103
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
104
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
105
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::FieldGroupInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
106
|
+
end
|
|
107
|
+
h[k.to_sym] = v
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'name')
|
|
111
|
+
self.name = attributes[:'name']
|
|
112
|
+
else
|
|
113
|
+
self.name = nil
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'title')
|
|
117
|
+
self.title = attributes[:'title']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'description')
|
|
121
|
+
self.description = attributes[:'description']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'metadata')
|
|
125
|
+
self.metadata = attributes[:'metadata']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'min_items')
|
|
129
|
+
self.min_items = attributes[:'min_items']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'max_items')
|
|
133
|
+
self.max_items = attributes[:'max_items']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'allow_additional_items')
|
|
137
|
+
self.allow_additional_items = attributes[:'allow_additional_items']
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
142
|
+
# @return Array for valid properties with the reasons
|
|
143
|
+
def list_invalid_properties
|
|
144
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
145
|
+
invalid_properties = Array.new
|
|
146
|
+
if @name.nil?
|
|
147
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
invalid_properties
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Check to see if the all the properties in the model are valid
|
|
154
|
+
# @return true if the model is valid
|
|
155
|
+
def valid?
|
|
156
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
157
|
+
return false if @name.nil?
|
|
158
|
+
true
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Custom attribute writer method with validation
|
|
162
|
+
# @param [Object] name Value to be assigned
|
|
163
|
+
def name=(name)
|
|
164
|
+
if name.nil?
|
|
165
|
+
fail ArgumentError, 'name cannot be nil'
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
@name = name
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Checks equality by comparing each attribute.
|
|
172
|
+
# @param [Object] Object to be compared
|
|
173
|
+
def ==(o)
|
|
174
|
+
return true if self.equal?(o)
|
|
175
|
+
self.class == o.class &&
|
|
176
|
+
name == o.name &&
|
|
177
|
+
title == o.title &&
|
|
178
|
+
description == o.description &&
|
|
179
|
+
metadata == o.metadata &&
|
|
180
|
+
min_items == o.min_items &&
|
|
181
|
+
max_items == o.max_items &&
|
|
182
|
+
allow_additional_items == o.allow_additional_items
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# @see the `==` method
|
|
186
|
+
# @param [Object] Object to be compared
|
|
187
|
+
def eql?(o)
|
|
188
|
+
self == o
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Calculates hash code according to all attributes.
|
|
192
|
+
# @return [Integer] Hash code
|
|
193
|
+
def hash
|
|
194
|
+
[name, title, description, metadata, min_items, max_items, allow_additional_items].hash
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Builds the object from hash
|
|
198
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
199
|
+
# @return [Object] Returns the model itself
|
|
200
|
+
def self.build_from_hash(attributes)
|
|
201
|
+
return nil unless attributes.is_a?(Hash)
|
|
202
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
203
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
204
|
+
map = acceptable_attribute_map
|
|
205
|
+
transformed_hash = {}
|
|
206
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
207
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
208
|
+
transformed_hash["#{key}"] = nil
|
|
209
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
210
|
+
# check to ensure the input is an array given that the attribute
|
|
211
|
+
# is documented as an array but the input is not
|
|
212
|
+
if attributes[map[key]].is_a?(Array)
|
|
213
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
214
|
+
end
|
|
215
|
+
elsif !attributes[map[key]].nil?
|
|
216
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
# Responses can include enum values added after this client was released, so the enum setters
|
|
220
|
+
# accept any value while the model is built from a response
|
|
221
|
+
allocate.tap do |model|
|
|
222
|
+
model.instance_variable_set(:@_skip_enum_validation, true)
|
|
223
|
+
model.send(:initialize, transformed_hash)
|
|
224
|
+
model.remove_instance_variable(:@_skip_enum_validation)
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Returns the object in the form of hash
|
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
|
230
|
+
def to_hash
|
|
231
|
+
hash = {}
|
|
232
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
233
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
234
|
+
value = self.send(attr)
|
|
235
|
+
if value.nil?
|
|
236
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
237
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
hash[param] = _to_hash(value)
|
|
241
|
+
end
|
|
242
|
+
hash
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
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 FieldGroupType
|
|
18
|
+
OBJECT = "object".freeze
|
|
19
|
+
ARRAY = "array".freeze
|
|
20
|
+
|
|
21
|
+
def self.all_vars
|
|
22
|
+
@all_vars ||= [OBJECT, ARRAY].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
|