docspring 4.6.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 (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +25 -1
  4. data/lib/docspring/api/client.rb +1934 -209
  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 +217 -0
  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_code.rb +4 -1
  16. data/lib/docspring/models/error_info.rb +25 -5
  17. data/lib/docspring/models/extract_pages_request.rb +234 -0
  18. data/lib/docspring/models/field.rb +1 -1
  19. data/lib/docspring/models/field_input.rb +1 -1
  20. data/lib/docspring/models/flatten_pdf_request.rb +207 -0
  21. data/lib/docspring/models/html_engine_options.rb +1 -1
  22. data/lib/docspring/models/html_engine_options_input.rb +1 -1
  23. data/lib/docspring/models/htmlto_pdf_request.rb +322 -0
  24. data/lib/docspring/models/image_format.rb +41 -0
  25. data/lib/docspring/models/images_to_pdf_request.rb +241 -0
  26. data/lib/docspring/models/job.rb +508 -0
  27. data/lib/docspring/models/job_file.rb +308 -0
  28. data/lib/docspring/models/job_file_job_source.rb +232 -0
  29. data/lib/docspring/models/job_html_engine.rb +41 -0
  30. data/lib/docspring/models/job_list.rb +200 -0
  31. data/lib/docspring/models/job_operation.rb +53 -0
  32. data/lib/docspring/models/job_operation_filter.rb +53 -0
  33. data/lib/docspring/models/job_options.rb +392 -0
  34. data/lib/docspring/models/job_page_margin.rb +198 -0
  35. data/lib/docspring/models/job_page_size.rb +51 -0
  36. data/lib/docspring/models/job_source.rb +267 -0
  37. data/lib/docspring/models/job_source_input.rb +66 -0
  38. data/lib/docspring/models/job_source_type.rb +46 -0
  39. data/lib/docspring/models/job_state.rb +42 -0
  40. data/lib/docspring/models/markdown_to_pdf_request.rb +312 -0
  41. data/lib/docspring/models/open_support_ticket_request.rb +363 -0
  42. data/lib/docspring/models/page_image.rb +3 -3
  43. data/lib/docspring/models/page_number_position.rb +45 -0
  44. data/lib/docspring/models/page_size.rb +45 -0
  45. data/lib/docspring/models/pdf_permissions.rb +198 -0
  46. data/lib/docspring/models/pdf_permissions_input.rb +198 -0
  47. data/lib/docspring/models/pdfto_images_request.rb +269 -0
  48. data/lib/docspring/models/pdfto_text_request.rb +217 -0
  49. data/lib/docspring/models/reply_to_support_ticket_request.rb +217 -0
  50. data/lib/docspring/models/rotate_pages_request.rb +244 -0
  51. data/lib/docspring/models/send_support_feedback_request.rb +363 -0
  52. data/lib/docspring/models/split_pdf_request.rb +229 -0
  53. data/lib/docspring/models/submission_job_source.rb +222 -0
  54. data/lib/docspring/models/support_feedback.rb +239 -0
  55. data/lib/docspring/models/support_help.rb +316 -0
  56. data/lib/docspring/models/support_help_source.rb +212 -0
  57. data/lib/docspring/models/support_help_state.rb +42 -0
  58. data/lib/docspring/models/support_help_turn.rb +234 -0
  59. data/lib/docspring/models/support_help_turn_role.rb +41 -0
  60. data/lib/docspring/models/support_message.rb +301 -0
  61. data/lib/docspring/models/support_message_author.rb +42 -0
  62. data/lib/docspring/models/support_report_agent.rb +188 -0
  63. data/lib/docspring/models/support_report_category.rb +57 -0
  64. data/lib/docspring/models/support_report_impact.rb +42 -0
  65. data/lib/docspring/models/support_report_kind.rb +47 -0
  66. data/lib/docspring/models/support_report_source.rb +41 -0
  67. data/lib/docspring/models/support_ticket.rb +637 -0
  68. data/lib/docspring/models/support_ticket_list.rb +200 -0
  69. data/lib/docspring/models/support_ticket_list_status.rb +42 -0
  70. data/lib/docspring/models/support_ticket_notifications.rb +197 -0
  71. data/lib/docspring/models/support_ticket_reply.rb +210 -0
  72. data/lib/docspring/models/support_ticket_reply_outcome.rb +41 -0
  73. data/lib/docspring/models/support_ticket_resolution.rb +45 -0
  74. data/lib/docspring/models/support_ticket_status.rb +43 -0
  75. data/lib/docspring/models/support_ticket_watch.rb +239 -0
  76. data/lib/docspring/models/template.rb +41 -2
  77. data/lib/docspring/models/template_blank_page.rb +212 -0
  78. data/lib/docspring/models/template_blank_page_input.rb +212 -0
  79. data/lib/docspring/models/template_document.rb +1 -1
  80. data/lib/docspring/models/template_html_engine.rb +41 -0
  81. data/lib/docspring/models/template_page_images.rb +3 -3
  82. data/lib/docspring/models/template_page_list.rb +243 -0
  83. data/lib/docspring/models/template_page_list_input.rb +243 -0
  84. data/lib/docspring/models/template_page_processing_status.rb +28 -1
  85. data/lib/docspring/models/update_template_request.rb +33 -2
  86. data/lib/docspring/models/upload_job_source.rb +222 -0
  87. data/lib/docspring/models/url_job_source.rb +222 -0
  88. data/lib/docspring/models/watermark_layer.rb +41 -0
  89. data/lib/docspring/models/watermark_pdf_request.rb +316 -0
  90. data/lib/docspring/models/webhook_event_type.rb +4 -1
  91. data/lib/docspring/request_schemas.json +2424 -46
  92. data/lib/docspring/version.rb +1 -1
  93. data/lib/docspring.rb +71 -0
  94. metadata +72 -1
@@ -0,0 +1,237 @@
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 passwords and permissions to encrypt it with (AES-256).
18
+ class EncryptPdfRequest < 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 password the PDF needs to open. Without it, the PDF opens without one and the permissions still apply.
29
+ attr_accessor :user_password
30
+
31
+ # The password that lifts the permissions. Without it, a random one that nobody knows.
32
+ attr_accessor :owner_password
33
+
34
+ # What someone who opens the PDF can do. Everything is allowed by default.
35
+ attr_accessor :permissions
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'input' => :'input',
41
+ :'metadata' => :'metadata',
42
+ :'expires_in' => :'expires_in',
43
+ :'user_password' => :'user_password',
44
+ :'owner_password' => :'owner_password',
45
+ :'permissions' => :'permissions'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'input' => :'JobSourceInput',
63
+ :'metadata' => :'Hash<String, Object>',
64
+ :'expires_in' => :'Integer',
65
+ :'user_password' => :'String',
66
+ :'owner_password' => :'String',
67
+ :'permissions' => :'PdfPermissionsInput'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Returns attribute type mapping
78
+ def self.acceptable_openapi_types
79
+ openapi_types
80
+ end
81
+
82
+ # Returns the nullable attributes
83
+ def self.acceptable_openapi_nullable
84
+ openapi_nullable
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::EncryptPdfRequest` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ acceptable_attribute_map = self.class.acceptable_attribute_map
96
+ attributes = attributes.each_with_object({}) { |(k, v), h|
97
+ if (!acceptable_attribute_map.key?(k.to_sym))
98
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::EncryptPdfRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
99
+ end
100
+ h[k.to_sym] = v
101
+ }
102
+
103
+ if attributes.key?(:'input')
104
+ self.input = attributes[:'input']
105
+ else
106
+ self.input = nil
107
+ end
108
+
109
+ if attributes.key?(:'metadata')
110
+ if (value = attributes[:'metadata']).is_a?(Hash)
111
+ self.metadata = value
112
+ end
113
+ end
114
+
115
+ if attributes.key?(:'expires_in')
116
+ self.expires_in = attributes[:'expires_in']
117
+ end
118
+
119
+ if attributes.key?(:'user_password')
120
+ self.user_password = attributes[:'user_password']
121
+ end
122
+
123
+ if attributes.key?(:'owner_password')
124
+ self.owner_password = attributes[:'owner_password']
125
+ end
126
+
127
+ if attributes.key?(:'permissions')
128
+ self.permissions = attributes[:'permissions']
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
136
+ invalid_properties = Array.new
137
+ if @input.nil?
138
+ invalid_properties.push('invalid value for "input", input cannot be nil.')
139
+ end
140
+
141
+ invalid_properties
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ warn '[DEPRECATED] the `valid?` method is obsolete'
148
+ return false if @input.nil?
149
+ true
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] input Value to be assigned
154
+ def input=(input)
155
+ if input.nil?
156
+ fail ArgumentError, 'input cannot be nil'
157
+ end
158
+
159
+ @input = input
160
+ end
161
+
162
+ # Checks equality by comparing each attribute.
163
+ # @param [Object] Object to be compared
164
+ def ==(o)
165
+ return true if self.equal?(o)
166
+ self.class == o.class &&
167
+ input == o.input &&
168
+ metadata == o.metadata &&
169
+ expires_in == o.expires_in &&
170
+ user_password == o.user_password &&
171
+ owner_password == o.owner_password &&
172
+ permissions == o.permissions
173
+ end
174
+
175
+ # @see the `==` method
176
+ # @param [Object] Object to be compared
177
+ def eql?(o)
178
+ self == o
179
+ end
180
+
181
+ # Calculates hash code according to all attributes.
182
+ # @return [Integer] Hash code
183
+ def hash
184
+ [input, metadata, expires_in, user_password, owner_password, permissions].hash
185
+ end
186
+
187
+ # Builds the object from hash
188
+ # @param [Hash] attributes Model attributes in the form of hash
189
+ # @return [Object] Returns the model itself
190
+ def self.build_from_hash(attributes)
191
+ return nil unless attributes.is_a?(Hash)
192
+ attributes = attributes.transform_keys(&:to_sym)
193
+ # include attributes inherited from allOf parents (the nearest declaration wins)
194
+ map = acceptable_attribute_map
195
+ transformed_hash = {}
196
+ acceptable_openapi_types.each_pair do |key, type|
197
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
198
+ transformed_hash["#{key}"] = nil
199
+ elsif type =~ /\AArray<(.*)>/i
200
+ # check to ensure the input is an array given that the attribute
201
+ # is documented as an array but the input is not
202
+ if attributes[map[key]].is_a?(Array)
203
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
204
+ end
205
+ elsif !attributes[map[key]].nil?
206
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
207
+ end
208
+ end
209
+ # Responses can include enum values added after this client was released, so the enum setters
210
+ # accept any value while the model is built from a response
211
+ allocate.tap do |model|
212
+ model.instance_variable_set(:@_skip_enum_validation, true)
213
+ model.send(:initialize, transformed_hash)
214
+ model.remove_instance_variable(:@_skip_enum_validation)
215
+ end
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ # include attributes inherited from allOf parents (the nearest declaration wins)
223
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ end
236
+
237
+ end
@@ -33,6 +33,9 @@ module DocSpring
33
33
  INVALID_DATA = "invalid_data".freeze
34
34
  RATE_LIMITED = "rate_limited".freeze
35
35
  DAILY_EMAIL_LIMIT_REACHED = "daily_email_limit_reached".freeze
36
+ SUPPORT_FEEDBACK_LIMIT_REACHED = "support_feedback_limit_reached".freeze
37
+ SUPPORT_HELP_LIMIT_REACHED = "support_help_limit_reached".freeze
38
+ SUPPORT_TICKET_LIMIT_REACHED = "support_ticket_limit_reached".freeze
36
39
  INTERNAL_ERROR = "internal_error".freeze
37
40
  BAD_GATEWAY = "bad_gateway".freeze
38
41
  SERVICE_UNAVAILABLE = "service_unavailable".freeze
@@ -42,7 +45,7 @@ module DocSpring
42
45
  IDEMPOTENCY_KEY_REUSED = "idempotency_key_reused".freeze
43
46
 
44
47
  def self.all_vars
45
- @all_vars ||= [INVALID_REQUEST, UNAUTHORIZED, PAYMENT_REQUIRED, INSUFFICIENT_CREDITS, INSUFFICIENT_CREDITS_TO_SEND, FORBIDDEN, UPGRADE_REQUIRED, ACCOUNT_SUSPENDED, NOT_FOUND, METHOD_NOT_ALLOWED, CONFLICT, GONE, REQUEST_TOO_LARGE, UNSUPPORTED_MEDIA_TYPE, VALIDATION_FAILED, INVALID_DATA, RATE_LIMITED, DAILY_EMAIL_LIMIT_REACHED, INTERNAL_ERROR, BAD_GATEWAY, SERVICE_UNAVAILABLE, UPSTREAM_TIMEOUT, POLLING_TIMEOUT, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_KEY_REUSED].freeze
48
+ @all_vars ||= [INVALID_REQUEST, UNAUTHORIZED, PAYMENT_REQUIRED, INSUFFICIENT_CREDITS, INSUFFICIENT_CREDITS_TO_SEND, FORBIDDEN, UPGRADE_REQUIRED, ACCOUNT_SUSPENDED, NOT_FOUND, METHOD_NOT_ALLOWED, CONFLICT, GONE, REQUEST_TOO_LARGE, UNSUPPORTED_MEDIA_TYPE, VALIDATION_FAILED, INVALID_DATA, RATE_LIMITED, DAILY_EMAIL_LIMIT_REACHED, SUPPORT_FEEDBACK_LIMIT_REACHED, SUPPORT_HELP_LIMIT_REACHED, SUPPORT_TICKET_LIMIT_REACHED, INTERNAL_ERROR, BAD_GATEWAY, SERVICE_UNAVAILABLE, UPSTREAM_TIMEOUT, POLLING_TIMEOUT, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_KEY_REUSED].freeze
46
49
  end
47
50
 
48
51
  # Builds the enum from string
@@ -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`. 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`).
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.
@@ -37,6 +37,9 @@ module DocSpring
37
37
  # With `insufficient_credits`, the combined PDF that waits for credits. With `polling_timeout`, the combined PDF that's still being processed. With `idempotency_key_in_use`, the combined PDF the first request with the key created.
38
38
  attr_accessor :combined_pdf_id
39
39
 
40
+ # With `polling_timeout`, the help request that's still waiting for its answer.
41
+ attr_accessor :support_help_id
42
+
40
43
  # With `polling_timeout`, the template whose PDF is still being processed. With `idempotency_key_in_use`, the template the first request with the key created, or whose fields it changed or whose version it published.
41
44
  attr_accessor :template_id
42
45
 
@@ -55,6 +58,9 @@ module DocSpring
55
58
  # With `idempotency_key_in_use`, the email domain the first request with the key created.
56
59
  attr_accessor :email_domain_id
57
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
+
58
64
  class EnumAttributeValidator
59
65
  attr_reader :datatype
60
66
  attr_reader :allowable_values
@@ -87,12 +93,14 @@ module DocSpring
87
93
  :'submission_id' => :'submission_id',
88
94
  :'submission_batch_id' => :'submission_batch_id',
89
95
  :'combined_pdf_id' => :'combined_pdf_id',
96
+ :'support_help_id' => :'support_help_id',
90
97
  :'template_id' => :'template_id',
91
98
  :'folder_id' => :'folder_id',
92
99
  :'custom_file_id' => :'custom_file_id',
93
100
  :'webhook_id' => :'webhook_id',
94
101
  :'email_action_id' => :'email_action_id',
95
- :'email_domain_id' => :'email_domain_id'
102
+ :'email_domain_id' => :'email_domain_id',
103
+ :'job_id' => :'job_id'
96
104
  }
97
105
  end
98
106
 
@@ -116,12 +124,14 @@ module DocSpring
116
124
  :'submission_id' => :'String',
117
125
  :'submission_batch_id' => :'String',
118
126
  :'combined_pdf_id' => :'String',
127
+ :'support_help_id' => :'String',
119
128
  :'template_id' => :'String',
120
129
  :'folder_id' => :'String',
121
130
  :'custom_file_id' => :'String',
122
131
  :'webhook_id' => :'String',
123
132
  :'email_action_id' => :'String',
124
- :'email_domain_id' => :'String'
133
+ :'email_domain_id' => :'String',
134
+ :'job_id' => :'String'
125
135
  }
126
136
  end
127
137
 
@@ -196,6 +206,10 @@ module DocSpring
196
206
  self.combined_pdf_id = attributes[:'combined_pdf_id']
197
207
  end
198
208
 
209
+ if attributes.key?(:'support_help_id')
210
+ self.support_help_id = attributes[:'support_help_id']
211
+ end
212
+
199
213
  if attributes.key?(:'template_id')
200
214
  self.template_id = attributes[:'template_id']
201
215
  end
@@ -219,6 +233,10 @@ module DocSpring
219
233
  if attributes.key?(:'email_domain_id')
220
234
  self.email_domain_id = attributes[:'email_domain_id']
221
235
  end
236
+
237
+ if attributes.key?(:'job_id')
238
+ self.job_id = attributes[:'job_id']
239
+ end
222
240
  end
223
241
 
224
242
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -293,12 +311,14 @@ module DocSpring
293
311
  submission_id == o.submission_id &&
294
312
  submission_batch_id == o.submission_batch_id &&
295
313
  combined_pdf_id == o.combined_pdf_id &&
314
+ support_help_id == o.support_help_id &&
296
315
  template_id == o.template_id &&
297
316
  folder_id == o.folder_id &&
298
317
  custom_file_id == o.custom_file_id &&
299
318
  webhook_id == o.webhook_id &&
300
319
  email_action_id == o.email_action_id &&
301
- email_domain_id == o.email_domain_id
320
+ email_domain_id == o.email_domain_id &&
321
+ job_id == o.job_id
302
322
  end
303
323
 
304
324
  # @see the `==` method
@@ -310,7 +330,7 @@ module DocSpring
310
330
  # Calculates hash code according to all attributes.
311
331
  # @return [Integer] Hash code
312
332
  def hash
313
- [code, message, details, request_id, submission_id, submission_batch_id, combined_pdf_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
314
334
  end
315
335
 
316
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`.