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
@@ -16,7 +16,7 @@ require 'time'
16
16
  module DocSpring
17
17
  # What went wrong.
18
18
  class ErrorInfo < ApiModelBase
19
- # A machine-readable error code. Clients should handle codes they don't know: new codes can be added. `invalid_data`: a submission's data doesn't match its template's fields. The submission is still recorded. `insufficient_credits` (402): your credit balance can't cover a live PDF. The record was saved and waits for credits in the `insufficient_credits` state: its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `insufficient_credits_to_send` (402): your credit balance can't cover a live signature request that DocSpring would email, so nothing was saved. Add credits and send the request again. `upgrade_required` (403): your plan doesn't include this, such as more templates, another active integration (webhooks count), the embedded template editor, email actions, or live signature requests before your account's first payment. `account_suspended` (403): the account is suspended, so it can't create submissions, or it's scheduled for deletion, so every request is refused until one of its users signs in to cancel that. `polling_timeout`: on a sync.api host, the files weren't ready in time. The record was created and is still being processed: its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id` or `template_id` (`support_help_id` for a question to the AI help that wasn't answered in time). Without one of these IDs, the request itself got no answer in time, and the record may or may not have been created. `idempotency_key_in_use` (409): the first request with the same Idempotency-Key is still being processed, and the response has a `Retry-After` header: send the request again then. Without the header, the first request was processed but its response is no longer kept, or it failed after creating or changing a record, and the message says which. When the first request created a record, or changed a template's fields or published a version of it, the message names it, and its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id`, `template_id`, `folder_id`, `custom_file_id`, `webhook_id`, `email_action_id` or `email_domain_id` (a signature request's events and tokens have no member). `idempotency_key_reused` (422): the Idempotency-Key was already used for a different request. `rate_limited` (429): too many API requests. Wait for the `Retry-After` header's seconds. `daily_email_limit_reached` (429): a submission that DocSpring would email would take your account over its daily email limit, so nothing was saved. Send it again after the `Retry-After` header's seconds (midnight UTC), or send the signing links yourself (`send_email: false`). `support_feedback_limit_reached` and `support_ticket_limit_reached` (429): the account has sent its 50 pieces of feedback or opened its 20 support tickets in 24 hours. Send it again after the `Retry-After` header's seconds. `support_help_limit_reached` (429): the caller has asked DocSpring's AI help its questions for 24 hours. The message says how to ask more.
19
+ # A machine-readable error code. Clients should handle codes they don't know: new codes can be added. `invalid_data`: a submission's data doesn't match its template's fields. The submission is still recorded. `insufficient_credits` (402): your credit balance can't cover a live PDF. The record was saved and waits for credits in the `insufficient_credits` state: its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `insufficient_credits_to_send` (402): your credit balance can't cover a live signature request that DocSpring would email, so nothing was saved. Add credits and send the request again. `upgrade_required` (403): your plan doesn't include this, such as more templates, another active integration (webhooks count), the embedded template editor, email actions, the PDF tools on a legacy plan, or live signature requests before your account's first payment. `account_suspended` (403): the account is suspended, so it can't create submissions, or it's scheduled for deletion, so every request is refused until one of its users signs in to cancel that. `polling_timeout`: on a sync.api host, the files weren't ready in time. The record was created and is still being processed: its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id`, `template_id` or `job_id` (`support_help_id` for a question to the AI help that wasn't answered in time). Without one of these IDs, the request itself got no answer in time, and the record may or may not have been created. `idempotency_key_in_use` (409): the first request with the same Idempotency-Key is still being processed, and the response has a `Retry-After` header: send the request again then. Without the header, the first request was processed but its response is no longer kept, or it failed after creating or changing a record, and the message says which. When the first request created a record, or changed a template's fields or published a version of it, the message names it, and its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id`, `template_id`, `folder_id`, `custom_file_id`, `webhook_id`, `email_action_id`, `email_domain_id` or `job_id` (a signature request's events and tokens have no member). `idempotency_key_reused` (422): the Idempotency-Key was already used for a different request. `rate_limited` (429): too many API requests. Wait for the `Retry-After` header's seconds. `daily_email_limit_reached` (429): a submission that DocSpring would email would take your account over its daily email limit, so nothing was saved. Send it again after the `Retry-After` header's seconds (midnight UTC), or send the signing links yourself (`send_email: false`). `support_feedback_limit_reached` and `support_ticket_limit_reached` (429): the account has sent its 50 pieces of feedback or opened its 20 support tickets in 24 hours. Send it again after the `Retry-After` header's seconds. `support_help_limit_reached` (429): the caller has asked DocSpring's AI help its questions for 24 hours. The message says how to ask more.
20
20
  attr_accessor :code
21
21
 
22
22
  # A human-readable explanation, safe to show to developers.
@@ -58,6 +58,9 @@ module DocSpring
58
58
  # With `idempotency_key_in_use`, the email domain the first request with the key created.
59
59
  attr_accessor :email_domain_id
60
60
 
61
+ # With `polling_timeout`, the job that's still running. With `idempotency_key_in_use`, the job the first request with the key created.
62
+ attr_accessor :job_id
63
+
61
64
  class EnumAttributeValidator
62
65
  attr_reader :datatype
63
66
  attr_reader :allowable_values
@@ -96,7 +99,8 @@ module DocSpring
96
99
  :'custom_file_id' => :'custom_file_id',
97
100
  :'webhook_id' => :'webhook_id',
98
101
  :'email_action_id' => :'email_action_id',
99
- :'email_domain_id' => :'email_domain_id'
102
+ :'email_domain_id' => :'email_domain_id',
103
+ :'job_id' => :'job_id'
100
104
  }
101
105
  end
102
106
 
@@ -126,7 +130,8 @@ module DocSpring
126
130
  :'custom_file_id' => :'String',
127
131
  :'webhook_id' => :'String',
128
132
  :'email_action_id' => :'String',
129
- :'email_domain_id' => :'String'
133
+ :'email_domain_id' => :'String',
134
+ :'job_id' => :'String'
130
135
  }
131
136
  end
132
137
 
@@ -228,6 +233,10 @@ module DocSpring
228
233
  if attributes.key?(:'email_domain_id')
229
234
  self.email_domain_id = attributes[:'email_domain_id']
230
235
  end
236
+
237
+ if attributes.key?(:'job_id')
238
+ self.job_id = attributes[:'job_id']
239
+ end
231
240
  end
232
241
 
233
242
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -308,7 +317,8 @@ module DocSpring
308
317
  custom_file_id == o.custom_file_id &&
309
318
  webhook_id == o.webhook_id &&
310
319
  email_action_id == o.email_action_id &&
311
- email_domain_id == o.email_domain_id
320
+ email_domain_id == o.email_domain_id &&
321
+ job_id == o.job_id
312
322
  end
313
323
 
314
324
  # @see the `==` method
@@ -320,7 +330,7 @@ module DocSpring
320
330
  # Calculates hash code according to all attributes.
321
331
  # @return [Integer] Hash code
322
332
  def hash
323
- [code, message, details, request_id, submission_id, submission_batch_id, combined_pdf_id, support_help_id, template_id, folder_id, custom_file_id, webhook_id, email_action_id, email_domain_id].hash
333
+ [code, message, details, request_id, submission_id, submission_batch_id, combined_pdf_id, support_help_id, template_id, folder_id, custom_file_id, webhook_id, email_action_id, email_domain_id, job_id].hash
324
334
  end
325
335
 
326
336
  # Builds the object from hash
