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
@@ -66,6 +66,80 @@ module DocSpring
66
66
  end
67
67
  end
68
68
 
69
+ # Add page numbers
70
+ # Numbers the pages with a label such as "Page 2 of 9", where you choose. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
71
+ # @param body [AddPageNumbersRequest] The PDF, and where to put the page numbers.
72
+ # @param [Hash] opts the optional parameters
73
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
74
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
75
+ # @return [Job]
76
+ def add_page_numbers(body, opts = {})
77
+ data, _status_code, _headers = add_page_numbers_with_http_info(body, opts)
78
+ data
79
+ end
80
+
81
+ # Add page numbers
82
+ # Numbers the pages with a label such as "Page 2 of 9", where you choose. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
83
+ # @param body [AddPageNumbersRequest] The PDF, and where to put the page numbers.
84
+ # @param [Hash] opts the optional parameters
85
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
86
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
87
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
88
+ def add_page_numbers_with_http_info(body, opts = {})
89
+ if @api_client.config.debugging
90
+ @api_client.config.logger.debug 'Calling API: Client.add_page_numbers ...'
91
+ end
92
+ # verify the required parameter 'body' is set
93
+ if @api_client.config.client_side_validation && body.nil?
94
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.add_page_numbers"
95
+ end
96
+ # resource path
97
+ local_var_path = '/jobs/add_page_numbers'
98
+
99
+ # query parameters
100
+ query_params = opts[:query_params] || {}
101
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
102
+
103
+ # header parameters
104
+ header_params = opts[:header_params] || {}
105
+ # HTTP header 'Accept' (if needed)
106
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
107
+ # HTTP header 'Content-Type'
108
+ content_type = @api_client.select_header_content_type(['application/json'])
109
+ if !content_type.nil?
110
+ header_params['Content-Type'] = content_type
111
+ end
112
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
113
+
114
+ # form parameters
115
+ form_params = opts[:form_params] || {}
116
+
117
+ # http body (model)
118
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
119
+
120
+ # return_type
121
+ return_type = opts[:debug_return_type] || 'Job'
122
+
123
+ # auth_names
124
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
125
+
126
+ new_options = opts.merge(
127
+ :operation => :"Client.add_page_numbers",
128
+ :header_params => header_params,
129
+ :query_params => query_params,
130
+ :form_params => form_params,
131
+ :body => post_body,
132
+ :auth_names => auth_names,
133
+ :return_type => return_type
134
+ )
135
+
136
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
137
+ if @api_client.config.debugging
138
+ @api_client.config.logger.debug "API called: Client#add_page_numbers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
139
+ end
140
+ return data, status_code, headers
141
+ end
142
+
69
143
  # Add fields to a template
70
144
  # Adds fields to a template's draft and returns all of its fields. Publish a version for submissions of published versions to have them. A field with the name of one of the template's fields shares its settings (`type`, `required`, `default`, ...), so a field that sets one to another value is refused: PUT /templates/{template_id}/fields changes them for every field with the name.
71
145
  # @param template_id [String] The template's ID.
@@ -144,7 +218,7 @@ end
144
218
  end
145
219
 
146
220
  # Ask for help
147
- # Asks DocSpring's AI help a question, and answers it at once from DocSpring's documentation: how to do something, what an error means, whether something is supported. An AI agent calls this first when a request fails or it isn't sure how to do what its user asked. It opens no ticket and reaches no person, so there's nothing to ask the user first. The answer comes from the documentation and nothing else: it knows nothing about your account, templates or documents. When it doesn't solve the problem, send feedback or open a support ticket (`next`). It needs no credentials. With them, the question counts against your account's daily limit, which is higher than an anonymous caller's, and higher again for accounts on a paid plan. On a sync.api host the response waits for the answer; on other hosts it's the pending help request, to get until its `state` isn't `pending`.
221
+ # Asks DocSpring's AI help a question: how to do something, what an error means, whether something is supported. An AI agent calls this first when a request fails or it isn't sure how to do what its user asked. It opens no ticket and reaches no person, so there's nothing to ask the user first. It answers from what DocSpring has published: the documentation, this API reference, the changelog, the agent skills, and support notes on known limitations and what's planned. It knows nothing about your account, templates or documents. When it doesn't solve the problem, send feedback or open a support ticket (`next`). For a follow-up, send the questions and answers so far as `conversation`. Tokens and keys it recognises, and the values of a submission's `data` object, are removed from the question before it's stored or answered. It needs no credentials. With them, the question counts against your account's daily limit, which is higher than an anonymous caller's, and higher again for accounts on a paid plan. On a sync.api host the response waits for the answer; on other hosts it's the pending help request, to get until its `state` isn't `pending`.
148
222
  # @param body [AskSupportHelpRequest] A question about DocSpring. Never include secrets, credentials or your users' data.
149
223
  # @param [Hash] opts the optional parameters
150
224
  # @option opts [Boolean] :wait On a sync.api host, whether to wait for the answer (the default). With `false`, and on other hosts, the response is the pending help request: get it until its `state` isn't `pending`.
@@ -156,7 +230,7 @@ end
156
230
  end
157
231
 
158
232
  # Ask for help
159
- # Asks DocSpring's AI help a question, and answers it at once from DocSpring's documentation: how to do something, what an error means, whether something is supported. An AI agent calls this first when a request fails or it isn't sure how to do what its user asked. It opens no ticket and reaches no person, so there's nothing to ask the user first. The answer comes from the documentation and nothing else: it knows nothing about your account, templates or documents. When it doesn't solve the problem, send feedback or open a support ticket (`next`). It needs no credentials. With them, the question counts against your account's daily limit, which is higher than an anonymous caller's, and higher again for accounts on a paid plan. On a sync.api host the response waits for the answer; on other hosts it's the pending help request, to get until its `state` isn't `pending`.
233
+ # Asks DocSpring's AI help a question: how to do something, what an error means, whether something is supported. An AI agent calls this first when a request fails or it isn't sure how to do what its user asked. It opens no ticket and reaches no person, so there's nothing to ask the user first. It answers from what DocSpring has published: the documentation, this API reference, the changelog, the agent skills, and support notes on known limitations and what's planned. It knows nothing about your account, templates or documents. When it doesn't solve the problem, send feedback or open a support ticket (`next`). For a follow-up, send the questions and answers so far as `conversation`. Tokens and keys it recognises, and the values of a submission's `data` object, are removed from the question before it's stored or answered. It needs no credentials. With them, the question counts against your account's daily limit, which is higher than an anonymous caller's, and higher again for accounts on a paid plan. On a sync.api host the response waits for the answer; on other hosts it's the pending help request, to get until its `state` isn't `pending`.
160
234
  # @param body [AskSupportHelpRequest] A question about DocSpring. Never include secrets, credentials or your users' data.
161
235
  # @param [Hash] opts the optional parameters
162
236
  # @option opts [Boolean] :wait On a sync.api host, whether to wait for the answer (the default). With `false`, and on other hosts, the response is the pending help request: get it until its `state` isn't `pending`.
@@ -217,6 +291,80 @@ end
217
291
  return data, status_code, headers
218
292
  end
219
293
 
294
+ # Compress a PDF
295
+ # Makes a PDF smaller without losing quality: streams are recompressed and objects packed, and images keep their quality. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
296
+ # @param body [CompressPdfRequest] The PDF to compress. Compression is lossless: streams are recompressed and objects packed, and images keep their quality. A PDF that can't be made smaller comes back as it was.
297
+ # @param [Hash] opts the optional parameters
298
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
299
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
300
+ # @return [Job]
301
+ def compress_pdf(body, opts = {})
302
+ data, _status_code, _headers = compress_pdf_with_http_info(body, opts)
303
+ data
304
+ end
305
+
306
+ # Compress a PDF
307
+ # Makes a PDF smaller without losing quality: streams are recompressed and objects packed, and images keep their quality. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
308
+ # @param body [CompressPdfRequest] The PDF to compress. Compression is lossless: streams are recompressed and objects packed, and images keep their quality. A PDF that can't be made smaller comes back as it was.
309
+ # @param [Hash] opts the optional parameters
310
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
311
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
312
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
313
+ def compress_pdf_with_http_info(body, opts = {})
314
+ if @api_client.config.debugging
315
+ @api_client.config.logger.debug 'Calling API: Client.compress_pdf ...'
316
+ end
317
+ # verify the required parameter 'body' is set
318
+ if @api_client.config.client_side_validation && body.nil?
319
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.compress_pdf"
320
+ end
321
+ # resource path
322
+ local_var_path = '/jobs/compress_pdf'
323
+
324
+ # query parameters
325
+ query_params = opts[:query_params] || {}
326
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
327
+
328
+ # header parameters
329
+ header_params = opts[:header_params] || {}
330
+ # HTTP header 'Accept' (if needed)
331
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
332
+ # HTTP header 'Content-Type'
333
+ content_type = @api_client.select_header_content_type(['application/json'])
334
+ if !content_type.nil?
335
+ header_params['Content-Type'] = content_type
336
+ end
337
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
338
+
339
+ # form parameters
340
+ form_params = opts[:form_params] || {}
341
+
342
+ # http body (model)
343
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
344
+
345
+ # return_type
346
+ return_type = opts[:debug_return_type] || 'Job'
347
+
348
+ # auth_names
349
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
350
+
351
+ new_options = opts.merge(
352
+ :operation => :"Client.compress_pdf",
353
+ :header_params => header_params,
354
+ :query_params => query_params,
355
+ :form_params => form_params,
356
+ :body => post_body,
357
+ :auth_names => auth_names,
358
+ :return_type => return_type
359
+ )
360
+
361
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
362
+ if @api_client.config.debugging
363
+ @api_client.config.logger.debug "API called: Client#compress_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
364
+ end
365
+ return data, status_code, headers
366
+ end
367
+
220
368
  # Copy a template
221
369
  # Copies a template (its draft, or a published version) into a new template.
222
370
  # @param template_id [String] The template's ID.
@@ -1257,6 +1405,80 @@ end
1257
1405
  return data, status_code, headers
1258
1406
  end
1259
1407
 
