docspring 1.3.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +3 -8
- data/LICENSE +1 -1
- data/README.md +13 -5
- data/docs/CombinePdfsData.md +1 -0
- data/docs/CombinedSubmission.md +1 -0
- data/docs/CombinedSubmissionData.md +1 -0
- data/docs/CopyTemplateData.md +9 -0
- data/docs/ListSubmissionsResponse.md +10 -0
- data/docs/MoveTemplateData.md +1 -1
- data/docs/PDFApi.md +232 -4
- data/docs/SubmissionData.md +1 -0
- data/docs/SubmissionDataRequest.md +1 -0
- data/docs/Template1.md +46 -0
- data/docs/Template1Defaults.md +10 -0
- data/docspring.gemspec +1 -2
- data/lib/docspring/api/pdf_api.rb +244 -2
- data/lib/docspring/api_client.rb +1 -1
- data/lib/docspring/configuration.rb +1 -2
- data/lib/docspring/models/combine_pdfs_data.rb +10 -1
- data/lib/docspring/models/combined_submission.rb +10 -1
- data/lib/docspring/models/combined_submission_data.rb +10 -1
- data/lib/docspring/models/copy_template_data.rb +197 -0
- data/lib/docspring/models/list_submissions_response.rb +203 -0
- data/lib/docspring/models/move_template_data.rb +5 -0
- data/lib/docspring/models/submission_data.rb +10 -1
- data/lib/docspring/models/submission_data_request.rb +15 -1
- data/lib/docspring/models/template1.rb +565 -0
- data/lib/docspring/models/template1_defaults.rb +201 -0
- data/lib/docspring/version.rb +1 -1
- data/lib/docspring.rb +4 -0
- data/spec/api/client_integration_spec.rb +1 -1
- data/spec/api/pdf_api_spec_original.skipped.rb +78 -2
- data/spec/models/combine_pdfs_data_spec.rb +6 -0
- data/spec/models/combined_submission_data_spec.rb +6 -0
- data/spec/models/combined_submission_spec.rb +6 -0
- data/spec/models/copy_template_data_spec.rb +47 -0
- data/spec/models/list_submissions_response_spec.rb +53 -0
- data/spec/models/submission_data_request_spec.rb +6 -0
- data/spec/models/submission_data_spec.rb +6 -0
- data/spec/models/template1_defaults_spec.rb +53 -0
- data/spec/models/template1_spec.rb +273 -0
- metadata +23 -27
@@ -0,0 +1,203 @@
|
|
1
|
+
=begin
|
2
|
+
#API v1
|
3
|
+
|
4
|
+
#DocSpring is a service that helps you fill out and sign PDF templates.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 3.3.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module DocSpring
|
16
|
+
class ListSubmissionsResponse
|
17
|
+
attr_accessor :next_cursor
|
18
|
+
|
19
|
+
attr_accessor :submissions
|
20
|
+
|
21
|
+
attr_accessor :limit
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'next_cursor' => :'next_cursor',
|
27
|
+
:'submissions' => :'submissions',
|
28
|
+
:'limit' => :'limit'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'next_cursor' => :'String',
|
36
|
+
:'submissions' => :'Array<Submission>',
|
37
|
+
:'limit' => :'Float'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
def initialize(attributes = {})
|
44
|
+
return unless attributes.is_a?(Hash)
|
45
|
+
|
46
|
+
# convert string to symbol for hash key
|
47
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
48
|
+
|
49
|
+
if attributes.has_key?(:'next_cursor')
|
50
|
+
self.next_cursor = attributes[:'next_cursor']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.has_key?(:'submissions')
|
54
|
+
if (value = attributes[:'submissions']).is_a?(Array)
|
55
|
+
self.submissions = value
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
if attributes.has_key?(:'limit')
|
60
|
+
self.limit = attributes[:'limit']
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
65
|
+
# @return Array for valid properties with the reasons
|
66
|
+
def list_invalid_properties
|
67
|
+
invalid_properties = Array.new
|
68
|
+
invalid_properties
|
69
|
+
end
|
70
|
+
|
71
|
+
# Check to see if the all the properties in the model are valid
|
72
|
+
# @return true if the model is valid
|
73
|
+
def valid?
|
74
|
+
true
|
75
|
+
end
|
76
|
+
|
77
|
+
# Checks equality by comparing each attribute.
|
78
|
+
# @param [Object] Object to be compared
|
79
|
+
def ==(o)
|
80
|
+
return true if self.equal?(o)
|
81
|
+
self.class == o.class &&
|
82
|
+
next_cursor == o.next_cursor &&
|
83
|
+
submissions == o.submissions &&
|
84
|
+
limit == o.limit
|
85
|
+
end
|
86
|
+
|
87
|
+
# @see the `==` method
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def eql?(o)
|
90
|
+
self == o
|
91
|
+
end
|
92
|
+
|
93
|
+
# Calculates hash code according to all attributes.
|
94
|
+
# @return [Fixnum] Hash code
|
95
|
+
def hash
|
96
|
+
[next_cursor, submissions, limit].hash
|
97
|
+
end
|
98
|
+
|
99
|
+
# Builds the object from hash
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
101
|
+
# @return [Object] Returns the model itself
|
102
|
+
def build_from_hash(attributes)
|
103
|
+
return nil unless attributes.is_a?(Hash)
|
104
|
+
self.class.openapi_types.each_pair do |key, type|
|
105
|
+
if type =~ /\AArray<(.*)>/i
|
106
|
+
# check to ensure the input is an array given that the the attribute
|
107
|
+
# is documented as an array but the input is not
|
108
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
109
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
110
|
+
end
|
111
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
112
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
113
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
114
|
+
end
|
115
|
+
|
116
|
+
self
|
117
|
+
end
|
118
|
+
|
119
|
+
# Deserializes the data based on type
|
120
|
+
# @param string type Data type
|
121
|
+
# @param string value Value to be deserialized
|
122
|
+
# @return [Object] Deserialized data
|
123
|
+
def _deserialize(type, value)
|
124
|
+
case type.to_sym
|
125
|
+
when :DateTime
|
126
|
+
DateTime.parse(value)
|
127
|
+
when :Date
|
128
|
+
Date.parse(value)
|
129
|
+
when :String
|
130
|
+
value.to_s
|
131
|
+
when :Integer
|
132
|
+
value.to_i
|
133
|
+
when :Float
|
134
|
+
value.to_f
|
135
|
+
when :BOOLEAN
|
136
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
137
|
+
true
|
138
|
+
else
|
139
|
+
false
|
140
|
+
end
|
141
|
+
when :Object
|
142
|
+
# generic object (usually a Hash), return directly
|
143
|
+
value
|
144
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
145
|
+
inner_type = Regexp.last_match[:inner_type]
|
146
|
+
value.map { |v| _deserialize(inner_type, v) }
|
147
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
148
|
+
k_type = Regexp.last_match[:k_type]
|
149
|
+
v_type = Regexp.last_match[:v_type]
|
150
|
+
{}.tap do |hash|
|
151
|
+
value.each do |k, v|
|
152
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
else # model
|
156
|
+
temp_model = DocSpring.const_get(type).new
|
157
|
+
temp_model.build_from_hash(value)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Returns the string representation of the object
|
162
|
+
# @return [String] String presentation of the object
|
163
|
+
def to_s
|
164
|
+
to_hash.to_s
|
165
|
+
end
|
166
|
+
|
167
|
+
# to_body is an alias to to_hash (backward compatibility)
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
169
|
+
def to_body
|
170
|
+
to_hash
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the object in the form of hash
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_hash
|
176
|
+
hash = {}
|
177
|
+
self.class.attribute_map.each_pair do |attr, param|
|
178
|
+
value = self.send(attr)
|
179
|
+
next if value.nil?
|
180
|
+
hash[param] = _to_hash(value)
|
181
|
+
end
|
182
|
+
hash
|
183
|
+
end
|
184
|
+
|
185
|
+
# Outputs non-array value in the form of hash
|
186
|
+
# For object, use to_hash. Otherwise, just return the value
|
187
|
+
# @param [Object] value Any valid value
|
188
|
+
# @return [Hash] Returns the value in the form of hash
|
189
|
+
def _to_hash(value)
|
190
|
+
if value.is_a?(Array)
|
191
|
+
value.compact.map { |v| _to_hash(v) }
|
192
|
+
elsif value.is_a?(Hash)
|
193
|
+
{}.tap do |hash|
|
194
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
195
|
+
end
|
196
|
+
elsif value.respond_to? :to_hash
|
197
|
+
value.to_hash
|
198
|
+
else
|
199
|
+
value
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
@@ -47,12 +47,17 @@ module DocSpring
|
|
47
47
|
# @return Array for valid properties with the reasons
|
48
48
|
def list_invalid_properties
|
49
49
|
invalid_properties = Array.new
|
50
|
+
if @parent_folder_id.nil?
|
51
|
+
invalid_properties.push('invalid value for "parent_folder_id", parent_folder_id cannot be nil.')
|
52
|
+
end
|
53
|
+
|
50
54
|
invalid_properties
|
51
55
|
end
|
52
56
|
|
53
57
|
# Check to see if the all the properties in the model are valid
|
54
58
|
# @return true if the model is valid
|
55
59
|
def valid?
|
60
|
+
return false if @parent_folder_id.nil?
|
56
61
|
true
|
57
62
|
end
|
58
63
|
|
@@ -26,6 +26,8 @@ module DocSpring
|
|
26
26
|
|
27
27
|
attr_accessor :metadata
|
28
28
|
|
29
|
+
attr_accessor :password
|
30
|
+
|
29
31
|
attr_accessor :test
|
30
32
|
|
31
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -37,6 +39,7 @@ module DocSpring
|
|
37
39
|
:'field_overrides' => :'field_overrides',
|
38
40
|
:'html' => :'html',
|
39
41
|
:'metadata' => :'metadata',
|
42
|
+
:'password' => :'password',
|
40
43
|
:'test' => :'test'
|
41
44
|
}
|
42
45
|
end
|
@@ -50,6 +53,7 @@ module DocSpring
|
|
50
53
|
:'field_overrides' => :'Object',
|
51
54
|
:'html' => :'String',
|
52
55
|
:'metadata' => :'Object',
|
56
|
+
:'password' => :'String',
|
53
57
|
:'test' => :'BOOLEAN'
|
54
58
|
}
|
55
59
|
end
|
@@ -88,6 +92,10 @@ module DocSpring
|
|
88
92
|
self.metadata = attributes[:'metadata']
|
89
93
|
end
|
90
94
|
|
95
|
+
if attributes.has_key?(:'password')
|
96
|
+
self.password = attributes[:'password']
|
97
|
+
end
|
98
|
+
|
91
99
|
if attributes.has_key?(:'test')
|
92
100
|
self.test = attributes[:'test']
|
93
101
|
end
|
@@ -122,6 +130,7 @@ module DocSpring
|
|
122
130
|
field_overrides == o.field_overrides &&
|
123
131
|
html == o.html &&
|
124
132
|
metadata == o.metadata &&
|
133
|
+
password == o.password &&
|
125
134
|
test == o.test
|
126
135
|
end
|
127
136
|
|
@@ -134,7 +143,7 @@ module DocSpring
|
|
134
143
|
# Calculates hash code according to all attributes.
|
135
144
|
# @return [Fixnum] Hash code
|
136
145
|
def hash
|
137
|
-
[css, data, data_requests, field_overrides, html, metadata, test].hash
|
146
|
+
[css, data, data_requests, field_overrides, html, metadata, password, test].hash
|
138
147
|
end
|
139
148
|
|
140
149
|
# Builds the object from hash
|
@@ -22,6 +22,8 @@ module DocSpring
|
|
22
22
|
|
23
23
|
attr_accessor :order
|
24
24
|
|
25
|
+
attr_accessor :sort_order
|
26
|
+
|
25
27
|
attr_accessor :fields
|
26
28
|
|
27
29
|
attr_accessor :metadata
|
@@ -81,6 +83,7 @@ module DocSpring
|
|
81
83
|
:'name' => :'name',
|
82
84
|
:'email' => :'email',
|
83
85
|
:'order' => :'order',
|
86
|
+
:'sort_order' => :'sort_order',
|
84
87
|
:'fields' => :'fields',
|
85
88
|
:'metadata' => :'metadata',
|
86
89
|
:'state' => :'state',
|
@@ -106,6 +109,7 @@ module DocSpring
|
|
106
109
|
:'name' => :'String',
|
107
110
|
:'email' => :'String',
|
108
111
|
:'order' => :'Integer',
|
112
|
+
:'sort_order' => :'Integer',
|
109
113
|
:'fields' => :'Array<String>',
|
110
114
|
:'metadata' => :'Object',
|
111
115
|
:'state' => :'String',
|
@@ -148,6 +152,10 @@ module DocSpring
|
|
148
152
|
self.order = attributes[:'order']
|
149
153
|
end
|
150
154
|
|
155
|
+
if attributes.has_key?(:'sort_order')
|
156
|
+
self.sort_order = attributes[:'sort_order']
|
157
|
+
end
|
158
|
+
|
151
159
|
if attributes.has_key?(:'fields')
|
152
160
|
if (value = attributes[:'fields']).is_a?(Array)
|
153
161
|
self.fields = value
|
@@ -223,6 +231,10 @@ module DocSpring
|
|
223
231
|
invalid_properties.push('invalid value for "order", order cannot be nil.')
|
224
232
|
end
|
225
233
|
|
234
|
+
if @sort_order.nil?
|
235
|
+
invalid_properties.push('invalid value for "sort_order", sort_order cannot be nil.')
|
236
|
+
end
|
237
|
+
|
226
238
|
if @metadata.nil?
|
227
239
|
invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
|
228
240
|
end
|
@@ -239,6 +251,7 @@ module DocSpring
|
|
239
251
|
def valid?
|
240
252
|
return false if @id.nil?
|
241
253
|
return false if @order.nil?
|
254
|
+
return false if @sort_order.nil?
|
242
255
|
return false if @metadata.nil?
|
243
256
|
return false if @state.nil?
|
244
257
|
state_validator = EnumAttributeValidator.new('String', ['pending', 'completed'])
|
@@ -289,6 +302,7 @@ module DocSpring
|
|
289
302
|
name == o.name &&
|
290
303
|
email == o.email &&
|
291
304
|
order == o.order &&
|
305
|
+
sort_order == o.sort_order &&
|
292
306
|
fields == o.fields &&
|
293
307
|
metadata == o.metadata &&
|
294
308
|
state == o.state &&
|
@@ -315,7 +329,7 @@ module DocSpring
|
|
315
329
|
# Calculates hash code according to all attributes.
|
316
330
|
# @return [Fixnum] Hash code
|
317
331
|
def hash
|
318
|
-
[id, name, email, order, fields, metadata, state, viewed_at, completed_at, auth_type, auth_second_factor_type, auth_provider, auth_session_started_at, auth_session_id_hash, auth_user_id_hash, auth_username_hash, auth_phone_number_hash, ip_address, user_agent].hash
|
332
|
+
[id, name, email, order, sort_order, fields, metadata, state, viewed_at, completed_at, auth_type, auth_second_factor_type, auth_provider, auth_session_started_at, auth_session_id_hash, auth_user_id_hash, auth_username_hash, auth_phone_number_hash, ip_address, user_agent].hash
|
319
333
|
end
|
320
334
|
|
321
335
|
# Builds the object from hash
|