@@ -0,0 +1,234 @@
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 pages to put in the new one.
18
+ class ExtractPagesRequest < 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 pages, in the order they go in the new PDF, such as `1-3,5` or `z-1` (every page backwards, `z` is the last page). A page can be listed twice. Pages left out are removed.
29
+ attr_accessor :pages
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'input' => :'input',
35
+ :'metadata' => :'metadata',
36
+ :'expires_in' => :'expires_in',
37
+ :'pages' => :'pages'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'input' => :'JobSourceInput',
55
+ :'metadata' => :'Hash<String, Object>',
56
+ :'expires_in' => :'Integer',
57
+ :'pages' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Returns attribute type mapping
68
+ def self.acceptable_openapi_types
69
+ openapi_types
70
+ end
71
+
72
+ # Returns the nullable attributes
73
+ def self.acceptable_openapi_nullable
74
+ openapi_nullable
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::ExtractPagesRequest` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::ExtractPagesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'input')
94
+ self.input = attributes[:'input']
95
+ else
96
+ self.input = nil
97
+ end
98
+
99
+ if attributes.key?(:'metadata')
100
+ if (value = attributes[:'metadata']).is_a?(Hash)
101
+ self.metadata = value
102
+ end
103
+ end
104
+
105
+ if attributes.key?(:'expires_in')
106
+ self.expires_in = attributes[:'expires_in']
107
+ end
108
+
109
+ if attributes.key?(:'pages')
110
+ self.pages = attributes[:'pages']
111
+ else
112
+ self.pages = nil
113
+ end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
120
+ invalid_properties = Array.new
121
+ if @input.nil?
122
+ invalid_properties.push('invalid value for "input", input cannot be nil.')
123
+ end
124
+
125
+ if @pages.nil?
126
+ invalid_properties.push('invalid value for "pages", pages cannot be nil.')
127
+ end
128
+
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
+ return false if @input.nil?
137
+ return false if @pages.nil?
138
+ true
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] input Value to be assigned
143
+ def input=(input)
144
+ if input.nil?
145
+ fail ArgumentError, 'input cannot be nil'
146
+ end
147
+
148
+ @input = input
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] pages Value to be assigned
153
+ def pages=(pages)
154
+ if pages.nil?
155
+ fail ArgumentError, 'pages cannot be nil'
156
+ end
157
+
158
+ @pages = pages
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ input == o.input &&
167
+ metadata == o.metadata &&
168
+ expires_in == o.expires_in &&
169
+ pages == o.pages
170
+ end
171
+
172
+ # @see the `==` method
173
+ # @param [Object] Object to be compared
174
+ def eql?(o)
175
+ self == o
176
+ end
177
+
178
+ # Calculates hash code according to all attributes.
179
+ # @return [Integer] Hash code
180
+ def hash
181
+ [input, metadata, expires_in, pages].hash
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def self.build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ attributes = attributes.transform_keys(&:to_sym)
190
+ # include attributes inherited from allOf parents (the nearest declaration wins)
191
+ map = acceptable_attribute_map
192
+ transformed_hash = {}
193
+ acceptable_openapi_types.each_pair do |key, type|
194
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
195
+ transformed_hash["#{key}"] = nil
196
+ elsif type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[map[key]].is_a?(Array)
200
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
201
+ end
202
+ elsif !attributes[map[key]].nil?
203
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
204
+ end
205
+ end
206
+ # Responses can include enum values added after this client was released, so the enum setters
207
+ # accept any value while the model is built from a response
208
+ allocate.tap do |model|
209
+ model.instance_variable_set(:@_skip_enum_validation, true)
210
+ model.send(:initialize, transformed_hash)
211
+ model.remove_instance_variable(:@_skip_enum_validation)
212
+ end
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ # include attributes inherited from allOf parents (the nearest declaration wins)
220
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -22,7 +22,7 @@ module DocSpring
22
22
  # The field's name, the key of its value in submission data. A `/` nests the key in objects and arrays (`client/address`, `items/0/price`); write a literal `/` as `~1` and `~` as `~0`. Fields with the same name share one value and their shared settings, and array indexes inside a name are ignored for settings, so `items/0/price` and `items/1/price` share settings but not values. A `#` and a line number (`notes#0`, `notes#1`) splits one value over several fields as lines of text, and names that start with `@@` print submission details such as `@@date`.
23
23
  attr_accessor :name
24
24
 
25
- # The number of the page the field is on, starting at 1. A field added without one goes on page 1, and a field moved to another page without a new `y` keeps its place on the page.
25
+ # The number of the page the field is on, starting at 1. A field added without one goes on page 1, and a field moved to another page without a new `y` keeps its place on the page. Pages are counted as generated PDFs have them: with a `page_list` on the template, page 1 is the page `page_list.pages[0]` names, and the fields on deleted pages aren't listed.
26
26
  attr_accessor :page
27
27
 
28
28
  # The name of the PDF form field this field was made from, when the template's PDF had fillable fields. Null for fields added in DocSpring.
@@ -19,7 +19,7 @@ module DocSpring
19
19
  # The field's name, the key of its value in submission data. A `/` nests the key in objects and arrays (`client/address`, `items/0/price`); write a literal `/` as `~1` and `~` as `~0`. Fields with the same name share one value and their shared settings, and array indexes inside a name are ignored for settings, so `items/0/price` and `items/1/price` share settings but not values. A `#` and a line number (`notes#0`, `notes#1`) splits one value over several fields as lines of text, and names that start with `@@` print submission details such as `@@date`.
20
20
  attr_accessor :name
21
21
 