1408
+ # Decrypt a PDF
1409
+ # Removes the password and permissions from a PDF you have the password for. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
1410
+ # @param body [DecryptPdfRequest] The encrypted PDF and its password. A PDF that only limits printing or copying opens without one, and decrypting it removes the limits.
1411
+ # @param [Hash] opts the optional parameters
1412
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
1413
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
1414
+ # @return [Job]
1415
+ def decrypt_pdf(body, opts = {})
1416
+ data, _status_code, _headers = decrypt_pdf_with_http_info(body, opts)
1417
+ data
1418
+ end
1419
+
1420
+ # Decrypt a PDF
1421
+ # Removes the password and permissions from a PDF you have the password for. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
1422
+ # @param body [DecryptPdfRequest] The encrypted PDF and its password. A PDF that only limits printing or copying opens without one, and decrypting it removes the limits.
1423
+ # @param [Hash] opts the optional parameters
1424
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
1425
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
1426
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
1427
+ def decrypt_pdf_with_http_info(body, opts = {})
1428
+ if @api_client.config.debugging
1429
+ @api_client.config.logger.debug 'Calling API: Client.decrypt_pdf ...'
1430
+ end
1431
+ # verify the required parameter 'body' is set
1432
+ if @api_client.config.client_side_validation && body.nil?
1433
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.decrypt_pdf"
1434
+ end
1435
+ # resource path
1436
+ local_var_path = '/jobs/decrypt_pdf'
1437
+
1438
+ # query parameters
1439
+ query_params = opts[:query_params] || {}
1440
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
1441
+
1442
+ # header parameters
1443
+ header_params = opts[:header_params] || {}
1444
+ # HTTP header 'Accept' (if needed)
1445
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1446
+ # HTTP header 'Content-Type'
1447
+ content_type = @api_client.select_header_content_type(['application/json'])
1448
+ if !content_type.nil?
1449
+ header_params['Content-Type'] = content_type
1450
+ end
1451
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1452
+
1453
+ # form parameters
1454
+ form_params = opts[:form_params] || {}
1455
+
1456
+ # http body (model)
1457
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
1458
+
1459
+ # return_type
1460
+ return_type = opts[:debug_return_type] || 'Job'
1461
+
1462
+ # auth_names
1463
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
1464
+
1465
+ new_options = opts.merge(
1466
+ :operation => :"Client.decrypt_pdf",
1467
+ :header_params => header_params,
1468
+ :query_params => query_params,
1469
+ :form_params => form_params,
1470
+ :body => post_body,
1471
+ :auth_names => auth_names,
1472
+ :return_type => return_type
1473
+ )
1474
+
1475
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1476
+ if @api_client.config.debugging
1477
+ @api_client.config.logger.debug "API called: Client#decrypt_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1478
+ end
1479
+ return data, status_code, headers
1480
+ end
1481
+
1260
1482
  # Delete an account email action
1261
1483
  # Deletes one of your account's email actions, with every template's customization of it. Emails it has already queued for submissions aren't sent. Submissions keep the record of the emails it sent.
1262
1484
  # @param email_action_id [String] The account email action's ID.
@@ -1665,6 +1887,72 @@ end
1665
1887
  return data, status_code, headers
1666
1888
  end
1667
1889
 
1890
+ # Delete a job
1891
+ # Deletes a job's files now, instead of when it expires, and returns the expired job. A job that hasn't finished is cancelled: it fails with an `error_message` saying it was deleted, and isn't charged.
1892
+ # @param job_id [String] The job's ID.
1893
+ # @param [Hash] opts the optional parameters
1894
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
1895
+ # @return [Job]
1896
+ def delete_job(job_id, opts = {})
1897
+ data, _status_code, _headers = delete_job_with_http_info(job_id, opts)
1898
+ data
1899
+ end
1900
+
1901
+ # Delete a job
1902
+ # Deletes a job's files now, instead of when it expires, and returns the expired job. A job that hasn't finished is cancelled: it fails with an `error_message` saying it was deleted, and isn't charged.
1903
+ # @param job_id [String] The job's ID.
1904
+ # @param [Hash] opts the optional parameters
1905
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
1906
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
1907
+ def delete_job_with_http_info(job_id, opts = {})
1908
+ if @api_client.config.debugging
1909
+ @api_client.config.logger.debug 'Calling API: Client.delete_job ...'
1910
+ end
1911
+ # verify the required parameter 'job_id' is set
1912
+ if @api_client.config.client_side_validation && job_id.nil?
1913
+ fail ArgumentError, "Missing the required parameter 'job_id' when calling Client.delete_job"
1914
+ end
1915
+ # resource path
1916
+ local_var_path = '/jobs/{job_id}'.sub('{job_id}', CGI.escape(job_id.to_s))
1917
+
1918
+ # query parameters
1919
+ query_params = opts[:query_params] || {}
1920
+
1921
+ # header parameters
1922
+ header_params = opts[:header_params] || {}
1923
+ # HTTP header 'Accept' (if needed)
1924
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1925
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1926
+
1927
+ # form parameters
1928
+ form_params = opts[:form_params] || {}
1929
+
1930
+ # http body (model)
1931
+ post_body = opts[:debug_body]
1932
+
1933
+ # return_type
1934
+ return_type = opts[:debug_return_type] || 'Job'
1935
+
1936
+ # auth_names
1937
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
1938
+
1939
+ new_options = opts.merge(
1940
+ :operation => :"Client.delete_job",
1941
+ :header_params => header_params,
1942
+ :query_params => query_params,
1943
+ :form_params => form_params,
1944
+ :body => post_body,
1945
+ :auth_names => auth_names,
1946
+ :return_type => return_type
1947
+ )
1948
+
1949
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
1950
+ if @api_client.config.debugging
1951
+ @api_client.config.logger.debug "API called: Client#delete_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1952
+ end
1953
+ return data, status_code, headers
1954
+ end
1955
+
1668
1956
  # Delete a template
1669
1957
  # Deletes a template's draft and all of its published versions, or one published version (`version`). Returns the template as it was before it was deleted. A deleted template can be restored from Trash in the dashboard for a limited time; a single deleted version can't.
1670
1958
  # @param template_id [String] The template's ID.
@@ -1800,57 +2088,65 @@ end
1800
2088
  return data, status_code, headers
1801
2089
  end
1802
2090
 
1803
- # Expire a combined PDF
1804
- # Deletes a combined PDF's PDF and returns the expired combined PDF.
1805
- # @param combined_pdf_id [String] The combined PDF's ID.
2091
+ # Encrypt a PDF
2092
+ # Encrypts a PDF with AES-256: a password to open it, and limits on printing, copying and changes. Passwords are never shown in the job's `options`. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
2093
+ # @param body [EncryptPdfRequest] The PDF, and the passwords and permissions to encrypt it with (AES-256).
1806
2094
  # @param [Hash] opts the optional parameters
2095
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
1807
2096
  # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
1808
- # @return [CombinedPdf]
1809
- def expire_combined_pdf(combined_pdf_id, opts = {})
1810
- data, _status_code, _headers = expire_combined_pdf_with_http_info(combined_pdf_id, opts)
2097
+ # @return [Job]
2098
+ def encrypt_pdf(body, opts = {})
2099
+ data, _status_code, _headers = encrypt_pdf_with_http_info(body, opts)
1811
2100
  data
1812
2101
  end
1813
2102
 
1814
- # Expire a combined PDF
1815
- # Deletes a combined PDF's PDF and returns the expired combined PDF.
1816
- # @param combined_pdf_id [String] The combined PDF's ID.
2103
+ # Encrypt a PDF
2104
+ # Encrypts a PDF with AES-256: a password to open it, and limits on printing, copying and changes. Passwords are never shown in the job's `options`. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
2105
+ # @param body [EncryptPdfRequest] The PDF, and the passwords and permissions to encrypt it with (AES-256).
1817
2106
  # @param [Hash] opts the optional parameters
2107
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
1818
2108
  # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
1819
- # @return [Array<(CombinedPdf, Integer, Hash)>] CombinedPdf data, response status code and response headers
1820
- def expire_combined_pdf_with_http_info(combined_pdf_id, opts = {})
2109
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
2110
+ def encrypt_pdf_with_http_info(body, opts = {})
1821
2111
  if @api_client.config.debugging
1822
- @api_client.config.logger.debug 'Calling API: Client.expire_combined_pdf ...'
2112
+ @api_client.config.logger.debug 'Calling API: Client.encrypt_pdf ...'
1823
2113
  end
1824
- # verify the required parameter 'combined_pdf_id' is set
1825
- if @api_client.config.client_side_validation && combined_pdf_id.nil?
1826
- fail ArgumentError, "Missing the required parameter 'combined_pdf_id' when calling Client.expire_combined_pdf"
2114
+ # verify the required parameter 'body' is set
2115
+ if @api_client.config.client_side_validation && body.nil?
2116
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.encrypt_pdf"
1827
2117
  end
1828
2118
  # resource path
1829
- local_var_path = '/combined_pdfs/{combined_pdf_id}'.sub('{combined_pdf_id}', CGI.escape(combined_pdf_id.to_s))
2119
+ local_var_path = '/jobs/encrypt_pdf'
1830
2120
 
1831
2121
  # query parameters
1832
2122
  query_params = opts[:query_params] || {}
2123
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
1833
2124
 
1834
2125
  # header parameters
1835
2126
  header_params = opts[:header_params] || {}
1836
2127
  # HTTP header 'Accept' (if needed)
1837
2128
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2129
+ # HTTP header 'Content-Type'
2130
+ content_type = @api_client.select_header_content_type(['application/json'])
2131
+ if !content_type.nil?
2132
+ header_params['Content-Type'] = content_type
2133
+ end
1838
2134
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1839
2135
 
1840
2136
  # form parameters
1841
2137
  form_params = opts[:form_params] || {}
1842
2138
 
1843
2139
  # http body (model)
1844
- post_body = opts[:debug_body]
2140
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
1845
2141
 
1846
2142
  # return_type
1847
- return_type = opts[:debug_return_type] || 'CombinedPdf'
2143
+ return_type = opts[:debug_return_type] || 'Job'
1848
2144
 
1849
2145
  # auth_names
1850
2146
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
1851
2147
 
1852
2148
  new_options = opts.merge(
1853
- :operation => :"Client.expire_combined_pdf",
2149
+ :operation => :"Client.encrypt_pdf",
1854
2150
  :header_params => header_params,
1855
2151
  :query_params => query_params,
1856
2152
  :form_params => form_params,
@@ -1859,25 +2155,91 @@ end
1859
2155
  :return_type => return_type
1860
2156
  )
1861
2157
 
1862
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
2158
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1863
2159
  if @api_client.config.debugging
1864
- @api_client.config.logger.debug "API called: Client#expire_combined_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2160
+ @api_client.config.logger.debug "API called: Client#encrypt_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1865
2161
  end
1866
2162
  return data, status_code, headers
1867
2163
  end
1868
2164
 
1869
- # Expire a submission
1870
- # Deletes a submission's data and files now, along with any signature requests and audit trail, and returns the expired submission.
1871
- # @param submission_id [String] The submission's ID.
2165
+ # Expire a combined PDF
2166
+ # Deletes a combined PDF's PDF and returns the expired combined PDF.
2167
+ # @param combined_pdf_id [String] The combined PDF's ID.
1872
2168
  # @param [Hash] opts the optional parameters
1873
2169
  # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
1874
- # @return [Submission]
1875
- def expire_submission(submission_id, opts = {})
1876
- data, _status_code, _headers = expire_submission_with_http_info(submission_id, opts)
2170
+ # @return [CombinedPdf]
2171
+ def expire_combined_pdf(combined_pdf_id, opts = {})
2172
+ data, _status_code, _headers = expire_combined_pdf_with_http_info(combined_pdf_id, opts)
1877
2173
  data
1878
2174
  end
1879
2175
 
1880
- # Expire a submission
2176
+ # Expire a combined PDF
2177
+ # Deletes a combined PDF's PDF and returns the expired combined PDF.
2178
+ # @param combined_pdf_id [String] The combined PDF's ID.
2179
+ # @param [Hash] opts the optional parameters
2180
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
2181
+ # @return [Array<(CombinedPdf, Integer, Hash)>] CombinedPdf data, response status code and response headers
2182
+ def expire_combined_pdf_with_http_info(combined_pdf_id, opts = {})
2183
+ if @api_client.config.debugging
2184
+ @api_client.config.logger.debug 'Calling API: Client.expire_combined_pdf ...'
2185
+ end
2186
+ # verify the required parameter 'combined_pdf_id' is set
2187
+ if @api_client.config.client_side_validation && combined_pdf_id.nil?
2188
+ fail ArgumentError, "Missing the required parameter 'combined_pdf_id' when calling Client.expire_combined_pdf"
2189
+ end
2190
+ # resource path
2191
+ local_var_path = '/combined_pdfs/{combined_pdf_id}'.sub('{combined_pdf_id}', CGI.escape(combined_pdf_id.to_s))
2192
+
2193
+ # query parameters
2194
+ query_params = opts[:query_params] || {}
2195
+
2196
+ # header parameters
2197
+ header_params = opts[:header_params] || {}
2198
+ # HTTP header 'Accept' (if needed)
2199
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2200
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
2201
+
2202
+ # form parameters
2203
+ form_params = opts[:form_params] || {}
2204
+
2205
+ # http body (model)
2206
+ post_body = opts[:debug_body]
2207
+
2208
+ # return_type
2209
+ return_type = opts[:debug_return_type] || 'CombinedPdf'
2210
+
2211
+ # auth_names
2212
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
2213
+
2214
+ new_options = opts.merge(
2215
+ :operation => :"Client.expire_combined_pdf",
2216
+ :header_params => header_params,
2217
+ :query_params => query_params,
2218
+ :form_params => form_params,
2219
+ :body => post_body,
2220
+ :auth_names => auth_names,
2221
+ :return_type => return_type
2222
+ )
2223
+
2224
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
2225
+ if @api_client.config.debugging
2226
+ @api_client.config.logger.debug "API called: Client#expire_combined_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2227
+ end
2228
+ return data, status_code, headers
2229
+ end
2230
+
2231
+ # Expire a submission
2232
+ # Deletes a submission's data and files now, along with any signature requests and audit trail, and returns the expired submission.
2233
+ # @param submission_id [String] The submission's ID.
2234
+ # @param [Hash] opts the optional parameters
2235
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
2236
+ # @return [Submission]
2237
+ def expire_submission(submission_id, opts = {})
2238
+ data, _status_code, _headers = expire_submission_with_http_info(submission_id, opts)
2239
+ data
2240
+ end
2241
+
2242
+ # Expire a submission
1881
2243
  # Deletes a submission's data and files now, along with any signature requests and audit trail, and returns the expired submission.
1882
2244
  # @param submission_id [String] The submission's ID.
1883
2245
  # @param [Hash] opts the optional parameters
@@ -1932,6 +2294,154 @@ end
1932
2294
  return data, status_code, headers
1933
2295
  end
1934
2296
 
2297
+ # Extract pages from a PDF
2298
+ # Makes a PDF of the pages you list, in that order. Use it to remove or reorder pages too. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
2299
+ # @param body [ExtractPagesRequest] The PDF, and the pages to put in the new one.
2300
+ # @param [Hash] opts the optional parameters
2301
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
2302
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
2303
+ # @return [Job]
2304
+ def extract_pages(body, opts = {})
2305
+ data, _status_code, _headers = extract_pages_with_http_info(body, opts)
2306
+ data
2307
+ end
2308
+
2309
+ # Extract pages from a PDF
2310
+ # Makes a PDF of the pages you list, in that order. Use it to remove or reorder pages too. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
2311
+ # @param body [ExtractPagesRequest] The PDF, and the pages to put in the new one.
2312
+ # @param [Hash] opts the optional parameters
2313
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
2314
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
2315
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
2316
+ def extract_pages_with_http_info(body, opts = {})
2317
+ if @api_client.config.debugging
2318
+ @api_client.config.logger.debug 'Calling API: Client.extract_pages ...'
2319
+ end
2320
+ # verify the required parameter 'body' is set
2321
+ if @api_client.config.client_side_validation && body.nil?
2322
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.extract_pages"
2323
+ end
2324
+ # resource path
2325
+ local_var_path = '/jobs/extract_pages'
2326
+
2327
+ # query parameters
2328
+ query_params = opts[:query_params] || {}
2329
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
2330
+
2331
+ # header parameters
2332
+ header_params = opts[:header_params] || {}
2333
+ # HTTP header 'Accept' (if needed)
2334
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2335
+ # HTTP header 'Content-Type'
2336
+ content_type = @api_client.select_header_content_type(['application/json'])
2337
+ if !content_type.nil?
2338
+ header_params['Content-Type'] = content_type
2339
+ end
2340
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
2341
+
2342
+ # form parameters
2343
+ form_params = opts[:form_params] || {}
2344
+
2345
+ # http body (model)
2346
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
2347
+
2348
+ # return_type
2349
+ return_type = opts[:debug_return_type] || 'Job'
2350
+
2351
+ # auth_names
2352
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
2353
+
2354
+ new_options = opts.merge(
2355
+ :operation => :"Client.extract_pages",
2356
+ :header_params => header_params,
2357
+ :query_params => query_params,
2358
+ :form_params => form_params,
2359
+ :body => post_body,
2360
+ :auth_names => auth_names,
2361
+ :return_type => return_type
2362
+ )
2363
+
2364
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2365
+ if @api_client.config.debugging
2366
+ @api_client.config.logger.debug "API called: Client#extract_pages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2367
+ end
2368
+ return data, status_code, headers
2369
+ end
2370
+
2371
+ # Flatten a PDF
2372
+ # Draws a PDF's form fields and annotations into its pages, so they can't be changed. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
2373
+ # @param body [FlattenPdfRequest] The PDF whose form fields and annotations become part of its pages, so they can't be changed.
2374
+ # @param [Hash] opts the optional parameters
2375
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
2376
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
2377
+ # @return [Job]
2378
+ def flatten_pdf(body, opts = {})
2379
+ data, _status_code, _headers = flatten_pdf_with_http_info(body, opts)
2380
+ data
2381
+ end
2382
+
2383
+ # Flatten a PDF
2384
+ # Draws a PDF's form fields and annotations into its pages, so they can't be changed. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
2385
+ # @param body [FlattenPdfRequest] The PDF whose form fields and annotations become part of its pages, so they can't be changed.
2386
+ # @param [Hash] opts the optional parameters
2387
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
2388
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
2389
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
2390
+ def flatten_pdf_with_http_info(body, opts = {})
2391
+ if @api_client.config.debugging
2392
+ @api_client.config.logger.debug 'Calling API: Client.flatten_pdf ...'
2393
+ end
2394
+ # verify the required parameter 'body' is set
2395
+ if @api_client.config.client_side_validation && body.nil?
2396
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.flatten_pdf"
2397
+ end
2398
+ # resource path
2399
+ local_var_path = '/jobs/flatten_pdf'
2400
+
2401
+ # query parameters
2402
+ query_params = opts[:query_params] || {}
2403
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
2404
+
2405
+ # header parameters
2406
+ header_params = opts[:header_params] || {}
2407
+ # HTTP header 'Accept' (if needed)
2408
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2409
+ # HTTP header 'Content-Type'
2410
+ content_type = @api_client.select_header_content_type(['application/json'])
2411
+ if !content_type.nil?
2412
+ header_params['Content-Type'] = content_type
2413
+ end
2414
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
2415
+
2416
+ # form parameters
2417
+ form_params = opts[:form_params] || {}
2418
+
2419
+ # http body (model)
2420
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
2421
+
2422
+ # return_type
2423
+ return_type = opts[:debug_return_type] || 'Job'
2424
+
2425
+ # auth_names
2426
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
2427
+
2428
+ new_options = opts.merge(
2429
+ :operation => :"Client.flatten_pdf",
2430
+ :header_params => header_params,
2431
+ :query_params => query_params,
2432
+ :form_params => form_params,
2433
+ :body => post_body,
2434
+ :auth_names => auth_names,
2435
+ :return_type => return_type
2436
+ )
2437
+
2438
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2439
+ if @api_client.config.debugging
2440
+ @api_client.config.logger.debug "API called: Client#flatten_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2441
+ end
2442
+ return data, status_code, headers
2443
+ end
2444
+
1935
2445
  # Generate more files
1936
2446
  # Adds formats to a processed submission's files, in the background, without using credits again: `pdf`, the PDF of a Word template's submission that made only its Word document (converted from that document), `docx`, the Word document of a Word template's submission that made only its PDF (made again from its data and the template version it used), `odt`, a Word template's submission's OpenDocument file (converted from its Word document, or from one made again when it didn't keep one), and `png`, a PNG image of each page of the PDF (up to 100 pages), which makes the PDF first when the submission doesn't have one. To make them with the submission, add them to `output_formats` when you create it. Each new file is listed in `files` while it's made: on sync.api hosts the request waits for them (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until none of their `state` is `pending`. A file that couldn't be made has the state `error` and an `error_message`, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
1937
2447
  # @param submission_id [String] The submission's ID.
@@ -2462,6 +2972,69 @@ end
2462
2972
  return data, status_code, headers
2463
2973
  end
2464
2974
 
2975
+ # Get a job
2976
+ # Returns a job, with temporary links to download the files it made once it has run.
2977
+ # @param job_id [String] The job's ID.
2978
+ # @param [Hash] opts the optional parameters
2979
+ # @return [Job]
2980
+ def get_job(job_id, opts = {})
2981
+ data, _status_code, _headers = get_job_with_http_info(job_id, opts)
2982
+ data
2983
+ end
2984
+
2985
+ # Get a job
2986
+ # Returns a job, with temporary links to download the files it made once it has run.
2987
+ # @param job_id [String] The job's ID.
2988
+ # @param [Hash] opts the optional parameters
2989
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
2990
+ def get_job_with_http_info(job_id, opts = {})
2991
+ if @api_client.config.debugging
2992
+ @api_client.config.logger.debug 'Calling API: Client.get_job ...'
2993
+ end
2994
+ # verify the required parameter 'job_id' is set
2995
+ if @api_client.config.client_side_validation && job_id.nil?
2996
+ fail ArgumentError, "Missing the required parameter 'job_id' when calling Client.get_job"
2997
+ end
2998
+ # resource path
2999
+ local_var_path = '/jobs/{job_id}'.sub('{job_id}', CGI.escape(job_id.to_s))
3000
+
3001
+ # query parameters
3002
+ query_params = opts[:query_params] || {}
3003
+
3004
+ # header parameters
3005
+ header_params = opts[:header_params] || {}
3006
+ # HTTP header 'Accept' (if needed)
3007
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3008
+
3009
+ # form parameters
3010
+ form_params = opts[:form_params] || {}
3011
+
3012
+ # http body (model)
3013
+ post_body = opts[:debug_body]
3014
+
3015
+ # return_type
3016
+ return_type = opts[:debug_return_type] || 'Job'
3017
+
3018
+ # auth_names
3019
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
3020
+
3021
+ new_options = opts.merge(
3022
+ :operation => :"Client.get_job",
3023
+ :header_params => header_params,
3024
+ :query_params => query_params,
3025
+ :form_params => form_params,
3026
+ :body => post_body,
3027
+ :auth_names => auth_names,
3028
+ :return_type => return_type
3029
+ )
3030
+
3031
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3032
+ if @api_client.config.debugging
3033
+ @api_client.config.logger.debug "API called: Client#get_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3034
+ end
3035
+ return data, status_code, headers
3036
+ end
3037
+
2465
3038
  # Get a presigned URL to upload a file
2466
3039
  # Returns a presigned S3 form for uploading a file directly to DocSpring, for files too large to send in a request body. POST the `fields` and the file (as `file`) to `url` as multipart/form-data, then pass `fields.key` as the `cache_id` when you create a custom file.
2467
3040
  # @param [Hash] opts the optional parameters
@@ -3049,7 +3622,7 @@ end
3049
3622
  end
3050
3623
 
3051
3624
  # Get images of a template's pages
3052
- # Returns a JPEG image of each page of a PDF template's PDF, with temporary links to download them: the draft's PDF, or a published version's. Use them to see the pages that fields are placed on.
3625
+ # Returns a JPEG image of each page of a PDF template, with temporary links to download them: the draft's pages, or a published version's. Use them to see the pages that fields are placed on. They're the pages the template's generated PDFs have, in their order (its `page_list`).
3053
3626
  # @param template_id [String] The template's ID.
3054
3627
  # @param [Hash] opts the optional parameters
3055
3628
  # @option opts [String] :version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` (the newest published version, or the draft when none has been published) or `draft`. Default `draft`.
@@ -3060,7 +3633,7 @@ end
3060
3633
  end
3061
3634
 
3062
3635
  # Get images of a template's pages
3063
- # Returns a JPEG image of each page of a PDF template's PDF, with temporary links to download them: the draft's PDF, or a published version's. Use them to see the pages that fields are placed on.
3636
+ # Returns a JPEG image of each page of a PDF template, with temporary links to download them: the draft's pages, or a published version's. Use them to see the pages that fields are placed on. They're the pages the template's generated PDFs have, in their order (its `page_list`).
3064
3637
  # @param template_id [String] The template's ID.
3065
3638
  # @param [Hash] opts the optional parameters
3066
3639
  # @option opts [String] :version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` (the newest published version, or the draft when none has been published) or `draft`. Default `draft`.
@@ -3312,54 +3885,65 @@ end
3312
3885
  return data, status_code, headers
3313
3886
  end
3314
3887
 
3315
- # List account email actions
3316
- # Returns your account's email actions, newest first, one page at a time. Each one emails the files of every template's processed submissions, or of the templates and folders it lists. A template's own email actions are listed with the template (`GET /templates/{template_id}/email_actions`).
3888
+ # Convert HTML to a PDF
3889
+ # Converts a page of HTML and CSS to PDF, with the page size, margins, header and footer you send. DocSpring's Standard engine converts it, which doesn't run JavaScript: a page with a script element fails. To fill a page in with data, make it an HTML template instead. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
3890
+ # @param body [HTMLToPdfRequest] A page of HTML to convert to PDF, as `html` or as a file in `input` (one of them), with the page's settings. The Standard engine converts it unless you ask for Chromium: it doesn't run JavaScript, so a page with a script element fails with a message that says to send `engine` `chromium`. Images, stylesheets and fonts the page links to are downloaded, and on the Standard engine a link that can't be downloaded fails the job with a message naming it.
3317
3891
  # @param [Hash] opts the optional parameters
3318
- # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
3319
- # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
3320
- # @return [EmailActionList]
3321
- def list_account_email_actions(opts = {})
3322
- data, _status_code, _headers = list_account_email_actions_with_http_info(opts)
3892
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
3893
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
3894
+ # @return [Job]
3895
+ def html_to_pdf(body, opts = {})
3896
+ data, _status_code, _headers = html_to_pdf_with_http_info(body, opts)
3323
3897
  data
3324
3898
  end
3325
3899
 
3326
- # List account email actions
3327
- # Returns your account's email actions, newest first, one page at a time. Each one emails the files of every template's processed submissions, or of the templates and folders it lists. A template's own email actions are listed with the template (`GET /templates/{template_id}/email_actions`).
3900
+ # Convert HTML to a PDF
3901
+ # Converts a page of HTML and CSS to PDF, with the page size, margins, header and footer you send. DocSpring's Standard engine converts it, which doesn't run JavaScript: a page with a script element fails. To fill a page in with data, make it an HTML template instead. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
3902
+ # @param body [HTMLToPdfRequest] A page of HTML to convert to PDF, as `html` or as a file in `input` (one of them), with the page's settings. The Standard engine converts it unless you ask for Chromium: it doesn't run JavaScript, so a page with a script element fails with a message that says to send `engine` `chromium`. Images, stylesheets and fonts the page links to are downloaded, and on the Standard engine a link that can't be downloaded fails the job with a message naming it.
3328
3903
  # @param [Hash] opts the optional parameters
3329
- # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
3330
- # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
3331
- # @return [Array<(EmailActionList, Integer, Hash)>] EmailActionList data, response status code and response headers
3332
- def list_account_email_actions_with_http_info(opts = {})
3904
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
3905
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
3906
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
3907
+ def html_to_pdf_with_http_info(body, opts = {})
3333
3908
  if @api_client.config.debugging
3334
- @api_client.config.logger.debug 'Calling API: Client.list_account_email_actions ...'
3909
+ @api_client.config.logger.debug 'Calling API: Client.html_to_pdf ...'
3910
+ end
3911
+ # verify the required parameter 'body' is set
3912
+ if @api_client.config.client_side_validation && body.nil?
3913
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.html_to_pdf"
3335
3914
  end
3336
3915
  # resource path
3337
- local_var_path = '/email_actions'
3916
+ local_var_path = '/jobs/html_to_pdf'
3338
3917
 
3339
3918
  # query parameters
3340
3919
  query_params = opts[:query_params] || {}
3341
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
3342
- query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
3920
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
3343
3921
 
3344
3922
  # header parameters
3345
3923
  header_params = opts[:header_params] || {}
3346
3924
  # HTTP header 'Accept' (if needed)
3347
3925
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3926
+ # HTTP header 'Content-Type'
3927
+ content_type = @api_client.select_header_content_type(['application/json'])
3928
+ if !content_type.nil?
3929
+ header_params['Content-Type'] = content_type
3930
+ end
3931
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
3348
3932
 
3349
3933
  # form parameters
3350
3934
  form_params = opts[:form_params] || {}
3351
3935
 
3352
3936
  # http body (model)
3353
- post_body = opts[:debug_body]
3937
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
3354
3938
 
3355
3939
  # return_type
3356
- return_type = opts[:debug_return_type] || 'EmailActionList'
3940
+ return_type = opts[:debug_return_type] || 'Job'
3357
3941
 
3358
3942
  # auth_names
3359
3943
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
3360
3944
 
3361
3945
  new_options = opts.merge(
3362
- :operation => :"Client.list_account_email_actions",
3946
+ :operation => :"Client.html_to_pdf",
3363
3947
  :header_params => header_params,
3364
3948
  :query_params => query_params,
3365
3949
  :form_params => form_params,
@@ -3368,7 +3952,144 @@ end
3368
3952
  :return_type => return_type
3369
3953
  )
3370
3954
 
3371
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3955
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
3956
+ if @api_client.config.debugging
3957
+ @api_client.config.logger.debug "API called: Client#html_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3958
+ end
3959
+ return data, status_code, headers
3960
+ end
3961
+
3962
+ # Convert images to a PDF
3963
+ # Makes a PDF with one PNG or JPEG image on each page, in order. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
3964
+ # @param body [ImagesToPdfRequest] The PNG and JPEG images, one per page, in order.
3965
+ # @param [Hash] opts the optional parameters
3966
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
3967
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
3968
+ # @return [Job]
3969
+ def images_to_pdf(body, opts = {})
3970
+ data, _status_code, _headers = images_to_pdf_with_http_info(body, opts)
3971
+ data
3972
+ end
3973
+
3974
+ # Convert images to a PDF
3975
+ # Makes a PDF with one PNG or JPEG image on each page, in order. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
3976
+ # @param body [ImagesToPdfRequest] The PNG and JPEG images, one per page, in order.
3977
+ # @param [Hash] opts the optional parameters
3978
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
3979
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
3980
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
3981
+ def images_to_pdf_with_http_info(body, opts = {})
3982
+ if @api_client.config.debugging
3983
+ @api_client.config.logger.debug 'Calling API: Client.images_to_pdf ...'
3984
+ end
3985
+ # verify the required parameter 'body' is set
3986
+ if @api_client.config.client_side_validation && body.nil?
3987
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.images_to_pdf"
3988
+ end
3989
+ # resource path
3990
+ local_var_path = '/jobs/images_to_pdf'
3991
+
3992
+ # query parameters
3993
+ query_params = opts[:query_params] || {}
3994
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
3995
+
3996
+ # header parameters
3997
+ header_params = opts[:header_params] || {}
3998
+ # HTTP header 'Accept' (if needed)
3999
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
4000
+ # HTTP header 'Content-Type'
4001
+ content_type = @api_client.select_header_content_type(['application/json'])
4002
+ if !content_type.nil?
4003
+ header_params['Content-Type'] = content_type
4004
+ end
4005
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
4006
+
4007
+ # form parameters
4008
+ form_params = opts[:form_params] || {}
4009
+
4010
+ # http body (model)
4011
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
4012
+
4013
+ # return_type
4014
+ return_type = opts[:debug_return_type] || 'Job'
4015
+
4016
+ # auth_names
4017
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
4018
+
4019
+ new_options = opts.merge(
4020
+ :operation => :"Client.images_to_pdf",
4021
+ :header_params => header_params,
4022
+ :query_params => query_params,
4023
+ :form_params => form_params,
4024
+ :body => post_body,
4025
+ :auth_names => auth_names,
4026
+ :return_type => return_type
4027
+ )
4028
+
4029
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
4030
+ if @api_client.config.debugging
4031
+ @api_client.config.logger.debug "API called: Client#images_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
4032
+ end
4033
+ return data, status_code, headers
4034
+ end
4035
+
4036
+ # List account email actions
4037
+ # Returns your account's email actions, newest first, one page at a time. Each one emails the files of every template's processed submissions, or of the templates and folders it lists. A template's own email actions are listed with the template (`GET /templates/{template_id}/email_actions`).
4038
+ # @param [Hash] opts the optional parameters
4039
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
4040
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
4041
+ # @return [EmailActionList]
4042
+ def list_account_email_actions(opts = {})
4043
+ data, _status_code, _headers = list_account_email_actions_with_http_info(opts)
4044
+ data
4045
+ end
4046
+
4047
+ # List account email actions
4048
+ # Returns your account's email actions, newest first, one page at a time. Each one emails the files of every template's processed submissions, or of the templates and folders it lists. A template's own email actions are listed with the template (`GET /templates/{template_id}/email_actions`).
4049
+ # @param [Hash] opts the optional parameters
4050
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
4051
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
4052
+ # @return [Array<(EmailActionList, Integer, Hash)>] EmailActionList data, response status code and response headers
4053
+ def list_account_email_actions_with_http_info(opts = {})
4054
+ if @api_client.config.debugging
4055
+ @api_client.config.logger.debug 'Calling API: Client.list_account_email_actions ...'
4056
+ end
4057
+ # resource path
4058
+ local_var_path = '/email_actions'
4059
+
4060
+ # query parameters
4061
+ query_params = opts[:query_params] || {}
4062
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
4063
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
4064
+
4065
+ # header parameters
4066
+ header_params = opts[:header_params] || {}
4067
+ # HTTP header 'Accept' (if needed)
4068
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
4069
+
4070
+ # form parameters
4071
+ form_params = opts[:form_params] || {}
4072
+
4073
+ # http body (model)
4074
+ post_body = opts[:debug_body]
4075
+
4076
+ # return_type
4077
+ return_type = opts[:debug_return_type] || 'EmailActionList'
4078
+
4079
+ # auth_names
4080
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
4081
+
4082
+ new_options = opts.merge(
4083
+ :operation => :"Client.list_account_email_actions",
4084
+ :header_params => header_params,
4085
+ :query_params => query_params,
4086
+ :form_params => form_params,
4087
+ :body => post_body,
4088
+ :auth_names => auth_names,
4089
+ :return_type => return_type
4090
+ )
4091
+
4092
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3372
4093
  if @api_client.config.debugging
3373
4094
  @api_client.config.logger.debug "API called: Client#list_account_email_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3374
4095
  end
@@ -3699,6 +4420,72 @@ end
3699
4420
  return data, status_code, headers
3700
4421
  end
3701
4422
 
4423
+ # List jobs
4424
+ # Returns the jobs in your account, newest first, one page at a time. Filter them by tool with `operation`.
4425
+ # @param [Hash] opts the optional parameters
4426
+ # @option opts [JobOperationFilter] :operation Only list jobs that ran this tool.
4427
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
4428
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
4429
+ # @return [JobList]
4430
+ def list_jobs(opts = {})
4431
+ data, _status_code, _headers = list_jobs_with_http_info(opts)
4432
+ data
4433
+ end
4434
+
4435
+ # List jobs
4436
+ # Returns the jobs in your account, newest first, one page at a time. Filter them by tool with `operation`.
4437
+ # @param [Hash] opts the optional parameters
4438
+ # @option opts [JobOperationFilter] :operation Only list jobs that ran this tool.
4439
+ # @option opts [Integer] :limit How many items to return (1-100, default 50). (default to 50)
4440
+ # @option opts [String] :cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
4441
+ # @return [Array<(JobList, Integer, Hash)>] JobList data, response status code and response headers
4442
+ def list_jobs_with_http_info(opts = {})
4443
+ if @api_client.config.debugging
4444
+ @api_client.config.logger.debug 'Calling API: Client.list_jobs ...'
4445
+ end
4446
+ # resource path
4447
+ local_var_path = '/jobs'
4448
+
4449
+ # query parameters
4450
+ query_params = opts[:query_params] || {}
4451
+ query_params[:'operation'] = opts[:'operation'] if !opts[:'operation'].nil?
4452
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
4453
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
4454
+
4455
+ # header parameters
4456
+ header_params = opts[:header_params] || {}
4457
+ # HTTP header 'Accept' (if needed)
4458
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
4459
+
4460
+ # form parameters
4461
+ form_params = opts[:form_params] || {}
4462
+
4463
+ # http body (model)
4464
+ post_body = opts[:debug_body]
4465
+
4466
+ # return_type
4467
+ return_type = opts[:debug_return_type] || 'JobList'
4468
+
4469
+ # auth_names
4470
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
4471
+
4472
+ new_options = opts.merge(
4473
+ :operation => :"Client.list_jobs",
4474
+ :header_params => header_params,
4475
+ :query_params => query_params,
4476
+ :form_params => form_params,
4477
+ :body => post_body,
4478
+ :auth_names => auth_names,
4479
+ :return_type => return_type
4480
+ )
4481
+
4482
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
4483
+ if @api_client.config.debugging
4484
+ @api_client.config.logger.debug "API called: Client#list_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
4485
+ end
4486
+ return data, status_code, headers
4487
+ end
4488
+
3702
4489
  # List submissions
3703
4490
  # Returns the submissions in your account, newest first, one page at a time. Each one is a summary: its `data` is null unless you pass `include_data=true`, and its `files` are empty unless you pass `include_files=true`. Get a submission by its ID for its signature requests, uploads and page images.
3704
4491
  # @param [Hash] opts the optional parameters
@@ -4130,16 +4917,244 @@ end
4130
4917
  form_params = opts[:form_params] || {}
4131
4918
 
4132
4919
  # http body (model)
4133
- post_body = opts[:debug_body]
4920
+ post_body = opts[:debug_body]
4921
+
4922
+ # return_type
4923
+ return_type = opts[:debug_return_type] || 'WebhookList'
4924
+
4925
+ # auth_names
4926
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
4927
+
4928
+ new_options = opts.merge(
4929
+ :operation => :"Client.list_webhooks",
4930
+ :header_params => header_params,
4931
+ :query_params => query_params,
4932
+ :form_params => form_params,
4933
+ :body => post_body,
4934
+ :auth_names => auth_names,
4935
+ :return_type => return_type
4936
+ )
4937
+
4938
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
4939
+ if @api_client.config.debugging
4940
+ @api_client.config.logger.debug "API called: Client#list_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
4941
+ end
4942
+ return data, status_code, headers
4943
+ end
4944
+
4945
+ # Convert Markdown to a PDF
4946
+ # Converts GitHub Flavored Markdown to PDF with DocSpring's stylesheet for Markdown, and your own CSS after it. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
4947
+ # @param body [MarkdownToPdfRequest] Markdown to convert to PDF, as `markdown` or as a file in `input` (one of them), with the page's settings. GitHub Flavored Markdown: tables, task lists, strikethrough and raw HTML. DocSpring's stylesheet for Markdown styles it, and your `css` is added after it.
4948
+ # @param [Hash] opts the optional parameters
4949
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
4950
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
4951
+ # @return [Job]
4952
+ def markdown_to_pdf(body, opts = {})
4953
+ data, _status_code, _headers = markdown_to_pdf_with_http_info(body, opts)
4954
+ data
4955
+ end
4956
+
4957
+ # Convert Markdown to a PDF
4958
+ # Converts GitHub Flavored Markdown to PDF with DocSpring's stylesheet for Markdown, and your own CSS after it. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
4959
+ # @param body [MarkdownToPdfRequest] Markdown to convert to PDF, as `markdown` or as a file in `input` (one of them), with the page's settings. GitHub Flavored Markdown: tables, task lists, strikethrough and raw HTML. DocSpring's stylesheet for Markdown styles it, and your `css` is added after it.
4960
+ # @param [Hash] opts the optional parameters
4961
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
4962
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
4963
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
4964
+ def markdown_to_pdf_with_http_info(body, opts = {})
4965
+ if @api_client.config.debugging
4966
+ @api_client.config.logger.debug 'Calling API: Client.markdown_to_pdf ...'
4967
+ end
4968
+ # verify the required parameter 'body' is set
4969
+ if @api_client.config.client_side_validation && body.nil?
4970
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.markdown_to_pdf"
4971
+ end
4972
+ # resource path
4973
+ local_var_path = '/jobs/markdown_to_pdf'
4974
+
4975
+ # query parameters
4976
+ query_params = opts[:query_params] || {}
4977
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
4978
+
4979
+ # header parameters
4980
+ header_params = opts[:header_params] || {}
4981
+ # HTTP header 'Accept' (if needed)
4982
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
4983
+ # HTTP header 'Content-Type'
4984
+ content_type = @api_client.select_header_content_type(['application/json'])
4985
+ if !content_type.nil?
4986
+ header_params['Content-Type'] = content_type
4987
+ end
4988
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
4989
+
4990
+ # form parameters
4991
+ form_params = opts[:form_params] || {}
4992
+
4993
+ # http body (model)
4994
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
4995
+
4996
+ # return_type
4997
+ return_type = opts[:debug_return_type] || 'Job'
4998
+
4999
+ # auth_names
5000
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
5001
+
5002
+ new_options = opts.merge(
5003
+ :operation => :"Client.markdown_to_pdf",
5004
+ :header_params => header_params,
5005
+ :query_params => query_params,
5006
+ :form_params => form_params,
5007
+ :body => post_body,
5008
+ :auth_names => auth_names,
5009
+ :return_type => return_type
5010
+ )
5011
+
5012
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
5013
+ if @api_client.config.debugging
5014
+ @api_client.config.logger.debug "API called: Client#markdown_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5015
+ end
5016
+ return data, status_code, headers
5017
+ end
5018
+
5019
+ # Move a folder
5020
+ # Moves a folder into another folder, or to the root with `parent_folder_id: null`. Its templates and folders move with it. A folder can't move into itself or one of its own folders.
5021
+ # @param folder_id [String] The folder's ID.
5022
+ # @param body [MoveFolderRequest] Where to move the folder.
5023
+ # @param [Hash] opts the optional parameters
5024
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
5025
+ # @return [Folder]
5026
+ def move_folder(folder_id, body, opts = {})
5027
+ data, _status_code, _headers = move_folder_with_http_info(folder_id, body, opts)
5028
+ data
5029
+ end
5030
+
5031
+ # Move a folder
5032
+ # Moves a folder into another folder, or to the root with `parent_folder_id: null`. Its templates and folders move with it. A folder can't move into itself or one of its own folders.
5033
+ # @param folder_id [String] The folder's ID.
5034
+ # @param body [MoveFolderRequest] Where to move the folder.
5035
+ # @param [Hash] opts the optional parameters
5036
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
5037
+ # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers
5038
+ def move_folder_with_http_info(folder_id, body, opts = {})
5039
+ if @api_client.config.debugging
5040
+ @api_client.config.logger.debug 'Calling API: Client.move_folder ...'
5041
+ end
5042
+ # verify the required parameter 'folder_id' is set
5043
+ if @api_client.config.client_side_validation && folder_id.nil?
5044
+ fail ArgumentError, "Missing the required parameter 'folder_id' when calling Client.move_folder"
5045
+ end
5046
+ # verify the required parameter 'body' is set
5047
+ if @api_client.config.client_side_validation && body.nil?
5048
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.move_folder"
5049
+ end
5050
+ # resource path
5051
+ local_var_path = '/folders/{folder_id}/move'.sub('{folder_id}', CGI.escape(folder_id.to_s))
5052
+
5053
+ # query parameters
5054
+ query_params = opts[:query_params] || {}
5055
+
5056
+ # header parameters
5057
+ header_params = opts[:header_params] || {}
5058
+ # HTTP header 'Accept' (if needed)
5059
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
5060
+ # HTTP header 'Content-Type'
5061
+ content_type = @api_client.select_header_content_type(['application/json'])
5062
+ if !content_type.nil?
5063
+ header_params['Content-Type'] = content_type
5064
+ end
5065
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
5066
+
5067
+ # form parameters
5068
+ form_params = opts[:form_params] || {}
5069
+
5070
+ # http body (model)
5071
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
5072
+
5073
+ # return_type
5074
+ return_type = opts[:debug_return_type] || 'Folder'
5075
+
5076
+ # auth_names
5077
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
5078
+
5079
+ new_options = opts.merge(
5080
+ :operation => :"Client.move_folder",
5081
+ :header_params => header_params,
5082
+ :query_params => query_params,
5083
+ :form_params => form_params,
5084
+ :body => post_body,
5085
+ :auth_names => auth_names,
5086
+ :return_type => return_type
5087
+ )
5088
+
5089
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
5090
+ if @api_client.config.debugging
5091
+ @api_client.config.logger.debug "API called: Client#move_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5092
+ end
5093
+ return data, status_code, headers
5094
+ end
5095
+
5096
+ # Move a template to a folder
5097
+ # Moves a template and all of its published versions to a folder, or to the root (`null`).
5098
+ # @param template_id [String] The template's ID.
5099
+ # @param body [MoveTemplateRequest] Where to move the template.
5100
+ # @param [Hash] opts the optional parameters
5101
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
5102
+ # @return [Template]
5103
+ def move_template(template_id, body, opts = {})
5104
+ data, _status_code, _headers = move_template_with_http_info(template_id, body, opts)
5105
+ data
5106
+ end
5107
+
5108
+ # Move a template to a folder
5109
+ # Moves a template and all of its published versions to a folder, or to the root (`null`).
5110
+ # @param template_id [String] The template's ID.
5111
+ # @param body [MoveTemplateRequest] Where to move the template.
5112
+ # @param [Hash] opts the optional parameters
5113
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
5114
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
5115
+ def move_template_with_http_info(template_id, body, opts = {})
5116
+ if @api_client.config.debugging
5117
+ @api_client.config.logger.debug 'Calling API: Client.move_template ...'
5118
+ end
5119
+ # verify the required parameter 'template_id' is set
5120
+ if @api_client.config.client_side_validation && template_id.nil?
5121
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.move_template"
5122
+ end
5123
+ # verify the required parameter 'body' is set
5124
+ if @api_client.config.client_side_validation && body.nil?
5125
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.move_template"
5126
+ end
5127
+ # resource path
5128
+ local_var_path = '/templates/{template_id}/move'.sub('{template_id}', CGI.escape(template_id.to_s))
5129
+
5130
+ # query parameters
5131
+ query_params = opts[:query_params] || {}
5132
+
5133
+ # header parameters
5134
+ header_params = opts[:header_params] || {}
5135
+ # HTTP header 'Accept' (if needed)
5136
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
5137
+ # HTTP header 'Content-Type'
5138
+ content_type = @api_client.select_header_content_type(['application/json'])
5139
+ if !content_type.nil?
5140
+ header_params['Content-Type'] = content_type
5141
+ end
5142
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
5143
+
5144
+ # form parameters
5145
+ form_params = opts[:form_params] || {}
5146
+
5147
+ # http body (model)
5148
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
4134
5149
 
