Class: PDFGeneratorAPI::DocumentsApi
- Inherits:
-
Object
- Object
- PDFGeneratorAPI::DocumentsApi
- Defined in:
- lib/pdf_generator_api_client/api/documents_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_document(public_id, opts = {}) ⇒ nil
Delete document Delete document from the Document Storage.
-
#delete_document_with_http_info(public_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete document Delete document from the Document Storage.
-
#generate_document(generate_document_request, opts = {}) ⇒ InlineObject9
Generate document Merges template with data and returns base64 encoded document or a public URL to a document.
-
#generate_document_asynchronous(generate_document_asynchronous_request, opts = {}) ⇒ InlineObject20
Generate document (async) Merges template with data as asynchronous job and makes POST request to callback URL defined in the request.
-
#generate_document_asynchronous_with_http_info(generate_document_asynchronous_request, opts = {}) ⇒ Array<(InlineObject20, Integer, Hash)>
Generate document (async) Merges template with data as asynchronous job and makes POST request to callback URL defined in the request.
-
#generate_document_batch(generate_document_batch_request, opts = {}) ⇒ InlineObject9
Generate document (batch) Allows to merge multiple templates with data and returns base64 encoded document or public URL to a document.
-
#generate_document_batch_asynchronous(generate_document_batch_asynchronous_request, opts = {}) ⇒ InlineObject20
Generate document (batch + async) Merges template with data as asynchronous job and makes POST request to callback URL defined in the request.
-
#generate_document_batch_asynchronous_with_http_info(generate_document_batch_asynchronous_request, opts = {}) ⇒ Array<(InlineObject20, Integer, Hash)>
Generate document (batch + async) Merges template with data as asynchronous job and makes POST request to callback URL defined in the request.
-
#generate_document_batch_with_http_info(generate_document_batch_request, opts = {}) ⇒ Array<(InlineObject9, Integer, Hash)>
Generate document (batch) Allows to merge multiple templates with data and returns base64 encoded document or public URL to a document.
-
#generate_document_with_http_info(generate_document_request, opts = {}) ⇒ Array<(InlineObject9, Integer, Hash)>
Generate document Merges template with data and returns base64 encoded document or a public URL to a document.
-
#get_async_job_status(job_id, opts = {}) ⇒ InlineObject13
Get job status Returns status of an async job.
-
#get_async_job_status_with_http_info(job_id, opts = {}) ⇒ Array<(InlineObject13, Integer, Hash)>
Get job status Returns status of an async job.
-
#get_document(public_id, opts = {}) ⇒ InlineObject11
Get document Returns document stored in the Document Storage.
-
#get_document_with_http_info(public_id, opts = {}) ⇒ Array<(InlineObject11, Integer, Hash)>
Get document Returns document stored in the Document Storage.
-
#get_documents(opts = {}) ⇒ InlineObject15
Get documents Returns a list of generated documents created by authorized workspace and stored in PDF Generator API.
-
#get_documents_with_http_info(opts = {}) ⇒ Array<(InlineObject15, Integer, Hash)>
Get documents Returns a list of generated documents created by authorized workspace and stored in PDF Generator API.
-
#initialize(api_client = ApiClient.default) ⇒ DocumentsApi
constructor
A new instance of DocumentsApi.
-
#store_document(store_document_request, opts = {}) ⇒ InlineObject11
Store document Uploads a PDF as a URL or a base64 encoded string.
-
#store_document_with_http_info(store_document_request, opts = {}) ⇒ Array<(InlineObject11, Integer, Hash)>
Store document Uploads a PDF as a URL or a base64 encoded string.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ DocumentsApi
Returns a new instance of DocumentsApi.
19 20 21 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#delete_document(public_id, opts = {}) ⇒ nil
Delete document Delete document from the Document Storage
27 28 29 30 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 27 def delete_document(public_id, opts = {}) delete_document_with_http_info(public_id, opts) nil end |
#delete_document_with_http_info(public_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete document Delete document from the Document Storage
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 37 def delete_document_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentsApi.delete_document ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling DocumentsApi.delete_document" end # resource path local_var_path = '/documents/{publicId}'.sub('{' + 'publicId' + '}', CGI.escape(public_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"DocumentsApi.delete_document", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#delete_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#generate_document(generate_document_request, opts = {}) ⇒ InlineObject9
Generate document Merges template with data and returns base64 encoded document or a public URL to a document. NB! When the public URL option is used, the document is stored for 30 days and automatically deleted.
90 91 92 93 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 90 def generate_document(generate_document_request, opts = {}) data, _status_code, _headers = generate_document_with_http_info(generate_document_request, opts) data end |
#generate_document_asynchronous(generate_document_asynchronous_request, opts = {}) ⇒ InlineObject20
Generate document (async) Merges template with data as asynchronous job and makes POST request to callback URL defined in the request. Request uses the same format as response of synchronous generation endpoint. The job id is also added to the callback request as header PDF-API-Job-Id *Example response from callback URL:* “‘ { "response": "us1.pdfgeneratorapi.com/share/12821/VBERi0xLjcKJeLjz9MKNyAwIG9i", "meta": { "name": "a2bd25b8921f3dc7a440fd7f427f90a4.pdf", "display_name": "a2bd25b8921f3dc7a440fd7f427f90a4", "encoding": "binary", "content-type": "application/pdf" } } “`
158 159 160 161 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 158 def generate_document_asynchronous(generate_document_asynchronous_request, opts = {}) data, _status_code, _headers = generate_document_asynchronous_with_http_info(generate_document_asynchronous_request, opts) data end |
#generate_document_asynchronous_with_http_info(generate_document_asynchronous_request, opts = {}) ⇒ Array<(InlineObject20, Integer, Hash)>
Generate document (async) Merges template with data as asynchronous job and makes POST request to callback URL defined in the request. Request uses the same format as response of synchronous generation endpoint. The job id is also added to the callback request as header PDF-API-Job-Id *Example response from callback URL:* ``` { "response": "us1.pdfgeneratorapi.com/share/12821/VBERi0xLjcKJeLjz9MKNyAwIG9i", "meta": { "name": "a2bd25b8921f3dc7a440fd7f427f90a4.pdf", "display_name": "a2bd25b8921f3dc7a440fd7f427f90a4", "encoding": "binary", "content-type": "application/pdf" } } ```
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 168 def generate_document_asynchronous_with_http_info(generate_document_asynchronous_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentsApi.generate_document_asynchronous ...' end # verify the required parameter 'generate_document_asynchronous_request' is set if @api_client.config.client_side_validation && generate_document_asynchronous_request.nil? fail ArgumentError, "Missing the required parameter 'generate_document_asynchronous_request' when calling DocumentsApi.generate_document_asynchronous" end # resource path local_var_path = '/documents/generate/async' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_document_asynchronous_request) # return_type return_type = opts[:debug_return_type] || 'InlineObject20' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"DocumentsApi.generate_document_asynchronous", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#generate_document_asynchronous\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#generate_document_batch(generate_document_batch_request, opts = {}) ⇒ InlineObject9
Generate document (batch) Allows to merge multiple templates with data and returns base64 encoded document or public URL to a document. NB! When the public URL option is used, the document is stored for 30 days and automatically deleted.
226 227 228 229 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 226 def generate_document_batch(generate_document_batch_request, opts = {}) data, _status_code, _headers = generate_document_batch_with_http_info(generate_document_batch_request, opts) data end |
#generate_document_batch_asynchronous(generate_document_batch_asynchronous_request, opts = {}) ⇒ InlineObject20
Generate document (batch + async) Merges template with data as asynchronous job and makes POST request to callback URL defined in the request. Request uses the same format as response of synchronous generation endpoint. The job id is also added to the callback request as header PDF-API-Job-Id *Example response from callback URL:* “‘ { "response": "us1.pdfgeneratorapi.com/share/12821/VBERi0xLjcKJeLjz9MKNyAwIG9i", "meta": { "name": "a2bd25b8921f3dc7a440fd7f427f90a4.pdf", "display_name": "a2bd25b8921f3dc7a440fd7f427f90a4", "encoding": "binary", "content-type": "application/pdf" } } “`
294 295 296 297 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 294 def generate_document_batch_asynchronous(generate_document_batch_asynchronous_request, opts = {}) data, _status_code, _headers = generate_document_batch_asynchronous_with_http_info(generate_document_batch_asynchronous_request, opts) data end |
#generate_document_batch_asynchronous_with_http_info(generate_document_batch_asynchronous_request, opts = {}) ⇒ Array<(InlineObject20, Integer, Hash)>
Generate document (batch + async) Merges template with data as asynchronous job and makes POST request to callback URL defined in the request. Request uses the same format as response of synchronous generation endpoint. The job id is also added to the callback request as header PDF-API-Job-Id *Example response from callback URL:* ``` { "response": "us1.pdfgeneratorapi.com/share/12821/VBERi0xLjcKJeLjz9MKNyAwIG9i", "meta": { "name": "a2bd25b8921f3dc7a440fd7f427f90a4.pdf", "display_name": "a2bd25b8921f3dc7a440fd7f427f90a4", "encoding": "binary", "content-type": "application/pdf" } } ```
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 304 def generate_document_batch_asynchronous_with_http_info(generate_document_batch_asynchronous_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentsApi.generate_document_batch_asynchronous ...' end # verify the required parameter 'generate_document_batch_asynchronous_request' is set if @api_client.config.client_side_validation && generate_document_batch_asynchronous_request.nil? fail ArgumentError, "Missing the required parameter 'generate_document_batch_asynchronous_request' when calling DocumentsApi.generate_document_batch_asynchronous" end # resource path local_var_path = '/documents/generate/batch/async' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_document_batch_asynchronous_request) # return_type return_type = opts[:debug_return_type] || 'InlineObject20' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"DocumentsApi.generate_document_batch_asynchronous", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#generate_document_batch_asynchronous\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#generate_document_batch_with_http_info(generate_document_batch_request, opts = {}) ⇒ Array<(InlineObject9, Integer, Hash)>
Generate document (batch) Allows to merge multiple templates with data and returns base64 encoded document or public URL to a document. NB! When the public URL option is used, the document is stored for 30 days and automatically deleted.
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 236 def generate_document_batch_with_http_info(generate_document_batch_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentsApi.generate_document_batch ...' end # verify the required parameter 'generate_document_batch_request' is set if @api_client.config.client_side_validation && generate_document_batch_request.nil? fail ArgumentError, "Missing the required parameter 'generate_document_batch_request' when calling DocumentsApi.generate_document_batch" end # resource path local_var_path = '/documents/generate/batch' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_document_batch_request) # return_type return_type = opts[:debug_return_type] || 'InlineObject9' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"DocumentsApi.generate_document_batch", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#generate_document_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#generate_document_with_http_info(generate_document_request, opts = {}) ⇒ Array<(InlineObject9, Integer, Hash)>
Generate document Merges template with data and returns base64 encoded document or a public URL to a document. NB! When the public URL option is used, the document is stored for 30 days and automatically deleted.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 100 def generate_document_with_http_info(generate_document_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentsApi.generate_document ...' end # verify the required parameter 'generate_document_request' is set if @api_client.config.client_side_validation && generate_document_request.nil? fail ArgumentError, "Missing the required parameter 'generate_document_request' when calling DocumentsApi.generate_document" end # resource path local_var_path = '/documents/generate' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_document_request) # return_type return_type = opts[:debug_return_type] || 'InlineObject9' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"DocumentsApi.generate_document", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#generate_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_async_job_status(job_id, opts = {}) ⇒ InlineObject13
Get job status Returns status of an async job
362 363 364 365 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 362 def get_async_job_status(job_id, opts = {}) data, _status_code, _headers = get_async_job_status_with_http_info(job_id, opts) data end |
#get_async_job_status_with_http_info(job_id, opts = {}) ⇒ Array<(InlineObject13, Integer, Hash)>
Get job status Returns status of an async job
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 372 def get_async_job_status_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentsApi.get_async_job_status ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling DocumentsApi.get_async_job_status" end # resource path local_var_path = '/documents/async/{jobId}'.sub('{' + 'jobId' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'InlineObject13' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"DocumentsApi.get_async_job_status", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#get_async_job_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_document(public_id, opts = {}) ⇒ InlineObject11
Get document Returns document stored in the Document Storage
425 426 427 428 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 425 def get_document(public_id, opts = {}) data, _status_code, _headers = get_document_with_http_info(public_id, opts) data end |
#get_document_with_http_info(public_id, opts = {}) ⇒ Array<(InlineObject11, Integer, Hash)>
Get document Returns document stored in the Document Storage
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 435 def get_document_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentsApi.get_document ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling DocumentsApi.get_document" end # resource path local_var_path = '/documents/{publicId}'.sub('{' + 'publicId' + '}', CGI.escape(public_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'InlineObject11' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"DocumentsApi.get_document", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#get_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_documents(opts = {}) ⇒ InlineObject15
Get documents Returns a list of generated documents created by authorized workspace and stored in PDF Generator API. If master user is specified as workspace in JWT then all documents created in the organization are returned. NB! This endpoint returns only documents generated using the output=url option.
492 493 494 495 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 492 def get_documents(opts = {}) data, _status_code, _headers = get_documents_with_http_info(opts) data end |
#get_documents_with_http_info(opts = {}) ⇒ Array<(InlineObject15, Integer, Hash)>
Get documents Returns a list of generated documents created by authorized workspace and stored in PDF Generator API. If master user is specified as workspace in JWT then all documents created in the organization are returned. NB! This endpoint returns only documents generated using the output=url option.
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 506 def get_documents_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentsApi.get_documents ...' end # resource path local_var_path = '/documents' # query parameters query_params = opts[:query_params] || {} query_params[:'template_id'] = opts[:'template_id'] if !opts[:'template_id'].nil? query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'InlineObject15' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"DocumentsApi.get_documents", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#get_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#store_document(store_document_request, opts = {}) ⇒ InlineObject11
Store document Uploads a PDF as a URL or a base64 encoded string.
560 561 562 563 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 560 def store_document(store_document_request, opts = {}) data, _status_code, _headers = store_document_with_http_info(store_document_request, opts) data end |
#store_document_with_http_info(store_document_request, opts = {}) ⇒ Array<(InlineObject11, Integer, Hash)>
Store document Uploads a PDF as a URL or a base64 encoded string.
570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 |
# File 'lib/pdf_generator_api_client/api/documents_api.rb', line 570 def store_document_with_http_info(store_document_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentsApi.store_document ...' end # verify the required parameter 'store_document_request' is set if @api_client.config.client_side_validation && store_document_request.nil? fail ArgumentError, "Missing the required parameter 'store_document_request' when calling DocumentsApi.store_document" end # resource path local_var_path = '/documents' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(store_document_request) # return_type return_type = opts[:debug_return_type] || 'InlineObject11' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"DocumentsApi.store_document", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#store_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |