docspring 4.7.0 → 4.8.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.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +18 -1
  4. data/lib/docspring/api/client.rb +1354 -123
  5. data/lib/docspring/api_client.rb +1 -1
  6. data/lib/docspring/models/add_page_numbers_request.rb +279 -0
  7. data/lib/docspring/models/ask_support_help_request.rb +1 -1
  8. data/lib/docspring/models/base64_job_source.rb +222 -0
  9. data/lib/docspring/models/combined_pdf_job_source.rb +222 -0
  10. data/lib/docspring/models/compress_pdf_request.rb +207 -0
  11. data/lib/docspring/models/create_template_request.rb +22 -2
  12. data/lib/docspring/models/custom_file_job_source.rb +222 -0
  13. data/lib/docspring/models/decrypt_pdf_request.rb +217 -0
  14. data/lib/docspring/models/encrypt_pdf_request.rb +237 -0
  15. data/lib/docspring/models/error_info.rb +15 -5
  16. data/lib/docspring/models/extract_pages_request.rb +234 -0
  17. data/lib/docspring/models/field.rb +1 -1
  18. data/lib/docspring/models/field_input.rb +1 -1
  19. data/lib/docspring/models/flatten_pdf_request.rb +207 -0
  20. data/lib/docspring/models/html_engine_options.rb +1 -1
  21. data/lib/docspring/models/html_engine_options_input.rb +1 -1
  22. data/lib/docspring/models/htmlto_pdf_request.rb +322 -0
  23. data/lib/docspring/models/image_format.rb +41 -0
  24. data/lib/docspring/models/images_to_pdf_request.rb +241 -0
  25. data/lib/docspring/models/job.rb +508 -0
  26. data/lib/docspring/models/job_file.rb +308 -0
  27. data/lib/docspring/models/job_file_job_source.rb +232 -0
  28. data/lib/docspring/models/job_html_engine.rb +41 -0
  29. data/lib/docspring/models/job_list.rb +200 -0
  30. data/lib/docspring/models/job_operation.rb +53 -0
  31. data/lib/docspring/models/job_operation_filter.rb +53 -0
  32. data/lib/docspring/models/job_options.rb +392 -0
  33. data/lib/docspring/models/job_page_margin.rb +198 -0
  34. data/lib/docspring/models/job_page_size.rb +51 -0
  35. data/lib/docspring/models/job_source.rb +267 -0
  36. data/lib/docspring/models/job_source_input.rb +66 -0
  37. data/lib/docspring/models/job_source_type.rb +46 -0
  38. data/lib/docspring/models/job_state.rb +42 -0
  39. data/lib/docspring/models/markdown_to_pdf_request.rb +312 -0
  40. data/lib/docspring/models/page_image.rb +3 -3
  41. data/lib/docspring/models/page_number_position.rb +45 -0
  42. data/lib/docspring/models/page_size.rb +45 -0
  43. data/lib/docspring/models/pdf_permissions.rb +198 -0
  44. data/lib/docspring/models/pdf_permissions_input.rb +198 -0
  45. data/lib/docspring/models/pdfto_images_request.rb +269 -0
  46. data/lib/docspring/models/pdfto_text_request.rb +217 -0
  47. data/lib/docspring/models/rotate_pages_request.rb +244 -0
  48. data/lib/docspring/models/split_pdf_request.rb +229 -0
  49. data/lib/docspring/models/submission_job_source.rb +222 -0
  50. data/lib/docspring/models/template.rb +41 -2
  51. data/lib/docspring/models/template_blank_page.rb +212 -0
  52. data/lib/docspring/models/template_blank_page_input.rb +212 -0
  53. data/lib/docspring/models/template_document.rb +1 -1
  54. data/lib/docspring/models/template_html_engine.rb +41 -0
  55. data/lib/docspring/models/template_page_images.rb +3 -3
  56. data/lib/docspring/models/template_page_list.rb +243 -0
  57. data/lib/docspring/models/template_page_list_input.rb +243 -0
  58. data/lib/docspring/models/template_page_processing_status.rb +28 -1
  59. data/lib/docspring/models/update_template_request.rb +33 -2
  60. data/lib/docspring/models/upload_job_source.rb +222 -0
  61. data/lib/docspring/models/url_job_source.rb +222 -0
  62. data/lib/docspring/models/watermark_layer.rb +41 -0
  63. data/lib/docspring/models/watermark_pdf_request.rb +316 -0
  64. data/lib/docspring/models/webhook_event_type.rb +4 -1
  65. data/lib/docspring/request_schemas.json +1997 -45
  66. data/lib/docspring/version.rb +1 -1
  67. data/lib/docspring.rb +45 -0
  68. metadata +46 -1
@@ -0,0 +1,316 @@
1
+ =begin
2
+ #DocSpring API
3
+
4
+ #Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and 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 PDF, and the text to put across its pages.
18
+ class WatermarkPdfRequest < ApiModelBase
19
+ # The file the job reads. The job shows it as `inputs[0]`.
20
+ attr_accessor :input
21
+
22
+ # Your own data about the job, such as an ID from your app. Up to 50 keys.
23
+ attr_accessor :metadata
24
+
25
+ # Seconds after the job finishes until its files are deleted, up to 10 years (315360000), sooner or later than the account's expiry setting. Defaults to the account's expiry setting for the PDF tools, which keeps them until you delete the job when it's off. A job that fails is kept for at least 48 hours.
26
+ attr_accessor :expires_in
27
+
28
+ # The watermark's text, such as `CONFIDENTIAL`. Latin letters, numbers and punctuation (the Windows-1252 characters).
29
+ attr_accessor :text
30
+
31
+ # The text's size in points. Default the largest size up to 96 that fits across the page.
32
+ attr_accessor :font_size
33
+
34
+ # The text color, such as `#cc0000`. Default `#888888`.
35
+ attr_accessor :color
36
+
37
+ # From 0.05 (faint) to 1 (solid). Default 0.25.
38
+ attr_accessor :opacity
39
+
40
+ # Degrees to turn the text anticlockwise. Default 45.
41
+ attr_accessor :angle
42
+
43
+ # `over` the page content (the default), or `under` it, where opaque content hides it.
44
+ attr_accessor :layer
45
+
46
+ # The pages to use, such as `1-3,5,8-z` (`z` is the last page). Default every page.
47
+ attr_accessor :pages
48
+
49
+ class EnumAttributeValidator
50
+ attr_reader :datatype
51
+ attr_reader :allowable_values
52
+
53
+ def initialize(datatype, allowable_values)
54
+ @allowable_values = allowable_values.map do |value|
55
+ case datatype.to_s
56
+ when /Integer/i
57
+ value.to_i
58
+ when /Float/i
59
+ value.to_f
60
+ else
61
+ value
62
+ end
63
+ end
64
+ end
65
+
66
+ def valid?(value)
67
+ !value || allowable_values.include?(value)
68
+ end
69
+ end
70
+
71
+ # Attribute mapping from ruby-style variable name to JSON key.
72
+ def self.attribute_map
73
+ {
74
+ :'input' => :'input',
75
+ :'metadata' => :'metadata',
76
+ :'expires_in' => :'expires_in',
77
+ :'text' => :'text',
78
+ :'font_size' => :'font_size',
79
+ :'color' => :'color',
80
+ :'opacity' => :'opacity',
81
+ :'angle' => :'angle',
82
+ :'layer' => :'layer',
83
+ :'pages' => :'pages'
84
+ }
85
+ end
86
+
87
+ # Returns attribute mapping this model knows about
88
+ def self.acceptable_attribute_map
89
+ attribute_map
90
+ end
91
+
92
+ # Returns all the JSON keys this model knows about
93
+ def self.acceptable_attributes
94
+ acceptable_attribute_map.values
95
+ end
96
+
97
+ # Attribute type mapping.
98
+ def self.openapi_types
99
+ {
100
+ :'input' => :'JobSourceInput',
101
+ :'metadata' => :'Hash<String, Object>',
102
+ :'expires_in' => :'Integer',
103
+ :'text' => :'String',
104
+ :'font_size' => :'Float',
105
+ :'color' => :'String',
106
+ :'opacity' => :'Float',
107
+ :'angle' => :'Float',
108
+ :'layer' => :'WatermarkLayer',
109
+ :'pages' => :'String'
110
+ }
111
+ end
112
+
113
+ # List of attributes with nullable: true
114
+ def self.openapi_nullable
115
+ Set.new([
116
+ ])
117
+ end
118
+
119
+ # Returns attribute type mapping
120
+ def self.acceptable_openapi_types
121
+ openapi_types
122
+ end
123
+
124
+ # Returns the nullable attributes
125
+ def self.acceptable_openapi_nullable
126
+ openapi_nullable
127
+ end
128
+
129
+ # Initializes the object
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ def initialize(attributes = {})
132
+ if (!attributes.is_a?(Hash))
133
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::WatermarkPdfRequest` initialize method"
134
+ end
135
+
136
+ # check to see if the attribute exists and convert string to symbol for hash key
137
+ acceptable_attribute_map = self.class.acceptable_attribute_map
138
+ attributes = attributes.each_with_object({}) { |(k, v), h|
139
+ if (!acceptable_attribute_map.key?(k.to_sym))
140
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::WatermarkPdfRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
141
+ end
142
+ h[k.to_sym] = v
143
+ }
144
+
145
+ if attributes.key?(:'input')
146
+ self.input = attributes[:'input']
147
+ else
148
+ self.input = nil
149
+ end
150
+
151
+ if attributes.key?(:'metadata')
152
+ if (value = attributes[:'metadata']).is_a?(Hash)
153
+ self.metadata = value
154
+ end
155
+ end
156
+
157
+ if attributes.key?(:'expires_in')
158
+ self.expires_in = attributes[:'expires_in']
159
+ end
160
+
161
+ if attributes.key?(:'text')
162
+ self.text = attributes[:'text']
163
+ else
164
+ self.text = nil
165
+ end
166
+
167
+ if attributes.key?(:'font_size')
168
+ self.font_size = attributes[:'font_size']
169
+ end
170
+
171
+ if attributes.key?(:'color')
172
+ self.color = attributes[:'color']
173
+ end
174
+
175
+ if attributes.key?(:'opacity')
176
+ self.opacity = attributes[:'opacity']
177
+ end
178
+
179
+ if attributes.key?(:'angle')
180
+ self.angle = attributes[:'angle']
181
+ end
182
+
183
+ if attributes.key?(:'layer')
184
+ self.layer = attributes[:'layer']
185
+ end
186
+
187
+ if attributes.key?(:'pages')
188
+ self.pages = attributes[:'pages']
189
+ end
190
+ end
191
+
192
+ # Show invalid properties with the reasons. Usually used together with valid?
193
+ # @return Array for valid properties with the reasons
194
+ def list_invalid_properties
195
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
196
+ invalid_properties = Array.new
197
+ if @input.nil?
198
+ invalid_properties.push('invalid value for "input", input cannot be nil.')
199
+ end
200
+
201
+ if @text.nil?
202
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
203
+ end
204
+
205
+ invalid_properties
206
+ end
207
+
208
+ # Check to see if the all the properties in the model are valid
209
+ # @return true if the model is valid
210
+ def valid?
211
+ warn '[DEPRECATED] the `valid?` method is obsolete'
212
+ return false if @input.nil?
213
+ return false if @text.nil?
214
+ true
215
+ end
216
+
217
+ # Custom attribute writer method with validation
218
+ # @param [Object] input Value to be assigned
219
+ def input=(input)
220
+ if input.nil?
221
+ fail ArgumentError, 'input cannot be nil'
222
+ end
223
+
224
+ @input = input
225
+ end
226
+
227
+ # Custom attribute writer method with validation
228
+ # @param [Object] text Value to be assigned
229
+ def text=(text)
230
+ if text.nil?
231
+ fail ArgumentError, 'text cannot be nil'
232
+ end
233
+
234
+ @text = text
235
+ end
236
+
237
+ # Checks equality by comparing each attribute.
238
+ # @param [Object] Object to be compared
239
+ def ==(o)
240
+ return true if self.equal?(o)
241
+ self.class == o.class &&
242
+ input == o.input &&
243
+ metadata == o.metadata &&
244
+ expires_in == o.expires_in &&
245
+ text == o.text &&
246
+ font_size == o.font_size &&
247
+ color == o.color &&
248
+ opacity == o.opacity &&
249
+ angle == o.angle &&
250
+ layer == o.layer &&
251
+ pages == o.pages
252
+ end
253
+
254
+ # @see the `==` method
255
+ # @param [Object] Object to be compared
256
+ def eql?(o)
257
+ self == o
258
+ end
259
+
260
+ # Calculates hash code according to all attributes.
261
+ # @return [Integer] Hash code
262
+ def hash
263
+ [input, metadata, expires_in, text, font_size, color, opacity, angle, layer, pages].hash
264
+ end
265
+
266
+ # Builds the object from hash
267
+ # @param [Hash] attributes Model attributes in the form of hash
268
+ # @return [Object] Returns the model itself
269
+ def self.build_from_hash(attributes)
270
+ return nil unless attributes.is_a?(Hash)
271
+ attributes = attributes.transform_keys(&:to_sym)
272
+ # include attributes inherited from allOf parents (the nearest declaration wins)
273
+ map = acceptable_attribute_map
274
+ transformed_hash = {}
275
+ acceptable_openapi_types.each_pair do |key, type|
276
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
277
+ transformed_hash["#{key}"] = nil
278
+ elsif type =~ /\AArray<(.*)>/i
279
+ # check to ensure the input is an array given that the attribute
280
+ # is documented as an array but the input is not
281
+ if attributes[map[key]].is_a?(Array)
282
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
283
+ end
284
+ elsif !attributes[map[key]].nil?
285
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
286
+ end
287
+ end
288
+ # Responses can include enum values added after this client was released, so the enum setters
289
+ # accept any value while the model is built from a response
290
+ allocate.tap do |model|
291
+ model.instance_variable_set(:@_skip_enum_validation, true)
292
+ model.send(:initialize, transformed_hash)
293
+ model.remove_instance_variable(:@_skip_enum_validation)
294
+ end
295
+ end
296
+
297
+ # Returns the object in the form of hash
298
+ # @return [Hash] Returns the object in the form of hash
299
+ def to_hash
300
+ hash = {}
301
+ # include attributes inherited from allOf parents (the nearest declaration wins)
302
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
303
+ value = self.send(attr)
304
+ if value.nil?
305
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
306
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
307
+ end
308
+
309
+ hash[param] = _to_hash(value)
310
+ end
311
+ hash
312
+ end
313
+
314
+ end
315
+
316
+ end
@@ -25,6 +25,8 @@ module DocSpring
25
25
  SIGNATURE_REQUEST_EMAIL_BOUNCED = "signature_request.email_bounced".freeze
26
26
  COMBINED_PDF_PROCESSED = "combined_pdf.processed".freeze
27
27
  COMBINED_PDF_FAILED = "combined_pdf.failed".freeze
28
+ JOB_PROCESSED = "job.processed".freeze
29
+ JOB_FAILED = "job.failed".freeze
28
30
  SUBMISSION_BATCH_PROCESSED = "submission_batch.processed".freeze
29
31
  SUBMISSION_BATCH_FAILED = "submission_batch.failed".freeze
30
32
  SUBMISSION_CREATED = "submission.created".freeze
@@ -32,6 +34,7 @@ module DocSpring
32
34
  SUBMISSION_EXPIRED = "submission.expired".freeze
33
35
  SIGNATURE_REQUEST_UPDATED = "signature_request.updated".freeze
34
36
  COMBINED_PDF_EXPIRED = "combined_pdf.expired".freeze
37
+ JOB_EXPIRED = "job.expired".freeze
35
38
  TEMPLATE_CREATED = "template.created".freeze
36
39
  TEMPLATE_UPDATED = "template.updated".freeze
37
40
  TEMPLATE_DELETED = "template.deleted".freeze
@@ -44,7 +47,7 @@ module DocSpring
44
47
  FOLDER_DELETED = "folder.deleted".freeze
45
48
 
46
49
  def self.all_vars
47
- @all_vars ||= [SUBMISSION_PROCESSED, SUBMISSION_FAILED, SUBMISSION_DECLINED, SIGNATURE_REQUEST_SENT, SIGNATURE_REQUEST_VIEWED, SIGNATURE_REQUEST_COMPLETED, SIGNATURE_REQUEST_DECLINED, SIGNATURE_REQUEST_EMAIL_BOUNCED, COMBINED_PDF_PROCESSED, COMBINED_PDF_FAILED, SUBMISSION_BATCH_PROCESSED, SUBMISSION_BATCH_FAILED, SUBMISSION_CREATED, SUBMISSION_UPDATED, SUBMISSION_EXPIRED, SIGNATURE_REQUEST_UPDATED, COMBINED_PDF_EXPIRED, TEMPLATE_CREATED, TEMPLATE_UPDATED, TEMPLATE_DELETED, WEBHOOK_CREATED, WEBHOOK_UPDATED, WEBHOOK_DELETED, CUSTOM_FILE_CREATED, FOLDER_CREATED, FOLDER_UPDATED, FOLDER_DELETED].freeze
50
+ @all_vars ||= [SUBMISSION_PROCESSED, SUBMISSION_FAILED, SUBMISSION_DECLINED, SIGNATURE_REQUEST_SENT, SIGNATURE_REQUEST_VIEWED, SIGNATURE_REQUEST_COMPLETED, SIGNATURE_REQUEST_DECLINED, SIGNATURE_REQUEST_EMAIL_BOUNCED, COMBINED_PDF_PROCESSED, COMBINED_PDF_FAILED, JOB_PROCESSED, JOB_FAILED, SUBMISSION_BATCH_PROCESSED, SUBMISSION_BATCH_FAILED, SUBMISSION_CREATED, SUBMISSION_UPDATED, SUBMISSION_EXPIRED, SIGNATURE_REQUEST_UPDATED, COMBINED_PDF_EXPIRED, JOB_EXPIRED, TEMPLATE_CREATED, TEMPLATE_UPDATED, TEMPLATE_DELETED, WEBHOOK_CREATED, WEBHOOK_UPDATED, WEBHOOK_DELETED, CUSTOM_FILE_CREATED, FOLDER_CREATED, FOLDER_UPDATED, FOLDER_DELETED].freeze
48
51
  end
49
52
 
50
53
  # Builds the enum from string