4135
5150
  # return_type
4136
- return_type = opts[:debug_return_type] || 'WebhookList'
5151
+ return_type = opts[:debug_return_type] || 'Template'
4137
5152
 
4138
5153
  # auth_names
4139
5154
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
4140
5155
 
4141
5156
  new_options = opts.merge(
4142
- :operation => :"Client.list_webhooks",
5157
+ :operation => :"Client.move_template",
4143
5158
  :header_params => header_params,
4144
5159
  :query_params => query_params,
4145
5160
  :form_params => form_params,
@@ -4148,46 +5163,40 @@ end
4148
5163
  :return_type => return_type
4149
5164
  )
4150
5165
 
4151
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
5166
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
4152
5167
  if @api_client.config.debugging
4153
- @api_client.config.logger.debug "API called: Client#list_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5168
+ @api_client.config.logger.debug "API called: Client#move_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
4154
5169
  end
4155
5170
  return data, status_code, headers
4156
5171
  end
4157
5172
 
4158
- # Move a folder
4159
- # Moves a folder into another folder, or to the root with `parent_folder_id: null`. Its templates and folders move with it. A folder can't move into itself or one of its own folders.
4160
- # @param folder_id [String] The folder's ID.
4161
- # @param body [MoveFolderRequest] Where to move the folder.
5173
+ # Open a support ticket
5174
+ # Opens a support ticket with the DocSpring team, for when you're blocked, got a wrong result or need an answer. A person on the team reads every ticket and replies on it. The reply is also emailed to the user the API token or connected app belongs to (`notifications.email`), and `watch_url` says when the ticket changes. An AI agent asks its user before opening a ticket, showing them everything it would send, unless the user asked for the ticket (`source: user`). For something that only got in the way, send feedback instead. Every API token and connected app can open tickets, whatever its scopes. An account can open 20 tickets in 24 hours. Tokens and keys DocSpring recognises, and the values of a submission's `data` object, are removed from tickets and replies before they're stored.
5175
+ # @param body [OpenSupportTicketRequest] A problem that blocks the user, a wrong result or a question for the DocSpring team. Never include secrets, credentials or your users' data.
4162
5176
  # @param [Hash] opts the optional parameters
4163
5177
  # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
4164
- # @return [Folder]
4165
- def move_folder(folder_id, body, opts = {})
4166
- data, _status_code, _headers = move_folder_with_http_info(folder_id, body, opts)
5178
+ # @return [SupportTicket]
5179
+ def open_support_ticket(body, opts = {})
5180
+ data, _status_code, _headers = open_support_ticket_with_http_info(body, opts)
4167
5181
  data
4168
5182
  end
4169
5183
 
4170
- # Move a folder
4171
- # Moves a folder into another folder, or to the root with `parent_folder_id: null`. Its templates and folders move with it. A folder can't move into itself or one of its own folders.
4172
- # @param folder_id [String] The folder's ID.
4173
- # @param body [MoveFolderRequest] Where to move the folder.
5184
+ # Open a support ticket
5185
+ # Opens a support ticket with the DocSpring team, for when you're blocked, got a wrong result or need an answer. A person on the team reads every ticket and replies on it. The reply is also emailed to the user the API token or connected app belongs to (`notifications.email`), and `watch_url` says when the ticket changes. An AI agent asks its user before opening a ticket, showing them everything it would send, unless the user asked for the ticket (`source: user`). For something that only got in the way, send feedback instead. Every API token and connected app can open tickets, whatever its scopes. An account can open 20 tickets in 24 hours. Tokens and keys DocSpring recognises, and the values of a submission's `data` object, are removed from tickets and replies before they're stored.
5186
+ # @param body [OpenSupportTicketRequest] A problem that blocks the user, a wrong result or a question for the DocSpring team. Never include secrets, credentials or your users' data.
4174
5187
  # @param [Hash] opts the optional parameters
4175
5188
  # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
4176
- # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers
4177
- def move_folder_with_http_info(folder_id, body, opts = {})
5189
+ # @return [Array<(SupportTicket, Integer, Hash)>] SupportTicket data, response status code and response headers
5190
+ def open_support_ticket_with_http_info(body, opts = {})
4178
5191
  if @api_client.config.debugging
4179
- @api_client.config.logger.debug 'Calling API: Client.move_folder ...'
4180
- end
4181
- # verify the required parameter 'folder_id' is set
4182
- if @api_client.config.client_side_validation && folder_id.nil?
4183
- fail ArgumentError, "Missing the required parameter 'folder_id' when calling Client.move_folder"
5192
+ @api_client.config.logger.debug 'Calling API: Client.open_support_ticket ...'
4184
5193
  end
4185
5194
  # verify the required parameter 'body' is set
4186
5195
  if @api_client.config.client_side_validation && body.nil?
4187
- fail ArgumentError, "Missing the required parameter 'body' when calling Client.move_folder"
5196
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.open_support_ticket"
4188
5197
  end
4189
5198
  # resource path
4190
- local_var_path = '/folders/{folder_id}/move'.sub('{folder_id}', CGI.escape(folder_id.to_s))
5199
+ local_var_path = '/support/tickets'
4191
5200
 
4192
5201
  # query parameters
4193
5202
  query_params = opts[:query_params] || {}
@@ -4210,13 +5219,13 @@ end
4210
5219
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
4211
5220
 
4212
5221
  # return_type
4213
- return_type = opts[:debug_return_type] || 'Folder'
5222
+ return_type = opts[:debug_return_type] || 'SupportTicket'
4214
5223
 
4215
5224
  # auth_names
4216
5225
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
4217
5226
 
