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,287 @@
|
|
|
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 field name that people using the embedded template editor can choose from, with the data type and settings a field gets when it's given that name.
|
|
18
|
+
class PredefinedFieldInput < ApiModelBase
|
|
19
|
+
# The field's name, the key of its value in submission data. A `/` nests the key in objects and arrays (`customer/email`, `signers/0/name`).
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
# The name the template editor shows instead of `name`, where a `/` puts it in a folder, such as `Defendant/Name`. Null shows `name`. Two names can't share a display name.
|
|
23
|
+
attr_accessor :display_name
|
|
24
|
+
|
|
25
|
+
# The Title setting a field gets when it's given this name. Null leaves the field's title as it is.
|
|
26
|
+
attr_accessor :title
|
|
27
|
+
|
|
28
|
+
# The data type a field gets when it's given this name, as a field's `type`.
|
|
29
|
+
attr_accessor :type
|
|
30
|
+
|
|
31
|
+
# String fields only: the values allowed, separated by commas, such as `Yes,No`. Null allows any value.
|
|
32
|
+
attr_accessor :option_list
|
|
33
|
+
|
|
34
|
+
# Whether the template must have a field with this name. The embedded editor shows the names that are missing, and with `disableDoneButtonIfPredefinedFieldsMissing` keeps its Done button disabled until the template has them. Default false.
|
|
35
|
+
attr_accessor :required_in_template
|
|
36
|
+
|
|
37
|
+
# The Required setting a field gets when it's given this name. Default true.
|
|
38
|
+
attr_accessor :field_required
|
|
39
|
+
|
|
40
|
+
class EnumAttributeValidator
|
|
41
|
+
attr_reader :datatype
|
|
42
|
+
attr_reader :allowable_values
|
|
43
|
+
|
|
44
|
+
def initialize(datatype, allowable_values)
|
|
45
|
+
@allowable_values = allowable_values.map do |value|
|
|
46
|
+
case datatype.to_s
|
|
47
|
+
when /Integer/i
|
|
48
|
+
value.to_i
|
|
49
|
+
when /Float/i
|
|
50
|
+
value.to_f
|
|
51
|
+
else
|
|
52
|
+
value
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def valid?(value)
|
|
58
|
+
!value || allowable_values.include?(value)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
63
|
+
def self.attribute_map
|
|
64
|
+
{
|
|
65
|
+
:'name' => :'name',
|
|
66
|
+
:'display_name' => :'display_name',
|
|
67
|
+
:'title' => :'title',
|
|
68
|
+
:'type' => :'type',
|
|
69
|
+
:'option_list' => :'option_list',
|
|
70
|
+
:'required_in_template' => :'required_in_template',
|
|
71
|
+
:'field_required' => :'field_required'
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Returns attribute mapping this model knows about
|
|
76
|
+
def self.acceptable_attribute_map
|
|
77
|
+
attribute_map
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Returns all the JSON keys this model knows about
|
|
81
|
+
def self.acceptable_attributes
|
|
82
|
+
acceptable_attribute_map.values
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Attribute type mapping.
|
|
86
|
+
def self.openapi_types
|
|
87
|
+
{
|
|
88
|
+
:'name' => :'String',
|
|
89
|
+
:'display_name' => :'String',
|
|
90
|
+
:'title' => :'String',
|
|
91
|
+
:'type' => :'FieldType',
|
|
92
|
+
:'option_list' => :'String',
|
|
93
|
+
:'required_in_template' => :'Boolean',
|
|
94
|
+
:'field_required' => :'Boolean'
|
|
95
|
+
}
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# List of attributes with nullable: true
|
|
99
|
+
def self.openapi_nullable
|
|
100
|
+
Set.new([
|
|
101
|
+
:'display_name',
|
|
102
|
+
:'title',
|
|
103
|
+
:'option_list',
|
|
104
|
+
])
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Returns attribute type mapping
|
|
108
|
+
def self.acceptable_openapi_types
|
|
109
|
+
openapi_types
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Returns the nullable attributes
|
|
113
|
+
def self.acceptable_openapi_nullable
|
|
114
|
+
openapi_nullable
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Initializes the object
|
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
119
|
+
def initialize(attributes = {})
|
|
120
|
+
if (!attributes.is_a?(Hash))
|
|
121
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::PredefinedFieldInput` initialize method"
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
125
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
126
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
127
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
128
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::PredefinedFieldInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
129
|
+
end
|
|
130
|
+
h[k.to_sym] = v
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'name')
|
|
134
|
+
self.name = attributes[:'name']
|
|
135
|
+
else
|
|
136
|
+
self.name = nil
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'display_name')
|
|
140
|
+
self.display_name = attributes[:'display_name']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'title')
|
|
144
|
+
self.title = attributes[:'title']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'type')
|
|
148
|
+
self.type = attributes[:'type']
|
|
149
|
+
else
|
|
150
|
+
self.type = nil
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'option_list')
|
|
154
|
+
self.option_list = attributes[:'option_list']
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'required_in_template')
|
|
158
|
+
self.required_in_template = attributes[:'required_in_template']
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'field_required')
|
|
162
|
+
self.field_required = attributes[:'field_required']
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
167
|
+
# @return Array for valid properties with the reasons
|
|
168
|
+
def list_invalid_properties
|
|
169
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
170
|
+
invalid_properties = Array.new
|
|
171
|
+
if @name.nil?
|
|
172
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if @type.nil?
|
|
176
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
invalid_properties
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Check to see if the all the properties in the model are valid
|
|
183
|
+
# @return true if the model is valid
|
|
184
|
+
def valid?
|
|
185
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
186
|
+
return false if @name.nil?
|
|
187
|
+
return false if @type.nil?
|
|
188
|
+
true
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Custom attribute writer method with validation
|
|
192
|
+
# @param [Object] name Value to be assigned
|
|
193
|
+
def name=(name)
|
|
194
|
+
if name.nil?
|
|
195
|
+
fail ArgumentError, 'name cannot be nil'
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
@name = name
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Custom attribute writer method with validation
|
|
202
|
+
# @param [Object] type Value to be assigned
|
|
203
|
+
def type=(type)
|
|
204
|
+
if type.nil?
|
|
205
|
+
fail ArgumentError, 'type cannot be nil'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@type = type
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Checks equality by comparing each attribute.
|
|
212
|
+
# @param [Object] Object to be compared
|
|
213
|
+
def ==(o)
|
|
214
|
+
return true if self.equal?(o)
|
|
215
|
+
self.class == o.class &&
|
|
216
|
+
name == o.name &&
|
|
217
|
+
display_name == o.display_name &&
|
|
218
|
+
title == o.title &&
|
|
219
|
+
type == o.type &&
|
|
220
|
+
option_list == o.option_list &&
|
|
221
|
+
required_in_template == o.required_in_template &&
|
|
222
|
+
field_required == o.field_required
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# @see the `==` method
|
|
226
|
+
# @param [Object] Object to be compared
|
|
227
|
+
def eql?(o)
|
|
228
|
+
self == o
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Calculates hash code according to all attributes.
|
|
232
|
+
# @return [Integer] Hash code
|
|
233
|
+
def hash
|
|
234
|
+
[name, display_name, title, type, option_list, required_in_template, field_required].hash
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Builds the object from hash
|
|
238
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
239
|
+
# @return [Object] Returns the model itself
|
|
240
|
+
def self.build_from_hash(attributes)
|
|
241
|
+
return nil unless attributes.is_a?(Hash)
|
|
242
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
243
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
244
|
+
map = acceptable_attribute_map
|
|
245
|
+
transformed_hash = {}
|
|
246
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
247
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
248
|
+
transformed_hash["#{key}"] = nil
|
|
249
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
250
|
+
# check to ensure the input is an array given that the attribute
|
|
251
|
+
# is documented as an array but the input is not
|
|
252
|
+
if attributes[map[key]].is_a?(Array)
|
|
253
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
254
|
+
end
|
|
255
|
+
elsif !attributes[map[key]].nil?
|
|
256
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
# Responses can include enum values added after this client was released, so the enum setters
|
|
260
|
+
# accept any value while the model is built from a response
|
|
261
|
+
allocate.tap do |model|
|
|
262
|
+
model.instance_variable_set(:@_skip_enum_validation, true)
|
|
263
|
+
model.send(:initialize, transformed_hash)
|
|
264
|
+
model.remove_instance_variable(:@_skip_enum_validation)
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Returns the object in the form of hash
|
|
269
|
+
# @return [Hash] Returns the object in the form of hash
|
|
270
|
+
def to_hash
|
|
271
|
+
hash = {}
|
|
272
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
273
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
274
|
+
value = self.send(attr)
|
|
275
|
+
if value.nil?
|
|
276
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
277
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
hash[param] = _to_hash(value)
|
|
281
|
+
end
|
|
282
|
+
hash
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
end
|
|
@@ -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 remove from the template's draft.
|
|
18
|
+
class RemoveTemplateFieldsRequest < ApiModelBase
|
|
19
|
+
# The IDs of the fields to remove.
|
|
20
|
+
attr_accessor :field_ids
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'field_ids' => :'field_ids'
|
|
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
|
+
:'field_ids' => :'Array<Integer>'
|
|
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::RemoveTemplateFieldsRequest` 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::RemoveTemplateFieldsRequest`. 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?(:'field_ids')
|
|
79
|
+
if (value = attributes[:'field_ids']).is_a?(Array)
|
|
80
|
+
self.field_ids = value
|
|
81
|
+
end
|
|
82
|
+
else
|
|
83
|
+
self.field_ids = 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 @field_ids.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "field_ids", field_ids 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 @field_ids.nil?
|
|
104
|
+
true
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Custom attribute writer method with validation
|
|
108
|
+
# @param [Object] field_ids Value to be assigned
|
|
109
|
+
def field_ids=(field_ids)
|
|
110
|
+
if field_ids.nil?
|
|
111
|
+
fail ArgumentError, 'field_ids cannot be nil'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
@field_ids = field_ids
|
|
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
|
+
field_ids == o.field_ids
|
|
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
|
+
[field_ids].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
|
|
@@ -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 new order of the fields in the template's draft.
|
|
18
|
+
class ReorderTemplateFieldsRequest < ApiModelBase
|
|
19
|
+
# The ID of every field, in the new order. Each field stays on its page, and a page's fields take the order their IDs have here: the order they're printed in (a later field prints over an earlier one where they overlap), and the order of their values in the template's data schema and forms.
|
|
20
|
+
attr_accessor :field_ids
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'field_ids' => :'field_ids'
|
|
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
|
+
:'field_ids' => :'Array<Integer>'
|
|
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::ReorderTemplateFieldsRequest` 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::ReorderTemplateFieldsRequest`. 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?(:'field_ids')
|
|
79
|
+
if (value = attributes[:'field_ids']).is_a?(Array)
|
|
80
|
+
self.field_ids = value
|
|
81
|
+
end
|
|
82
|
+
else
|
|
83
|
+
self.field_ids = 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 @field_ids.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "field_ids", field_ids 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 @field_ids.nil?
|
|
104
|
+
true
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Custom attribute writer method with validation
|
|
108
|
+
# @param [Object] field_ids Value to be assigned
|
|
109
|
+
def field_ids=(field_ids)
|
|
110
|
+
if field_ids.nil?
|
|
111
|
+
fail ArgumentError, 'field_ids cannot be nil'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
@field_ids = field_ids
|
|
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
|
+
field_ids == o.field_ids
|
|
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
|
+
[field_ids].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
|