docspring 1.4.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 +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
@@ -0,0 +1,201 @@
|
|
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 Template1Defaults
|
17
|
+
attr_accessor :color
|
18
|
+
|
19
|
+
attr_accessor :font_size
|
20
|
+
|
21
|
+
attr_accessor :typeface
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'color' => :'color',
|
27
|
+
:'font_size' => :'fontSize',
|
28
|
+
:'typeface' => :'typeface'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'color' => :'String',
|
36
|
+
:'font_size' => :'Float',
|
37
|
+
:'typeface' => :'String'
|
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?(:'color')
|
50
|
+
self.color = attributes[:'color']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.has_key?(:'fontSize')
|
54
|
+
self.font_size = attributes[:'fontSize']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.has_key?(:'typeface')
|
58
|
+
self.typeface = attributes[:'typeface']
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
63
|
+
# @return Array for valid properties with the reasons
|
64
|
+
def list_invalid_properties
|
65
|
+
invalid_properties = Array.new
|
66
|
+
invalid_properties
|
67
|
+
end
|
68
|
+
|
69
|
+
# Check to see if the all the properties in the model are valid
|
70
|
+
# @return true if the model is valid
|
71
|
+
def valid?
|
72
|
+
true
|
73
|
+
end
|
74
|
+
|
75
|
+
# Checks equality by comparing each attribute.
|
76
|
+
# @param [Object] Object to be compared
|
77
|
+
def ==(o)
|
78
|
+
return true if self.equal?(o)
|
79
|
+
self.class == o.class &&
|
80
|
+
color == o.color &&
|
81
|
+
font_size == o.font_size &&
|
82
|
+
typeface == o.typeface
|
83
|
+
end
|
84
|
+
|
85
|
+
# @see the `==` method
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def eql?(o)
|
88
|
+
self == o
|
89
|
+
end
|
90
|
+
|
91
|
+
# Calculates hash code according to all attributes.
|
92
|
+
# @return [Fixnum] Hash code
|
93
|
+
def hash
|
94
|
+
[color, font_size, typeface].hash
|
95
|
+
end
|
96
|
+
|
97
|
+
# Builds the object from hash
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
# @return [Object] Returns the model itself
|
100
|
+
def build_from_hash(attributes)
|
101
|
+
return nil unless attributes.is_a?(Hash)
|
102
|
+
self.class.openapi_types.each_pair do |key, type|
|
103
|
+
if type =~ /\AArray<(.*)>/i
|
104
|
+
# check to ensure the input is an array given that the the attribute
|
105
|
+
# is documented as an array but the input is not
|
106
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
107
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
108
|
+
end
|
109
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
110
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
111
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
112
|
+
end
|
113
|
+
|
114
|
+
self
|
115
|
+
end
|
116
|
+
|
117
|
+
# Deserializes the data based on type
|
118
|
+
# @param string type Data type
|
119
|
+
# @param string value Value to be deserialized
|
120
|
+
# @return [Object] Deserialized data
|
121
|
+
def _deserialize(type, value)
|
122
|
+
case type.to_sym
|
123
|
+
when :DateTime
|
124
|
+
DateTime.parse(value)
|
125
|
+
when :Date
|
126
|
+
Date.parse(value)
|
127
|
+
when :String
|
128
|
+
value.to_s
|
129
|
+
when :Integer
|
130
|
+
value.to_i
|
131
|
+
when :Float
|
132
|
+
value.to_f
|
133
|
+
when :BOOLEAN
|
134
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
135
|
+
true
|
136
|
+
else
|
137
|
+
false
|
138
|
+
end
|
139
|
+
when :Object
|
140
|
+
# generic object (usually a Hash), return directly
|
141
|
+
value
|
142
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
143
|
+
inner_type = Regexp.last_match[:inner_type]
|
144
|
+
value.map { |v| _deserialize(inner_type, v) }
|
145
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
146
|
+
k_type = Regexp.last_match[:k_type]
|
147
|
+
v_type = Regexp.last_match[:v_type]
|
148
|
+
{}.tap do |hash|
|
149
|
+
value.each do |k, v|
|
150
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
else # model
|
154
|
+
temp_model = DocSpring.const_get(type).new
|
155
|
+
temp_model.build_from_hash(value)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
# Returns the string representation of the object
|
160
|
+
# @return [String] String presentation of the object
|
161
|
+
def to_s
|
162
|
+
to_hash.to_s
|
163
|
+
end
|
164
|
+
|
165
|
+
# to_body is an alias to to_hash (backward compatibility)
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
167
|
+
def to_body
|
168
|
+
to_hash
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the object in the form of hash
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
173
|
+
def to_hash
|
174
|
+
hash = {}
|
175
|
+
self.class.attribute_map.each_pair do |attr, param|
|
176
|
+
value = self.send(attr)
|
177
|
+
next if value.nil?
|
178
|
+
hash[param] = _to_hash(value)
|
179
|
+
end
|
180
|
+
hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Outputs non-array value in the form of hash
|
184
|
+
# For object, use to_hash. Otherwise, just return the value
|
185
|
+
# @param [Object] value Any valid value
|
186
|
+
# @return [Hash] Returns the value in the form of hash
|
187
|
+
def _to_hash(value)
|
188
|
+
if value.is_a?(Array)
|
189
|
+
value.compact.map { |v| _to_hash(v) }
|
190
|
+
elsif value.is_a?(Hash)
|
191
|
+
{}.tap do |hash|
|
192
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
193
|
+
end
|
194
|
+
elsif value.respond_to? :to_hash
|
195
|
+
value.to_hash
|
196
|
+
else
|
197
|
+
value
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
data/lib/docspring/version.rb
CHANGED
data/lib/docspring.rb
CHANGED
@@ -44,6 +44,7 @@ require 'docspring/models/folder'
|
|
44
44
|
require 'docspring/models/folders_folder'
|
45
45
|
require 'docspring/models/html_template_data'
|
46
46
|
require 'docspring/models/invalid_request'
|
47
|
+
require 'docspring/models/list_submissions_response'
|
47
48
|
require 'docspring/models/move_folder_data'
|
48
49
|
require 'docspring/models/move_template_data'
|
49
50
|
require 'docspring/models/pending_template'
|
@@ -56,6 +57,8 @@ require 'docspring/models/submission_data'
|
|
56
57
|
require 'docspring/models/submission_data_batch_request'
|
57
58
|
require 'docspring/models/submission_data_request'
|
58
59
|
require 'docspring/models/template'
|
60
|
+
require 'docspring/models/template1'
|
61
|
+
require 'docspring/models/template1_defaults'
|
59
62
|
require 'docspring/models/template_data'
|
60
63
|
require 'docspring/models/templatestemplate_idadd_fields_fields'
|
61
64
|
require 'docspring/models/update_data_request_response'
|
@@ -55,7 +55,7 @@ describe DocSpring::Client do
|
|
55
55
|
)
|
56
56
|
}.to raise_error(
|
57
57
|
DocSpring::ApiError,
|
58
|
-
'Unprocessable Entity:
|
58
|
+
'Unprocessable Entity: Your submission data did not contain a ' \
|
59
59
|
"required property of 'description'"
|
60
60
|
)
|
61
61
|
end
|
@@ -268,6 +268,18 @@ describe 'PDFApi' do
|
|
268
268
|
expect(result).to_not be_nil
|
269
269
|
end
|
270
270
|
end
|
271
|
+
# integration tests for get_full_template
|
272
|
+
# Fetch the full template attributes
|
273
|
+
# @param template_id
|
274
|
+
# @param [Hash] opts the optional parameters
|
275
|
+
# @return [Template1]
|
276
|
+
describe 'get_full_template test' do
|
277
|
+
it 'should work' do
|
278
|
+
template_id = 'tpl_000000000000000001' # String |
|
279
|
+
result = api_instance.get_full_template(template_id)
|
280
|
+
expect(result).to_not be_nil
|
281
|
+
end
|
282
|
+
end
|
271
283
|
# integration tests for get_presign_url
|
272
284
|
# Get a presigned URL so that you can upload a file to our AWS S3 bucket
|
273
285
|
# @param [Hash] opts the optional parameters
|
@@ -311,13 +323,13 @@ describe 'PDFApi' do
|
|
311
323
|
end
|
312
324
|
end
|
313
325
|
# integration tests for get_template
|
314
|
-
#
|
326
|
+
# Check the status of an uploaded template
|
315
327
|
# @param template_id
|
316
328
|
# @param [Hash] opts the optional parameters
|
317
329
|
# @return [Template]
|
318
330
|
describe 'get_template test' do
|
319
331
|
it 'should work' do
|
320
|
-
template_id = '
|
332
|
+
template_id = 'tpl_000000000000000001' # String |
|
321
333
|
result = api_instance.get_template(template_id)
|
322
334
|
expect(result).to_not be_nil
|
323
335
|
end
|
@@ -348,6 +360,56 @@ describe 'PDFApi' do
|
|
348
360
|
expect(result).to_not be_nil
|
349
361
|
end
|
350
362
|
end
|
363
|
+
# integration tests for list_submissions
|
364
|
+
# List all submissions
|
365
|
+
# @param [Hash] opts the optional parameters
|
366
|
+
# @option opts [String] :cursor
|
367
|
+
# @option opts [Float] :limit
|
368
|
+
# @option opts [String] :created_after
|
369
|
+
# @option opts [String] :created_before
|
370
|
+
# @option opts [String] :type
|
371
|
+
# @option opts [BOOLEAN] :include_data
|
372
|
+
# @return [ListSubmissionsResponse]
|
373
|
+
describe 'list_submissions test' do
|
374
|
+
it 'should work' do
|
375
|
+
opts = {
|
376
|
+
cursor: 'sub_list_000012', # String |
|
377
|
+
limit: 3, # Float |
|
378
|
+
created_after: '2019-01-01T09:00:00-05:00', # String |
|
379
|
+
created_before: '2020-01-01T09:00:00-05:00', # String |
|
380
|
+
type: 'test', # String |
|
381
|
+
include_data: true # BOOLEAN |
|
382
|
+
}
|
383
|
+
result = api_instance.list_submissions(opts)
|
384
|
+
expect(result).to_not be_nil
|
385
|
+
end
|
386
|
+
end
|
387
|
+
# integration tests for list_submissions_0
|
388
|
+
# List all submissions for a given template
|
389
|
+
# @param template_id
|
390
|
+
# @param [Hash] opts the optional parameters
|
391
|
+
# @option opts [String] :cursor
|
392
|
+
# @option opts [Float] :limit
|
393
|
+
# @option opts [String] :created_after
|
394
|
+
# @option opts [String] :created_before
|
395
|
+
# @option opts [String] :type
|
396
|
+
# @option opts [BOOLEAN] :include_data
|
397
|
+
# @return [ListSubmissionsResponse]
|
398
|
+
describe 'list_submissions_0 test' do
|
399
|
+
it 'should work' do
|
400
|
+
template_id = 'tpl_000000000000000002' # String |
|
401
|
+
opts = {
|
402
|
+
cursor: 'cursor_example', # String |
|
403
|
+
limit: 3.4, # Float |
|
404
|
+
created_after: 'created_after_example', # String |
|
405
|
+
created_before: 'created_before_example', # String |
|
406
|
+
type: 'type_example', # String |
|
407
|
+
include_data: true # BOOLEAN |
|
408
|
+
}
|
409
|
+
result = api_instance.list_submissions_0(template_id, opts)
|
410
|
+
expect(result).to_not be_nil
|
411
|
+
end
|
412
|
+
end
|
351
413
|
# integration tests for list_templates
|
352
414
|
# Get a list of all templates
|
353
415
|
# @param [Hash] opts the optional parameters
|
@@ -50,6 +50,12 @@ describe 'CombinePdfsData' do
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
+
describe 'test attribute "password"' do
|
54
|
+
it 'should work' do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
53
59
|
describe 'test attribute "source_pdfs"' do
|
54
60
|
it 'should work' do
|
55
61
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -44,6 +44,12 @@ describe 'CombinedSubmissionData' do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
describe 'test attribute "password"' do
|
48
|
+
it 'should work' do
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
47
53
|
describe 'test attribute "submission_ids"' do
|
48
54
|
it 'should work' do
|
49
55
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -38,6 +38,12 @@ describe 'CombinedSubmission' do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
describe 'test attribute "password"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
41
47
|
describe 'test attribute "expired"' do
|
42
48
|
it 'should work' do
|
43
49
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -0,0 +1,53 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for DocSpring::ListSubmissionsResponse
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'ListSubmissionsResponse' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = DocSpring::ListSubmissionsResponse.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of ListSubmissionsResponse' do
|
31
|
+
it 'should create an instance of ListSubmissionsResponse' do
|
32
|
+
expect(@instance).to be_instance_of(DocSpring::ListSubmissionsResponse)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "next_cursor"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "submissions"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe 'test attribute "limit"' do
|
48
|
+
it 'should work' do
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
@@ -68,6 +68,12 @@ describe 'SubmissionData' do
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
+
describe 'test attribute "password"' do
|
72
|
+
it 'should work' do
|
73
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
71
77
|
describe 'test attribute "test"' do
|
72
78
|
it 'should work' do
|
73
79
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -0,0 +1,53 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for DocSpring::Template1Defaults
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'Template1Defaults' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = DocSpring::Template1Defaults.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of Template1Defaults' do
|
31
|
+
it 'should create an instance of Template1Defaults' do
|
32
|
+
expect(@instance).to be_instance_of(DocSpring::Template1Defaults)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "color"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "font_size"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe 'test attribute "typeface"' do
|
48
|
+
it 'should work' do
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|