22
- # The number of the page the field is on, starting at 1. A field added without one goes on page 1, and a field moved to another page without a new `y` keeps its place on the page.
22
+ # The number of the page the field is on, starting at 1. A field added without one goes on page 1, and a field moved to another page without a new `y` keeps its place on the page. Pages are counted as generated PDFs have them: with a `page_list` on the template, page 1 is the page `page_list.pages[0]` names, and the fields on deleted pages aren't listed.
23
23
  attr_accessor :page
24
24
 
25
25
  # The data type of the field's value: `string`, `number`, `boolean`, `date`, `address`, `country`, `email`, `url`, `image`, `signature`, `initials`, `barcode`, or `combined` (made from other fields' values, never sent in submission data). It sets how the value is validated and which `display_type`s the field can use. `object` and `array` are the types of field groups (the template's `field_groups`), not of fields. Shared by every field with the same `name`.
@@ -0,0 +1,207 @@
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 whose form fields and annotations become part of its pages, so they can't be changed.
18
+ class FlattenPdfRequest < 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
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'input' => :'input',
32
+ :'metadata' => :'metadata',
33
+ :'expires_in' => :'expires_in'
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
+ :'input' => :'JobSourceInput',
51
+ :'metadata' => :'Hash<String, Object>',
52
+ :'expires_in' => :'Integer'
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::FlattenPdfRequest` 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::FlattenPdfRequest`. 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?(:'input')
89
+ self.input = attributes[:'input']
90
+ else
91
+ self.input = nil
92
+ end
93
+
94
+ if attributes.key?(:'metadata')
95
+ if (value = attributes[:'metadata']).is_a?(Hash)
96
+ self.metadata = value
97
+ end
98
+ end
99
+
100
+ if attributes.key?(:'expires_in')
101
+ self.expires_in = attributes[:'expires_in']
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 @input.nil?
111
+ invalid_properties.push('invalid value for "input", input cannot be nil.')
112
+ end
113
+
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ warn '[DEPRECATED] the `valid?` method is obsolete'
121
+ return false if @input.nil?
122
+ true
123
+ end
124
+
125
+ # Custom attribute writer method with validation
126
+ # @param [Object] input Value to be assigned
127
+ def input=(input)
128
+ if input.nil?
129
+ fail ArgumentError, 'input cannot be nil'
130
+ end
131
+
132
+ @input = input
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ input == o.input &&
141
+ metadata == o.metadata &&
142
+ expires_in == o.expires_in
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Integer] Hash code
153
+ def hash
154
+ [input, metadata, expires_in].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def self.build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+ attributes = attributes.transform_keys(&:to_sym)
163
+ # include attributes inherited from allOf parents (the nearest declaration wins)
164
+ map = acceptable_attribute_map
165
+ transformed_hash = {}
166
+ acceptable_openapi_types.each_pair do |key, type|
167
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
168
+ transformed_hash["#{key}"] = nil
169
+ elsif type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[map[key]].is_a?(Array)
173
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
174
+ end
175
+ elsif !attributes[map[key]].nil?
176
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
177
+ end
178
+ end
179
+ # Responses can include enum values added after this client was released, so the enum setters
180
+ # accept any value while the model is built from a response
181
+ allocate.tap do |model|
182
+ model.instance_variable_set(:@_skip_enum_validation, true)
183
+ model.send(:initialize, transformed_hash)
184
+ model.remove_instance_variable(:@_skip_enum_validation)
185
+ end
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ # include attributes inherited from allOf parents (the nearest declaration wins)
193
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ if value.nil?
196
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
197
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
+ end
199
+
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ end
206
+
207
+ end
@@ -31,7 +31,7 @@ module DocSpring
31
31
  # Print pages in landscape orientation.
32
32
  attr_accessor :landscape
33
33
 
34
- # Print background colors and images.
34
+ # Print the background the template's CSS gives the whole page (on `html` or `body`), inside the page margins. Other elements' backgrounds always print.
35
35
  attr_accessor :print_background
36
36
 
37
37
  # The top margin, with a unit, such as `1in` or `20mm`. The top and bottom margins together must be less than the page's height.
@@ -31,7 +31,7 @@ module DocSpring
31
31
  # Print pages in landscape orientation.
32
32
  attr_accessor :landscape
33
33
 
34
- # Print background colors and images.
34
+ # Print the background the template's CSS gives the whole page (on `html` or `body`), inside the page margins. Other elements' backgrounds always print.
35
35
  attr_accessor :print_background
36
36
 
37
37
  # The top margin, with a unit, such as `1in` or `20mm`. The top and bottom margins together must be less than the page's height.