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
@@ -34,7 +34,7 @@ module DocSpring
34
34
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
35
35
  def initialize(config = Configuration.default)
36
36
  @config = config
37
- @user_agent = "docspring-ruby-4.7.0"
37
+ @user_agent = "docspring-ruby-4.8.0"
38
38
  @default_headers = {
39
39
  'Content-Type' => 'application/json',
40
40
  'User-Agent' => @user_agent
@@ -0,0 +1,279 @@
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 where to put the page numbers.
18
+ class AddPageNumbersRequest < 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 label, where `{page}` is the page's number and `{total}` the last number. Default `Page {page} of {total}`. Latin letters, numbers and punctuation (the Windows-1252 characters).
29
+ attr_accessor :text
30
+
31
+ # Where the number goes. Default `bottom_center`.
32
+ attr_accessor :position
33
+
34
+ # The text's size in points. Default 10.
35
+ attr_accessor :font_size
36
+
37
+ # The first numbered page's number. Default 1.
38
+ attr_accessor :start_at
39
+
40
+ # The pages to number, such as `2-z` to skip a cover page. Default every page.
41
+ attr_accessor :pages
42
+
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
59
+
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'input' => :'input',
69
+ :'metadata' => :'metadata',
70
+ :'expires_in' => :'expires_in',
71
+ :'text' => :'text',
72
+ :'position' => :'position',
73
+ :'font_size' => :'font_size',
74
+ :'start_at' => :'start_at',
75
+ :'pages' => :'pages'
76
+ }
77
+ end
78
+
79
+ # Returns attribute mapping this model knows about
80
+ def self.acceptable_attribute_map
81
+ attribute_map
82
+ end
83
+
84
+ # Returns all the JSON keys this model knows about
85
+ def self.acceptable_attributes
86
+ acceptable_attribute_map.values
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.openapi_types
91
+ {
92
+ :'input' => :'JobSourceInput',
93
+ :'metadata' => :'Hash<String, Object>',
94
+ :'expires_in' => :'Integer',
95
+ :'text' => :'String',
96
+ :'position' => :'PageNumberPosition',
97
+ :'font_size' => :'Float',
98
+ :'start_at' => :'Integer',
99
+ :'pages' => :'String'
100
+ }
101
+ end
102
+
103
+ # List of attributes with nullable: true
104
+ def self.openapi_nullable
105
+ Set.new([
106
+ ])
107
+ end
108
+
109
+ # Returns attribute type mapping
110
+ def self.acceptable_openapi_types
111
+ openapi_types
112
+ end
113
+
114
+ # Returns the nullable attributes
115
+ def self.acceptable_openapi_nullable
116
+ openapi_nullable
117
+ end
118
+
119
+ # Initializes the object
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ def initialize(attributes = {})
122
+ if (!attributes.is_a?(Hash))
123
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::AddPageNumbersRequest` initialize method"
124
+ end
125
+
126
+ # check to see if the attribute exists and convert string to symbol for hash key
127
+ acceptable_attribute_map = self.class.acceptable_attribute_map
128
+ attributes = attributes.each_with_object({}) { |(k, v), h|
129
+ if (!acceptable_attribute_map.key?(k.to_sym))
130
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::AddPageNumbersRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
131
+ end
132
+ h[k.to_sym] = v
133
+ }
134
+
135
+ if attributes.key?(:'input')
136
+ self.input = attributes[:'input']
137
+ else
138
+ self.input = nil
139
+ end
140
+
141
+ if attributes.key?(:'metadata')
142
+ if (value = attributes[:'metadata']).is_a?(Hash)
143
+ self.metadata = value
144
+ end
145
+ end
146
+
147
+ if attributes.key?(:'expires_in')
148
+ self.expires_in = attributes[:'expires_in']
149
+ end
150
+
151
+ if attributes.key?(:'text')
152
+ self.text = attributes[:'text']
153
+ end
154
+
155
+ if attributes.key?(:'position')
156
+ self.position = attributes[:'position']
157
+ end
158
+
159
+ if attributes.key?(:'font_size')
160
+ self.font_size = attributes[:'font_size']
161
+ end
162
+
163
+ if attributes.key?(:'start_at')
164
+ self.start_at = attributes[:'start_at']
165
+ end
166
+
167
+ if attributes.key?(:'pages')
168
+ self.pages = attributes[:'pages']
169
+ end
170
+ end
171
+
172
+ # Show invalid properties with the reasons. Usually used together with valid?
173
+ # @return Array for valid properties with the reasons
174
+ def list_invalid_properties
175
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
176
+ invalid_properties = Array.new
177
+ if @input.nil?
178
+ invalid_properties.push('invalid value for "input", input cannot be nil.')
179
+ end
180
+
181
+ invalid_properties
182
+ end
183
+
184
+ # Check to see if the all the properties in the model are valid
185
+ # @return true if the model is valid
186
+ def valid?
187
+ warn '[DEPRECATED] the `valid?` method is obsolete'
188
+ return false if @input.nil?
189
+ true
190
+ end
191
+
192
+ # Custom attribute writer method with validation
193
+ # @param [Object] input Value to be assigned
194
+ def input=(input)
195
+ if input.nil?
196
+ fail ArgumentError, 'input cannot be nil'
197
+ end
198
+
199
+ @input = input
200
+ end
201
+
202
+ # Checks equality by comparing each attribute.
203
+ # @param [Object] Object to be compared
204
+ def ==(o)
205
+ return true if self.equal?(o)
206
+ self.class == o.class &&
207
+ input == o.input &&
208
+ metadata == o.metadata &&
209
+ expires_in == o.expires_in &&
210
+ text == o.text &&
211
+ position == o.position &&
212
+ font_size == o.font_size &&
213
+ start_at == o.start_at &&
214
+ pages == o.pages
215
+ end
216
+
217
+ # @see the `==` method
218
+ # @param [Object] Object to be compared
219
+ def eql?(o)
220
+ self == o
221
+ end
222
+
223
+ # Calculates hash code according to all attributes.
224
+ # @return [Integer] Hash code
225
+ def hash
226
+ [input, metadata, expires_in, text, position, font_size, start_at, pages].hash
227
+ end
228
+
229
+ # Builds the object from hash
230
+ # @param [Hash] attributes Model attributes in the form of hash
231
+ # @return [Object] Returns the model itself
232
+ def self.build_from_hash(attributes)
233
+ return nil unless attributes.is_a?(Hash)
234
+ attributes = attributes.transform_keys(&:to_sym)
235
+ # include attributes inherited from allOf parents (the nearest declaration wins)
236
+ map = acceptable_attribute_map
237
+ transformed_hash = {}
238
+ acceptable_openapi_types.each_pair do |key, type|
239
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
240
+ transformed_hash["#{key}"] = nil
241
+ elsif type =~ /\AArray<(.*)>/i
242
+ # check to ensure the input is an array given that the attribute
243
+ # is documented as an array but the input is not
244
+ if attributes[map[key]].is_a?(Array)
245
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
246
+ end
247
+ elsif !attributes[map[key]].nil?
248
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
249
+ end
250
+ end
251
+ # Responses can include enum values added after this client was released, so the enum setters
252
+ # accept any value while the model is built from a response
253
+ allocate.tap do |model|
254
+ model.instance_variable_set(:@_skip_enum_validation, true)
255
+ model.send(:initialize, transformed_hash)
256
+ model.remove_instance_variable(:@_skip_enum_validation)
257
+ end
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ # include attributes inherited from allOf parents (the nearest declaration wins)
265
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
266
+ value = self.send(attr)
267
+ if value.nil?
268
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
269
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
270
+ end
271
+
272
+ hash[param] = _to_hash(value)
273
+ end
274
+ hash
275
+ end
276
+
277
+ end
278
+
279
+ end
@@ -16,7 +16,7 @@ require 'time'
16
16
  module DocSpring
17
17
  # A question about DocSpring. Never include secrets, credentials or your users' data.
18
18
  class AskSupportHelpRequest < ApiModelBase
19
- # What you want to know, in a sentence or two. For a follow-up question, include what was asked and answered before that matters to it: each request is answered by itself.
19
+ # What you want to know, in a sentence or two. For a follow-up, send the questions and answers so far as `conversation`.
20
20
  attr_accessor :question
21
21
 
22
22
  # The API operation, MCP tool or CLI command involved, if any.
@@ -0,0 +1,222 @@
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 file itself, in base64.
18
+ class Base64JobSource < ApiModelBase
19
+ # Must be `base64`.
20
+ attr_accessor :type
21
+
22
+ # For a `base64` input, the file's bytes in base64. Up to 7 MB once decoded: upload bigger files (GET /uploads/presign). A job never returns it.
23
+ attr_accessor :data
24
+
25
+ # The file's name. The job names the files it makes after it (contract.pdf makes contract-1.pdf). Default the name of the custom file, job file or URL path.
26
+ attr_accessor :filename
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'type' => :'type',
32
+ :'data' => :'data',
33
+ :'filename' => :'filename'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'type' => :'String',
51
+ :'data' => :'String',
52
+ :'filename' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Returns attribute type mapping
63
+ def self.acceptable_openapi_types
64
+ openapi_types
65
+ end
66
+
67
+ # Returns the nullable attributes
68
+ def self.acceptable_openapi_nullable
69
+ openapi_nullable
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::Base64JobSource` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::Base64JobSource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'type')
89
+ self.type = attributes[:'type']
90
+ else
91
+ self.type = 'base64'
92
+ end
93
+
94
+ if attributes.key?(:'data')
95
+ self.data = attributes[:'data']
96
+ else
97
+ self.data = nil
98
+ end
99
+
100
+ if attributes.key?(:'filename')
101
+ self.filename = attributes[:'filename']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
+ invalid_properties = Array.new
110
+ if @type.nil?
111
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
112
+ end
113
+
114
+ if @data.nil?
115
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
116
+ end
117
+
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
125
+ return false if @type.nil?
126
+ return false if @data.nil?
127
+ true
128
+ end
129
+
130
+ # Custom attribute writer method with validation
131
+ # @param [Object] type Value to be assigned
132
+ def type=(type)
133
+ if type.nil?
134
+ fail ArgumentError, 'type cannot be nil'
135
+ end
136
+
137
+ @type = type
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] data Value to be assigned
142
+ def data=(data)
143
+ if data.nil?
144
+ fail ArgumentError, 'data cannot be nil'
145
+ end
146
+
147
+ @data = data
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ type == o.type &&
156
+ data == o.data &&
157
+ filename == o.filename
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Integer] Hash code
168
+ def hash
169
+ [type, data, filename].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def self.build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ attributes = attributes.transform_keys(&:to_sym)
178
+ # include attributes inherited from allOf parents (the nearest declaration wins)
179
+ map = acceptable_attribute_map
180
+ transformed_hash = {}
181
+ acceptable_openapi_types.each_pair do |key, type|
182
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
183
+ transformed_hash["#{key}"] = nil
184
+ elsif type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[map[key]].is_a?(Array)
188
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
189
+ end
190
+ elsif !attributes[map[key]].nil?
191
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
192
+ end
193
+ end
194
+ # Responses can include enum values added after this client was released, so the enum setters
195
+ # accept any value while the model is built from a response
196
+ allocate.tap do |model|
197
+ model.instance_variable_set(:@_skip_enum_validation, true)
198
+ model.send(:initialize, transformed_hash)
199
+ model.remove_instance_variable(:@_skip_enum_validation)
200
+ end
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ # include attributes inherited from allOf parents (the nearest declaration wins)
208
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ end
221
+
222
+ end