docspring 1.4.0 → 1.4.1
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/CHANGELOG.md +4 -0
- data/Gemfile.lock +3 -3
- data/README.md +11 -5
- data/docs/CombinePdfsData.md +1 -0
- data/docs/CombinedSubmission.md +1 -0
- data/docs/CombinedSubmissionData.md +1 -0
- data/docs/ListSubmissionsResponse.md +10 -0
- data/docs/PDFApi.md +180 -4
- data/docs/SubmissionData.md +1 -0
- data/docs/Template1.md +46 -0
- data/docs/Template1Defaults.md +10 -0
- data/lib/docspring/api/pdf_api.rb +185 -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/list_submissions_response.rb +203 -0
- data/lib/docspring/models/submission_data.rb +10 -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 +3 -0
- data/spec/api/client_integration_spec.rb +1 -1
- data/spec/api/pdf_api_spec_original.skipped.rb +64 -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/list_submissions_response_spec.rb +53 -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 +14 -2
@@ -20,6 +20,8 @@ module DocSpring
|
|
20
20
|
|
21
21
|
attr_accessor :metadata
|
22
22
|
|
23
|
+
attr_accessor :password
|
24
|
+
|
23
25
|
attr_accessor :source_pdfs
|
24
26
|
|
25
27
|
attr_accessor :test
|
@@ -30,6 +32,7 @@ module DocSpring
|
|
30
32
|
:'delete_custom_files' => :'delete_custom_files',
|
31
33
|
:'expires_in' => :'expires_in',
|
32
34
|
:'metadata' => :'metadata',
|
35
|
+
:'password' => :'password',
|
33
36
|
:'source_pdfs' => :'source_pdfs',
|
34
37
|
:'test' => :'test'
|
35
38
|
}
|
@@ -41,6 +44,7 @@ module DocSpring
|
|
41
44
|
:'delete_custom_files' => :'BOOLEAN',
|
42
45
|
:'expires_in' => :'Integer',
|
43
46
|
:'metadata' => :'Object',
|
47
|
+
:'password' => :'String',
|
44
48
|
:'source_pdfs' => :'Array<Object>',
|
45
49
|
:'test' => :'BOOLEAN'
|
46
50
|
}
|
@@ -66,6 +70,10 @@ module DocSpring
|
|
66
70
|
self.metadata = attributes[:'metadata']
|
67
71
|
end
|
68
72
|
|
73
|
+
if attributes.has_key?(:'password')
|
74
|
+
self.password = attributes[:'password']
|
75
|
+
end
|
76
|
+
|
69
77
|
if attributes.has_key?(:'source_pdfs')
|
70
78
|
if (value = attributes[:'source_pdfs']).is_a?(Array)
|
71
79
|
self.source_pdfs = value
|
@@ -103,6 +111,7 @@ module DocSpring
|
|
103
111
|
delete_custom_files == o.delete_custom_files &&
|
104
112
|
expires_in == o.expires_in &&
|
105
113
|
metadata == o.metadata &&
|
114
|
+
password == o.password &&
|
106
115
|
source_pdfs == o.source_pdfs &&
|
107
116
|
test == o.test
|
108
117
|
end
|
@@ -116,7 +125,7 @@ module DocSpring
|
|
116
125
|
# Calculates hash code according to all attributes.
|
117
126
|
# @return [Fixnum] Hash code
|
118
127
|
def hash
|
119
|
-
[delete_custom_files, expires_in, metadata, source_pdfs, test].hash
|
128
|
+
[delete_custom_files, expires_in, metadata, password, source_pdfs, test].hash
|
120
129
|
end
|
121
130
|
|
122
131
|
# Builds the object from hash
|
@@ -16,6 +16,8 @@ module DocSpring
|
|
16
16
|
class CombinedSubmission
|
17
17
|
attr_accessor :metadata
|
18
18
|
|
19
|
+
attr_accessor :password
|
20
|
+
|
19
21
|
attr_accessor :expired
|
20
22
|
|
21
23
|
attr_accessor :expires_at
|
@@ -60,6 +62,7 @@ module DocSpring
|
|
60
62
|
def self.attribute_map
|
61
63
|
{
|
62
64
|
:'metadata' => :'metadata',
|
65
|
+
:'password' => :'password',
|
63
66
|
:'expired' => :'expired',
|
64
67
|
:'expires_at' => :'expires_at',
|
65
68
|
:'source_pdfs' => :'source_pdfs',
|
@@ -76,6 +79,7 @@ module DocSpring
|
|
76
79
|
def self.openapi_types
|
77
80
|
{
|
78
81
|
:'metadata' => :'Object',
|
82
|
+
:'password' => :'String',
|
79
83
|
:'expired' => :'BOOLEAN',
|
80
84
|
:'expires_at' => :'String',
|
81
85
|
:'source_pdfs' => :'Array<Object>',
|
@@ -100,6 +104,10 @@ module DocSpring
|
|
100
104
|
self.metadata = attributes[:'metadata']
|
101
105
|
end
|
102
106
|
|
107
|
+
if attributes.has_key?(:'password')
|
108
|
+
self.password = attributes[:'password']
|
109
|
+
end
|
110
|
+
|
103
111
|
if attributes.has_key?(:'expired')
|
104
112
|
self.expired = attributes[:'expired']
|
105
113
|
end
|
@@ -174,6 +182,7 @@ module DocSpring
|
|
174
182
|
return true if self.equal?(o)
|
175
183
|
self.class == o.class &&
|
176
184
|
metadata == o.metadata &&
|
185
|
+
password == o.password &&
|
177
186
|
expired == o.expired &&
|
178
187
|
expires_at == o.expires_at &&
|
179
188
|
source_pdfs == o.source_pdfs &&
|
@@ -194,7 +203,7 @@ module DocSpring
|
|
194
203
|
# Calculates hash code according to all attributes.
|
195
204
|
# @return [Fixnum] Hash code
|
196
205
|
def hash
|
197
|
-
[metadata, expired, expires_at, source_pdfs, pdf_hash, download_url, submission_ids, id, state, actions].hash
|
206
|
+
[metadata, password, expired, expires_at, source_pdfs, pdf_hash, download_url, submission_ids, id, state, actions].hash
|
198
207
|
end
|
199
208
|
|
200
209
|
# Builds the object from hash
|
@@ -18,6 +18,8 @@ module DocSpring
|
|
18
18
|
|
19
19
|
attr_accessor :metadata
|
20
20
|
|
21
|
+
attr_accessor :password
|
22
|
+
|
21
23
|
attr_accessor :submission_ids
|
22
24
|
|
23
25
|
attr_accessor :test
|
@@ -27,6 +29,7 @@ module DocSpring
|
|
27
29
|
{
|
28
30
|
:'expires_in' => :'expires_in',
|
29
31
|
:'metadata' => :'metadata',
|
32
|
+
:'password' => :'password',
|
30
33
|
:'submission_ids' => :'submission_ids',
|
31
34
|
:'test' => :'test'
|
32
35
|
}
|
@@ -37,6 +40,7 @@ module DocSpring
|
|
37
40
|
{
|
38
41
|
:'expires_in' => :'Integer',
|
39
42
|
:'metadata' => :'Object',
|
43
|
+
:'password' => :'String',
|
40
44
|
:'submission_ids' => :'Array<String>',
|
41
45
|
:'test' => :'BOOLEAN'
|
42
46
|
}
|
@@ -58,6 +62,10 @@ module DocSpring
|
|
58
62
|
self.metadata = attributes[:'metadata']
|
59
63
|
end
|
60
64
|
|
65
|
+
if attributes.has_key?(:'password')
|
66
|
+
self.password = attributes[:'password']
|
67
|
+
end
|
68
|
+
|
61
69
|
if attributes.has_key?(:'submission_ids')
|
62
70
|
if (value = attributes[:'submission_ids']).is_a?(Array)
|
63
71
|
self.submission_ids = value
|
@@ -94,6 +102,7 @@ module DocSpring
|
|
94
102
|
self.class == o.class &&
|
95
103
|
expires_in == o.expires_in &&
|
96
104
|
metadata == o.metadata &&
|
105
|
+
password == o.password &&
|
97
106
|
submission_ids == o.submission_ids &&
|
98
107
|
test == o.test
|
99
108
|
end
|
@@ -107,7 +116,7 @@ module DocSpring
|
|
107
116
|
# Calculates hash code according to all attributes.
|
108
117
|
# @return [Fixnum] Hash code
|
109
118
|
def hash
|
110
|
-
[expires_in, metadata, submission_ids, test].hash
|
119
|
+
[expires_in, metadata, password, submission_ids, test].hash
|
111
120
|
end
|
112
121
|
|
113
122
|
# Builds the object from hash
|
@@ -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
|
@@ -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
|