4218
5227
  new_options = opts.merge(
4219
- :operation => :"Client.move_folder",
5228
+ :operation => :"Client.open_support_ticket",
4220
5229
  :header_params => header_params,
4221
5230
  :query_params => query_params,
4222
5231
  :form_params => form_params,
@@ -4227,47 +5236,44 @@ end
4227
5236
 
4228
5237
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
4229
5238
  if @api_client.config.debugging
4230
- @api_client.config.logger.debug "API called: Client#move_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5239
+ @api_client.config.logger.debug "API called: Client#open_support_ticket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
4231
5240
  end
4232
5241
  return data, status_code, headers
4233
5242
  end
4234
5243
 
4235
- # Move a template to a folder
4236
- # Moves a template and all of its published versions to a folder, or to the root (`null`).
4237
- # @param template_id [String] The template's ID.
4238
- # @param body [MoveTemplateRequest] Where to move the template.
5244
+ # Render PDF pages as images
5245
+ # Renders pages as PNG or JPEG images, one file per page, up to 100 pages a job. A submission's page images are free with POST /submissions/{submission_id}/generate_files. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
5246
+ # @param body [PDFToImagesRequest] The PDF, and how to render its pages. Each page becomes one image file, up to 100 pages a job. A submission's page images are free with POST /submissions/{submission_id}/generate_files.
4239
5247
  # @param [Hash] opts the optional parameters
5248
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
4240
5249
  # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
4241
- # @return [Template]
4242
- def move_template(template_id, body, opts = {})
4243
- data, _status_code, _headers = move_template_with_http_info(template_id, body, opts)
5250
+ # @return [Job]
5251
+ def pdf_to_images(body, opts = {})
5252
+ data, _status_code, _headers = pdf_to_images_with_http_info(body, opts)
4244
5253
  data
4245
5254
  end
4246
5255
 
4247
- # Move a template to a folder
4248
- # Moves a template and all of its published versions to a folder, or to the root (`null`).
4249
- # @param template_id [String] The template's ID.
4250
- # @param body [MoveTemplateRequest] Where to move the template.
5256
+ # Render PDF pages as images
5257
+ # Renders pages as PNG or JPEG images, one file per page, up to 100 pages a job. A submission's page images are free with POST /submissions/{submission_id}/generate_files. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
5258
+ # @param body [PDFToImagesRequest] The PDF, and how to render its pages. Each page becomes one image file, up to 100 pages a job. A submission's page images are free with POST /submissions/{submission_id}/generate_files.
4251
5259
  # @param [Hash] opts the optional parameters
5260
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
4252
5261
  # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
4253
- # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
4254
- def move_template_with_http_info(template_id, body, opts = {})
5262
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
5263
+ def pdf_to_images_with_http_info(body, opts = {})
4255
5264
  if @api_client.config.debugging
4256
- @api_client.config.logger.debug 'Calling API: Client.move_template ...'
4257
- end
4258
- # verify the required parameter 'template_id' is set
4259
- if @api_client.config.client_side_validation && template_id.nil?
4260
- fail ArgumentError, "Missing the required parameter 'template_id' when calling Client.move_template"
5265
+ @api_client.config.logger.debug 'Calling API: Client.pdf_to_images ...'
4261
5266
  end
4262
5267
  # verify the required parameter 'body' is set
4263
5268
  if @api_client.config.client_side_validation && body.nil?
4264
- fail ArgumentError, "Missing the required parameter 'body' when calling Client.move_template"
5269
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.pdf_to_images"
4265
5270
  end
4266
5271
  # resource path
4267
- local_var_path = '/templates/{template_id}/move'.sub('{template_id}', CGI.escape(template_id.to_s))
5272
+ local_var_path = '/jobs/pdf_to_images'
4268
5273
 
4269
5274
  # query parameters
4270
5275
  query_params = opts[:query_params] || {}
5276
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
4271
5277
 
4272
5278
  # header parameters
4273
5279
  header_params = opts[:header_params] || {}
@@ -4287,13 +5293,13 @@ end
4287
5293
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
4288
5294
 
4289
5295
  # return_type
4290
- return_type = opts[:debug_return_type] || 'Template'
5296
+ return_type = opts[:debug_return_type] || 'Job'
4291
5297
 
4292
5298
  # auth_names
4293
5299
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
4294
5300
 
4295
5301
  new_options = opts.merge(
4296
- :operation => :"Client.move_template",
5302
+ :operation => :"Client.pdf_to_images",
4297
5303
  :header_params => header_params,
4298
5304
  :query_params => query_params,
4299
5305
  :form_params => form_params,
@@ -4304,41 +5310,44 @@ end
4304
5310
 
4305
5311
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
4306
5312
  if @api_client.config.debugging
4307
- @api_client.config.logger.debug "API called: Client#move_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5313
+ @api_client.config.logger.debug "API called: Client#pdf_to_images\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
4308
5314
  end
4309
5315
  return data, status_code, headers
4310
5316
  end
4311
5317
 
4312
- # Open a support ticket
4313
- # Opens a support ticket with the DocSpring team, for when you're blocked, got a wrong result or need an answer. A person on the team reads every ticket and replies on it. The reply is also emailed to the user the API token or connected app belongs to (`notifications.email`), and `watch_url` says when the ticket changes. An AI agent asks its user before opening a ticket, showing them everything it would send, unless the user asked for the ticket (`source: user`). For something that only got in the way, send feedback instead. Every API token and connected app can open tickets, whatever its scopes. An account can open 20 tickets in 24 hours.
4314
- # @param body [OpenSupportTicketRequest] A problem that blocks the user, a wrong result or a question for the DocSpring team. Never include secrets, credentials or your users' data.
5318
+ # Extract text from a PDF
5319
+ # Extracts a PDF's text into a .txt file, in reading order. Scanned pages have no text (there's no OCR yet). Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
5320
+ # @param body [PDFToTextRequest] The PDF whose text to extract into a .txt file. Scanned pages have no text (there's no OCR yet).
4315
5321
  # @param [Hash] opts the optional parameters
5322
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
4316
5323
  # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
4317
- # @return [SupportTicket]
4318
- def open_support_ticket(body, opts = {})
4319
- data, _status_code, _headers = open_support_ticket_with_http_info(body, opts)
5324
+ # @return [Job]
5325
+ def pdf_to_text(body, opts = {})
5326
+ data, _status_code, _headers = pdf_to_text_with_http_info(body, opts)
4320
5327
  data
4321
5328
  end
4322
5329
 
4323
- # Open a support ticket
4324
- # Opens a support ticket with the DocSpring team, for when you're blocked, got a wrong result or need an answer. A person on the team reads every ticket and replies on it. The reply is also emailed to the user the API token or connected app belongs to (`notifications.email`), and `watch_url` says when the ticket changes. An AI agent asks its user before opening a ticket, showing them everything it would send, unless the user asked for the ticket (`source: user`). For something that only got in the way, send feedback instead. Every API token and connected app can open tickets, whatever its scopes. An account can open 20 tickets in 24 hours.
4325
- # @param body [OpenSupportTicketRequest] A problem that blocks the user, a wrong result or a question for the DocSpring team. Never include secrets, credentials or your users' data.
5330
+ # Extract text from a PDF
5331
+ # Extracts a PDF's text into a .txt file, in reading order. Scanned pages have no text (there's no OCR yet). Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
5332
+ # @param body [PDFToTextRequest] The PDF whose text to extract into a .txt file. Scanned pages have no text (there's no OCR yet).
4326
5333
  # @param [Hash] opts the optional parameters
5334
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
4327
5335
  # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
4328
- # @return [Array<(SupportTicket, Integer, Hash)>] SupportTicket data, response status code and response headers
4329
- def open_support_ticket_with_http_info(body, opts = {})
5336
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
5337
+ def pdf_to_text_with_http_info(body, opts = {})
4330
5338
  if @api_client.config.debugging
4331
- @api_client.config.logger.debug 'Calling API: Client.open_support_ticket ...'
5339
+ @api_client.config.logger.debug 'Calling API: Client.pdf_to_text ...'
4332
5340
  end
4333
5341
  # verify the required parameter 'body' is set
4334
5342
  if @api_client.config.client_side_validation && body.nil?
4335
- fail ArgumentError, "Missing the required parameter 'body' when calling Client.open_support_ticket"
5343
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.pdf_to_text"
4336
5344
  end
4337
5345
  # resource path
4338
- local_var_path = '/support/tickets'
5346
+ local_var_path = '/jobs/pdf_to_text'
4339
5347
 
4340
5348
  # query parameters
4341
5349
  query_params = opts[:query_params] || {}
5350
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
4342
5351
 
4343
5352
  # header parameters
4344
5353
  header_params = opts[:header_params] || {}
@@ -4358,13 +5367,13 @@ end
4358
5367
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
4359
5368
 
4360
5369
  # return_type
4361
- return_type = opts[:debug_return_type] || 'SupportTicket'
5370
+ return_type = opts[:debug_return_type] || 'Job'
4362
5371
 
4363
5372
  # auth_names
4364
5373
  auth_names = opts[:debug_auth_names] || ['api_token_basic']
4365
5374
 
4366
5375
  new_options = opts.merge(
4367
- :operation => :"Client.open_support_ticket",
5376
+ :operation => :"Client.pdf_to_text",
4368
5377
  :header_params => header_params,
4369
5378
  :query_params => query_params,
4370
5379
  :form_params => form_params,
@@ -4375,7 +5384,7 @@ end
4375
5384
 
4376
5385
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
4377
5386
  if @api_client.config.debugging
4378
- @api_client.config.logger.debug "API called: Client#open_support_ticket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5387
+ @api_client.config.logger.debug "API called: Client#pdf_to_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
4379
5388
  end
4380
5389
  return data, status_code, headers
4381
5390
  end
@@ -4842,6 +5851,80 @@ end
4842
5851
  return data, status_code, headers
4843
5852
  end
4844
5853
 
5854
+ # Rotate pages
5855
+ # Turns pages by 90, 180 or 270 degrees, added to each page's own rotation. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
5856
+ # @param body [RotatePagesRequest] The PDF, and the pages to rotate.
5857
+ # @param [Hash] opts the optional parameters
5858
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
5859
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
5860
+ # @return [Job]
5861
+ def rotate_pages(body, opts = {})
5862
+ data, _status_code, _headers = rotate_pages_with_http_info(body, opts)
5863
+ data
5864
+ end
5865
+
5866
+ # Rotate pages
5867
+ # Turns pages by 90, 180 or 270 degrees, added to each page's own rotation. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
5868
+ # @param body [RotatePagesRequest] The PDF, and the pages to rotate.
5869
+ # @param [Hash] opts the optional parameters
5870
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
5871
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
5872
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
5873
+ def rotate_pages_with_http_info(body, opts = {})
5874
+ if @api_client.config.debugging
5875
+ @api_client.config.logger.debug 'Calling API: Client.rotate_pages ...'
5876
+ end
5877
+ # verify the required parameter 'body' is set
5878
+ if @api_client.config.client_side_validation && body.nil?
5879
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.rotate_pages"
5880
+ end
5881
+ # resource path
5882
+ local_var_path = '/jobs/rotate_pages'
5883
+
5884
+ # query parameters
5885
+ query_params = opts[:query_params] || {}
5886
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
5887
+
5888
+ # header parameters
5889
+ header_params = opts[:header_params] || {}
5890
+ # HTTP header 'Accept' (if needed)
5891
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
5892
+ # HTTP header 'Content-Type'
5893
+ content_type = @api_client.select_header_content_type(['application/json'])
5894
+ if !content_type.nil?
5895
+ header_params['Content-Type'] = content_type
5896
+ end
5897
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
5898
+
5899
+ # form parameters
5900
+ form_params = opts[:form_params] || {}
5901
+
5902
+ # http body (model)
5903
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
5904
+
5905
+ # return_type
5906
+ return_type = opts[:debug_return_type] || 'Job'
5907
+
5908
+ # auth_names
5909
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
5910
+
5911
+ new_options = opts.merge(
5912
+ :operation => :"Client.rotate_pages",
5913
+ :header_params => header_params,
5914
+ :query_params => query_params,
5915
+ :form_params => form_params,
5916
+ :body => post_body,
5917
+ :auth_names => auth_names,
5918
+ :return_type => return_type
5919
+ )
5920
+
5921
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
5922
+ if @api_client.config.debugging
5923
+ @api_client.config.logger.debug "API called: Client#rotate_pages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5924
+ end
5925
+ return data, status_code, headers
5926
+ end
5927
+
4845
5928
  # Send a test email for an account email action
4846
5929
  # Sends the account email action's email to the API token's user only, as it would go for one template it sends for, with each field shown as its name in brackets, so you can check how it looks. When the email action attaches its files and that template is a PDF template, the test attaches the template's blank PDF. It isn't recorded on any submission.
4847
5930
  # @param email_action_id [String] The account email action's ID.
@@ -4988,7 +6071,7 @@ end
4988
6071
  end
4989
6072
 
4990
6073
  # Send feedback
4991
- # Tells the DocSpring team about something that got in the way while the work still got done: a confusing error, a missing feature, wrong documentation, a bug you worked around, or an idea. For AI agents as much as people: an agent sends it without asking its user, at most once per distinct problem, and tells them afterwards. Nobody replies to feedback, and it can't be read back. When you're blocked or need an answer, open a support ticket instead. Every API token and connected app can send feedback, whatever its scopes. An account can send 50 pieces of feedback in 24 hours.
6074
+ # Tells the DocSpring team about something that got in the way while the work still got done: a confusing error, a missing feature, wrong documentation, a bug you worked around, or an idea. For AI agents as much as people: an agent sends it without asking its user, at most once per distinct problem, and tells them afterwards. Nobody replies to feedback, and it can't be read back. When you're blocked or need an answer, open a support ticket instead. Every API token and connected app can send feedback, whatever its scopes. An account can send 50 pieces of feedback in 24 hours. Tokens and keys DocSpring recognises, and the values of a submission's `data` object, are removed before it's stored.
4992
6075
  # @param body [SendSupportFeedbackRequest] Something about DocSpring that got in the way while the work still got done. Never include secrets, credentials or your users' data.
4993
6076
  # @param [Hash] opts the optional parameters
4994
6077
  # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
@@ -4999,7 +6082,7 @@ end
4999
6082
  end
5000
6083
 
5001
6084
  # Send feedback
5002
- # Tells the DocSpring team about something that got in the way while the work still got done: a confusing error, a missing feature, wrong documentation, a bug you worked around, or an idea. For AI agents as much as people: an agent sends it without asking its user, at most once per distinct problem, and tells them afterwards. Nobody replies to feedback, and it can't be read back. When you're blocked or need an answer, open a support ticket instead. Every API token and connected app can send feedback, whatever its scopes. An account can send 50 pieces of feedback in 24 hours.
6085
+ # Tells the DocSpring team about something that got in the way while the work still got done: a confusing error, a missing feature, wrong documentation, a bug you worked around, or an idea. For AI agents as much as people: an agent sends it without asking its user, at most once per distinct problem, and tells them afterwards. Nobody replies to feedback, and it can't be read back. When you're blocked or need an answer, open a support ticket instead. Every API token and connected app can send feedback, whatever its scopes. An account can send 50 pieces of feedback in 24 hours. Tokens and keys DocSpring recognises, and the values of a submission's `data` object, are removed before it's stored.
5003
6086
  # @param body [SendSupportFeedbackRequest] Something about DocSpring that got in the way while the work still got done. Never include secrets, credentials or your users' data.
5004
6087
  # @param [Hash] opts the optional parameters
5005
6088
  # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
@@ -5058,6 +6141,80 @@ end
5058
6141
  return data, status_code, headers
5059
6142
  end
5060
6143
 
6144
+ # Split a PDF
6145
+ # Splits a PDF into a file per page, a file every few pages (`pages_per_file`), or a file per range (`ranges`). Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
6146
+ # @param body [SplitPdfRequest] The PDF to split, and where to split it. A job makes at most 100 files.
6147
+ # @param [Hash] opts the optional parameters
6148
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
6149
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
6150
+ # @return [Job]
6151
+ def split_pdf(body, opts = {})
6152
+ data, _status_code, _headers = split_pdf_with_http_info(body, opts)
6153
+ data
6154
+ end
6155
+
6156
+ # Split a PDF
6157
+ # Splits a PDF into a file per page, a file every few pages (`pages_per_file`), or a file per range (`ranges`). Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
6158
+ # @param body [SplitPdfRequest] The PDF to split, and where to split it. A job makes at most 100 files.
6159
+ # @param [Hash] opts the optional parameters
6160
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
6161
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
6162
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
6163
+ def split_pdf_with_http_info(body, opts = {})
6164
+ if @api_client.config.debugging
6165
+ @api_client.config.logger.debug 'Calling API: Client.split_pdf ...'
6166
+ end
6167
+ # verify the required parameter 'body' is set
6168
+ if @api_client.config.client_side_validation && body.nil?
6169
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.split_pdf"
6170
+ end
6171
+ # resource path
6172
+ local_var_path = '/jobs/split_pdf'
6173
+
6174
+ # query parameters
6175
+ query_params = opts[:query_params] || {}
6176
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
6177
+
6178
+ # header parameters
6179
+ header_params = opts[:header_params] || {}
6180
+ # HTTP header 'Accept' (if needed)
6181
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
6182
+ # HTTP header 'Content-Type'
6183
+ content_type = @api_client.select_header_content_type(['application/json'])
6184
+ if !content_type.nil?
6185
+ header_params['Content-Type'] = content_type
6186
+ end
6187
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
6188
+
6189
+ # form parameters
6190
+ form_params = opts[:form_params] || {}
6191
+
6192
+ # http body (model)
6193
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
6194
+
6195
+ # return_type
6196
+ return_type = opts[:debug_return_type] || 'Job'
6197
+
6198
+ # auth_names
6199
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
6200
+
6201
+ new_options = opts.merge(
6202
+ :operation => :"Client.split_pdf",
6203
+ :header_params => header_params,
6204
+ :query_params => query_params,
6205
+ :form_params => form_params,
6206
+ :body => post_body,
6207
+ :auth_names => auth_names,
6208
+ :return_type => return_type
6209
+ )
6210
+
6211
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
6212
+ if @api_client.config.debugging
6213
+ @api_client.config.logger.debug "API called: Client#split_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
6214
+ end
6215
+ return data, status_code, headers
6216
+ end
6217
+
5061
6218
  # Test authentication
5062
6219
  # Checks whether your API token is valid by making an authenticated request. This endpoint is useful for verifying credentials during setup or troubleshooting issues.
5063
6220
  # @param [Hash] opts the optional parameters
@@ -6086,5 +7243,79 @@ end
6086
7243
  end
6087
7244
  return data, status_code, headers
6088
7245
  end
7246
+
7247
+ # Watermark a PDF
7248
+ # Puts text across the pages, such as CONFIDENTIAL, over or under their content. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
7249
+ # @param body [WatermarkPdfRequest] The PDF, and the text to put across its pages.
7250
+ # @param [Hash] opts the optional parameters
7251
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
7252
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
7253
+ # @return [Job]
7254
+ def watermark_pdf(body, opts = {})
7255
+ data, _status_code, _headers = watermark_pdf_with_http_info(body, opts)
7256
+ data
7257
+ end
7258
+
7259
+ # Watermark a PDF
7260
+ # Puts text across the pages, such as CONFIDENTIAL, over or under their content. Returns a job. The tool runs in the background: on sync.api hosts the request waits for it (unless you pass `wait=false`), otherwise poll GET /jobs/{job_id} until `state` isn't `pending`. The job's files are kept for a day after it finishes, unless you set `expires_in`.
7261
+ # @param body [WatermarkPdfRequest] The PDF, and the text to put across its pages.
7262
+ # @param [Hash] opts the optional parameters
7263
+ # @option opts [Boolean] :wait Wait until the job has run before responding. Default true on sync.api hosts.
7264
+ # @option opts [String] :idempotency_key A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` with a `Retry-After` header means the first request is still being processed: send the request again then. A repeated response is the first one as it was, so its `download_url` links may have expired: use `permanent_url`, or get the record again for new links.
7265
+ # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
7266
+ def watermark_pdf_with_http_info(body, opts = {})
7267
+ if @api_client.config.debugging
7268
+ @api_client.config.logger.debug 'Calling API: Client.watermark_pdf ...'
7269
+ end
7270
+ # verify the required parameter 'body' is set
7271
+ if @api_client.config.client_side_validation && body.nil?
7272
+ fail ArgumentError, "Missing the required parameter 'body' when calling Client.watermark_pdf"
7273
+ end
7274
+ # resource path
7275
+ local_var_path = '/jobs/watermark_pdf'
7276
+
7277
+ # query parameters
7278
+ query_params = opts[:query_params] || {}
7279
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
7280
+
7281
+ # header parameters
7282
+ header_params = opts[:header_params] || {}
7283
+ # HTTP header 'Accept' (if needed)
7284
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
7285
+ # HTTP header 'Content-Type'
7286
+ content_type = @api_client.select_header_content_type(['application/json'])
7287
+ if !content_type.nil?
7288
+ header_params['Content-Type'] = content_type
7289
+ end
7290
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
7291
+
7292
+ # form parameters
7293
+ form_params = opts[:form_params] || {}
7294
+
7295
+ # http body (model)
7296
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
7297
+
7298
+ # return_type
7299
+ return_type = opts[:debug_return_type] || 'Job'
7300
+
7301
+ # auth_names
7302
+ auth_names = opts[:debug_auth_names] || ['api_token_basic']
7303
+
7304
+ new_options = opts.merge(
7305
+ :operation => :"Client.watermark_pdf",
7306
+ :header_params => header_params,
7307
+ :query_params => query_params,
7308
+ :form_params => form_params,
7309
+ :body => post_body,
7310
+ :auth_names => auth_names,
7311
+ :return_type => return_type
7312
+ )
7313
+
7314
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
7315
+ if @api_client.config.debugging
7316
+ @api_client.config.logger.debug "API called: Client#watermark_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
7317
+ end
7318
+ return data, status_code, headers
7319
+ end
6089
7320
  end
6090
7321
  end