docspring 1.0.0 → 1.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -45
- data/Gemfile +2 -1
- data/Gemfile.lock +37 -32
- data/README.md +15 -9
- data/docs/CombinedSubmission.md +1 -0
- data/docs/CreateTemplateData.md +1 -1
- data/docs/CreateTemplateData1.md +8 -0
- data/docs/PDFApi.md +114 -12
- data/docs/PendingTemplate.md +1 -0
- data/docs/Submission.md +1 -0
- data/docs/SubmissionData.md +1 -0
- data/docs/SubmissionDataRequest.md +2 -0
- data/docs/Template.md +1 -0
- data/docs/TemplatesdesccachedUploadTemplate.md +25 -0
- data/docs/TemplatesdesccachedUploadTemplateDocument.md +10 -0
- data/docs/{Templatesv2TemplateDocumentMetadata.md → TemplatesdesccachedUploadTemplateDocumentMetadata.md} +1 -1
- data/docs/{Templatesv2Template.md → TemplatestemplateIdTemplate.md} +10 -6
- data/docs/UpdateTemplateData.md +8 -0
- data/docs/UpdateTemplateResponse.md +9 -0
- data/docspring.gemspec +1 -1
- data/lib/docspring.rb +7 -3
- data/lib/docspring/api/pdf_api.rb +128 -16
- data/lib/docspring/models/combined_submission.rb +10 -1
- data/lib/docspring/models/create_template_data.rb +1 -1
- data/lib/docspring/models/create_template_data1.rb +188 -0
- data/lib/docspring/models/pending_template.rb +10 -1
- data/lib/docspring/models/submission.rb +12 -3
- data/lib/docspring/models/submission_data.rb +10 -1
- data/lib/docspring/models/submission_data_request.rb +22 -4
- data/lib/docspring/models/template.rb +10 -1
- data/lib/docspring/models/templatesdesccached_upload_template.rb +382 -0
- data/lib/docspring/models/{templatesv2_template_document.rb → templatesdesccached_upload_template_document.rb} +2 -2
- data/lib/docspring/models/{templatesv2_template_document_metadata.rb → templatesdesccached_upload_template_document_metadata.rb} +1 -1
- data/lib/docspring/models/{templatesv2_template.rb → templatestemplate_id_template.rb} +77 -41
- data/lib/docspring/models/update_template_data.rb +188 -0
- data/lib/docspring/models/update_template_response.rb +228 -0
- data/lib/docspring/version.rb +1 -1
- data/spec/api/client_integration_spec.rb +14 -2
- data/spec/api/pdf_api_spec_original.skipped.rb +33 -7
- data/spec/models/combined_submission_spec.rb +6 -0
- data/spec/models/create_template_data1_spec.rb +41 -0
- data/spec/models/pending_template_spec.rb +6 -0
- data/spec/models/submission_data_request_spec.rb +12 -0
- data/spec/models/submission_data_spec.rb +6 -0
- data/spec/models/submission_spec.rb +7 -1
- data/spec/models/template_spec.rb +6 -0
- data/spec/models/{templatesv2_template_document_metadata_spec.rb → templatesdesccached_upload_template_document_metadata_spec.rb} +6 -6
- data/spec/models/{templatesv2_template_document_spec.rb → templatesdesccached_upload_template_document_spec.rb} +6 -6
- data/spec/models/templatesdesccached_upload_template_spec.rb +151 -0
- data/spec/models/{templatesv2_template_spec.rb → templatestemplate_id_template_spec.rb} +39 -15
- data/spec/models/update_template_data_spec.rb +41 -0
- data/spec/models/update_template_response_spec.rb +51 -0
- metadata +39 -27
- data/.swagger-codegen-ignore +0 -31
- data/.swagger-codegen/VERSION +0 -1
- data/.swagger-revision +0 -1
- data/.travis.yml +0 -8
- data/docs/Templatesv2TemplateDocument.md +0 -10
data/docs/PendingTemplate.md
CHANGED
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
|
|
8
8
|
**parent_folder_id** | **String** | | [optional]
|
9
9
|
**expire_after** | **Float** | | [optional]
|
10
10
|
**allow_additional_properties** | **BOOLEAN** | | [optional]
|
11
|
+
**description** | **String** | | [optional]
|
11
12
|
**public_submissions** | **BOOLEAN** | | [optional]
|
12
13
|
**slack_webhook_url** | **String** | | [optional]
|
13
14
|
**path** | **String** | | [optional]
|
data/docs/Submission.md
CHANGED
@@ -12,6 +12,7 @@ Name | Type | Description | Notes
|
|
12
12
|
**processed_at** | **String** | | [optional]
|
13
13
|
**state** | **String** | |
|
14
14
|
**metadata** | **Object** | | [optional]
|
15
|
+
**pdf_hash** | **String** | | [optional]
|
15
16
|
**download_url** | **String** | | [optional]
|
16
17
|
**permanent_download_url** | **String** | | [optional]
|
17
18
|
**batch_id** | **String** | | [optional]
|
data/docs/SubmissionData.md
CHANGED
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
|
|
8
8
|
**html** | **String** | | [optional]
|
9
9
|
**css** | **String** | | [optional]
|
10
10
|
**metadata** | **Object** | | [optional]
|
11
|
+
**field_overrides** | **Object** | | [optional]
|
11
12
|
**data_requests** | [**Array<CreateSubmissionDataRequestData>**](CreateSubmissionDataRequestData.md) | | [optional]
|
12
13
|
|
13
14
|
|
@@ -20,5 +20,7 @@ Name | Type | Description | Notes
|
|
20
20
|
**auth_user_id_hash** | **String** | | [optional]
|
21
21
|
**auth_username_hash** | **String** | | [optional]
|
22
22
|
**auth_phone_number_hash** | **String** | | [optional]
|
23
|
+
**ip_address** | **String** | | [optional]
|
24
|
+
**user_agent** | **String** | | [optional]
|
23
25
|
|
24
26
|
|
data/docs/Template.md
CHANGED
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
|
|
8
8
|
**parent_folder_id** | **String** | | [optional]
|
9
9
|
**expire_after** | **Float** | | [optional]
|
10
10
|
**allow_additional_properties** | **BOOLEAN** | | [optional]
|
11
|
+
**description** | **String** | | [optional]
|
11
12
|
**public_submissions** | **BOOLEAN** | | [optional]
|
12
13
|
**slack_webhook_url** | **String** | | [optional]
|
13
14
|
**path** | **String** | | [optional]
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# DocSpring::TemplatesdesccachedUploadTemplate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**expiration_interval** | **String** | | [optional]
|
7
|
+
**webhook_url** | **String** | | [optional]
|
8
|
+
**scss** | **String** | | [optional]
|
9
|
+
**expire_after** | **Float** | | [optional]
|
10
|
+
**allow_additional_properties** | **BOOLEAN** | | [optional]
|
11
|
+
**document** | [**TemplatesdesccachedUploadTemplateDocument**](TemplatesdesccachedUploadTemplateDocument.md) | | [optional]
|
12
|
+
**description** | **String** | | [optional]
|
13
|
+
**public_submissions** | **BOOLEAN** | | [optional]
|
14
|
+
**slack_webhook_url** | **String** | | [optional]
|
15
|
+
**header_html** | **String** | | [optional]
|
16
|
+
**public_web_form** | **BOOLEAN** | | [optional]
|
17
|
+
**editable_submissions** | **BOOLEAN** | | [optional]
|
18
|
+
**expire_submissions** | **BOOLEAN** | | [optional]
|
19
|
+
**name** | **String** | | [optional]
|
20
|
+
**html** | **String** | | [optional]
|
21
|
+
**footer_html** | **String** | | [optional]
|
22
|
+
**template_type** | **String** | | [optional]
|
23
|
+
**redirect_url** | **String** | | [optional]
|
24
|
+
|
25
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# DocSpring::TemplatesdesccachedUploadTemplateDocument
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**metadata** | [**TemplatesdesccachedUploadTemplateDocumentMetadata**](TemplatesdesccachedUploadTemplateDocumentMetadata.md) | | [optional]
|
7
|
+
**id** | **String** | | [optional]
|
8
|
+
**storage** | **String** | | [optional]
|
9
|
+
|
10
|
+
|
@@ -1,19 +1,23 @@
|
|
1
|
-
# DocSpring::
|
1
|
+
# DocSpring::TemplatestemplateIdTemplate
|
2
2
|
|
3
3
|
## Properties
|
4
4
|
Name | Type | Description | Notes
|
5
5
|
------------ | ------------- | ------------- | -------------
|
6
6
|
**expiration_interval** | **String** | | [optional]
|
7
|
-
**public_web_form** | **BOOLEAN** | | [optional]
|
8
7
|
**webhook_url** | **String** | | [optional]
|
9
|
-
**
|
10
|
-
**expire_submissions** | **BOOLEAN** | | [optional]
|
8
|
+
**scss** | **String** | | [optional]
|
11
9
|
**expire_after** | **Float** | | [optional]
|
12
10
|
**allow_additional_properties** | **BOOLEAN** | | [optional]
|
13
|
-
**
|
14
|
-
**name** | **String** | | [optional]
|
11
|
+
**description** | **String** | | [optional]
|
15
12
|
**public_submissions** | **BOOLEAN** | | [optional]
|
16
13
|
**slack_webhook_url** | **String** | | [optional]
|
14
|
+
**header_html** | **String** | | [optional]
|
15
|
+
**public_web_form** | **BOOLEAN** | | [optional]
|
16
|
+
**editable_submissions** | **BOOLEAN** | | [optional]
|
17
|
+
**expire_submissions** | **BOOLEAN** | | [optional]
|
18
|
+
**name** | **String** | | [optional]
|
19
|
+
**html** | **String** | | [optional]
|
20
|
+
**footer_html** | **String** | | [optional]
|
17
21
|
**redirect_url** | **String** | | [optional]
|
18
22
|
|
19
23
|
|
data/docspring.gemspec
CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
|
38
38
|
s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
|
39
39
|
s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
|
40
|
-
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.
|
40
|
+
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.15'
|
41
41
|
|
42
42
|
# Use git ls-files to ignore anything in .gitignore
|
43
43
|
s.files = `git ls-files`.split("\n").uniq.sort.select{|f| !f.empty? }
|
data/lib/docspring.rb
CHANGED
@@ -34,6 +34,7 @@ require 'docspring/models/create_submission_data_request_token_response'
|
|
34
34
|
require 'docspring/models/create_submission_data_request_token_response_token'
|
35
35
|
require 'docspring/models/create_submission_response'
|
36
36
|
require 'docspring/models/create_template_data'
|
37
|
+
require 'docspring/models/create_template_data1'
|
37
38
|
require 'docspring/models/custom_file'
|
38
39
|
require 'docspring/models/error'
|
39
40
|
require 'docspring/models/folder'
|
@@ -51,11 +52,14 @@ require 'docspring/models/submission_data'
|
|
51
52
|
require 'docspring/models/submission_data_batch_request'
|
52
53
|
require 'docspring/models/submission_data_request'
|
53
54
|
require 'docspring/models/template'
|
54
|
-
require 'docspring/models/
|
55
|
-
require 'docspring/models/
|
56
|
-
require 'docspring/models/
|
55
|
+
require 'docspring/models/templatesdesccached_upload_template'
|
56
|
+
require 'docspring/models/templatesdesccached_upload_template_document'
|
57
|
+
require 'docspring/models/templatesdesccached_upload_template_document_metadata'
|
58
|
+
require 'docspring/models/templatestemplate_id_template'
|
57
59
|
require 'docspring/models/update_data_request_response'
|
58
60
|
require 'docspring/models/update_submission_data_request_data'
|
61
|
+
require 'docspring/models/update_template_data'
|
62
|
+
require 'docspring/models/update_template_response'
|
59
63
|
|
60
64
|
# APIs
|
61
65
|
require 'docspring/api/pdf_api'
|
@@ -394,34 +394,87 @@ module DocSpring
|
|
394
394
|
return data, status_code, headers
|
395
395
|
end
|
396
396
|
|
397
|
-
#
|
397
|
+
# Create a new HTML template
|
398
|
+
# @param create_template_data1
|
399
|
+
# @param [Hash] opts the optional parameters
|
400
|
+
# @return [PendingTemplate]
|
401
|
+
def create_html_template(create_template_data1, opts = {})
|
402
|
+
data, _status_code, _headers = create_html_template_with_http_info(create_template_data1, opts)
|
403
|
+
data
|
404
|
+
end
|
405
|
+
|
406
|
+
# Create a new HTML template
|
407
|
+
# @param create_template_data1
|
408
|
+
# @param [Hash] opts the optional parameters
|
409
|
+
# @return [Array<(PendingTemplate, Fixnum, Hash)>] PendingTemplate data, response status code and response headers
|
410
|
+
def create_html_template_with_http_info(create_template_data1, opts = {})
|
411
|
+
if @api_client.config.debugging
|
412
|
+
@api_client.config.logger.debug 'Calling API: PDFApi.create_html_template ...'
|
413
|
+
end
|
414
|
+
# verify the required parameter 'create_template_data1' is set
|
415
|
+
if @api_client.config.client_side_validation && create_template_data1.nil?
|
416
|
+
fail ArgumentError, "Missing the required parameter 'create_template_data1' when calling PDFApi.create_html_template"
|
417
|
+
end
|
418
|
+
# resource path
|
419
|
+
local_var_path = '/templates?desc=html'
|
420
|
+
|
421
|
+
# query parameters
|
422
|
+
query_params = {}
|
423
|
+
|
424
|
+
# header parameters
|
425
|
+
header_params = {}
|
426
|
+
# HTTP header 'Accept' (if needed)
|
427
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
428
|
+
# HTTP header 'Content-Type'
|
429
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
430
|
+
|
431
|
+
# form parameters
|
432
|
+
form_params = {}
|
433
|
+
|
434
|
+
# http body (model)
|
435
|
+
post_body = @api_client.object_to_http_body(create_template_data1)
|
436
|
+
auth_names = ['api_token_basic']
|
437
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
438
|
+
:header_params => header_params,
|
439
|
+
:query_params => query_params,
|
440
|
+
:form_params => form_params,
|
441
|
+
:body => post_body,
|
442
|
+
:auth_names => auth_names,
|
443
|
+
:return_type => 'PendingTemplate')
|
444
|
+
if @api_client.config.debugging
|
445
|
+
@api_client.config.logger.debug "API called: PDFApi#create_html_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
446
|
+
end
|
447
|
+
return data, status_code, headers
|
448
|
+
end
|
449
|
+
|
450
|
+
# Create a new PDF template with a form POST file upload
|
398
451
|
# @param template_document
|
399
452
|
# @param template_name
|
400
453
|
# @param [Hash] opts the optional parameters
|
401
454
|
# @option opts [String] :template_parent_folder_id
|
402
455
|
# @return [PendingTemplate]
|
403
|
-
def
|
404
|
-
data, _status_code, _headers =
|
456
|
+
def create_pdf_template(template_document, template_name, opts = {})
|
457
|
+
data, _status_code, _headers = create_pdf_template_with_http_info(template_document, template_name, opts)
|
405
458
|
data
|
406
459
|
end
|
407
460
|
|
408
|
-
#
|
461
|
+
# Create a new PDF template with a form POST file upload
|
409
462
|
# @param template_document
|
410
463
|
# @param template_name
|
411
464
|
# @param [Hash] opts the optional parameters
|
412
465
|
# @option opts [String] :template_parent_folder_id
|
413
466
|
# @return [Array<(PendingTemplate, Fixnum, Hash)>] PendingTemplate data, response status code and response headers
|
414
|
-
def
|
467
|
+
def create_pdf_template_with_http_info(template_document, template_name, opts = {})
|
415
468
|
if @api_client.config.debugging
|
416
|
-
@api_client.config.logger.debug 'Calling API: PDFApi.
|
469
|
+
@api_client.config.logger.debug 'Calling API: PDFApi.create_pdf_template ...'
|
417
470
|
end
|
418
471
|
# verify the required parameter 'template_document' is set
|
419
472
|
if @api_client.config.client_side_validation && template_document.nil?
|
420
|
-
fail ArgumentError, "Missing the required parameter 'template_document' when calling PDFApi.
|
473
|
+
fail ArgumentError, "Missing the required parameter 'template_document' when calling PDFApi.create_pdf_template"
|
421
474
|
end
|
422
475
|
# verify the required parameter 'template_name' is set
|
423
476
|
if @api_client.config.client_side_validation && template_name.nil?
|
424
|
-
fail ArgumentError, "Missing the required parameter 'template_name' when calling PDFApi.
|
477
|
+
fail ArgumentError, "Missing the required parameter 'template_name' when calling PDFApi.create_pdf_template"
|
425
478
|
end
|
426
479
|
# resource path
|
427
480
|
local_var_path = '/templates'
|
@@ -453,7 +506,7 @@ module DocSpring
|
|
453
506
|
:auth_names => auth_names,
|
454
507
|
:return_type => 'PendingTemplate')
|
455
508
|
if @api_client.config.debugging
|
456
|
-
@api_client.config.logger.debug "API called: PDFApi#
|
509
|
+
@api_client.config.logger.debug "API called: PDFApi#create_pdf_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
457
510
|
end
|
458
511
|
return data, status_code, headers
|
459
512
|
end
|
@@ -462,8 +515,8 @@ module DocSpring
|
|
462
515
|
# @param create_template_data
|
463
516
|
# @param [Hash] opts the optional parameters
|
464
517
|
# @return [PendingTemplate]
|
465
|
-
def
|
466
|
-
data, _status_code, _headers =
|
518
|
+
def create_pdf_template_from_upload(create_template_data, opts = {})
|
519
|
+
data, _status_code, _headers = create_pdf_template_from_upload_with_http_info(create_template_data, opts)
|
467
520
|
data
|
468
521
|
end
|
469
522
|
|
@@ -471,16 +524,16 @@ module DocSpring
|
|
471
524
|
# @param create_template_data
|
472
525
|
# @param [Hash] opts the optional parameters
|
473
526
|
# @return [Array<(PendingTemplate, Fixnum, Hash)>] PendingTemplate data, response status code and response headers
|
474
|
-
def
|
527
|
+
def create_pdf_template_from_upload_with_http_info(create_template_data, opts = {})
|
475
528
|
if @api_client.config.debugging
|
476
|
-
@api_client.config.logger.debug 'Calling API: PDFApi.
|
529
|
+
@api_client.config.logger.debug 'Calling API: PDFApi.create_pdf_template_from_upload ...'
|
477
530
|
end
|
478
531
|
# verify the required parameter 'create_template_data' is set
|
479
532
|
if @api_client.config.client_side_validation && create_template_data.nil?
|
480
|
-
fail ArgumentError, "Missing the required parameter 'create_template_data' when calling PDFApi.
|
533
|
+
fail ArgumentError, "Missing the required parameter 'create_template_data' when calling PDFApi.create_pdf_template_from_upload"
|
481
534
|
end
|
482
535
|
# resource path
|
483
|
-
local_var_path = '/templates?
|
536
|
+
local_var_path = '/templates?desc=cached_upload'
|
484
537
|
|
485
538
|
# query parameters
|
486
539
|
query_params = {}
|
@@ -506,7 +559,7 @@ module DocSpring
|
|
506
559
|
:auth_names => auth_names,
|
507
560
|
:return_type => 'PendingTemplate')
|
508
561
|
if @api_client.config.debugging
|
509
|
-
@api_client.config.logger.debug "API called: PDFApi#
|
562
|
+
@api_client.config.logger.debug "API called: PDFApi#create_pdf_template_from_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
510
563
|
end
|
511
564
|
return data, status_code, headers
|
512
565
|
end
|
@@ -1477,5 +1530,64 @@ module DocSpring
|
|
1477
1530
|
return data, status_code, headers
|
1478
1531
|
end
|
1479
1532
|
|
1533
|
+
# Update a Template
|
1534
|
+
# @param template_id
|
1535
|
+
# @param update_template_data
|
1536
|
+
# @param [Hash] opts the optional parameters
|
1537
|
+
# @return [UpdateTemplateResponse]
|
1538
|
+
def update_template(template_id, update_template_data, opts = {})
|
1539
|
+
data, _status_code, _headers = update_template_with_http_info(template_id, update_template_data, opts)
|
1540
|
+
data
|
1541
|
+
end
|
1542
|
+
|
1543
|
+
# Update a Template
|
1544
|
+
# @param template_id
|
1545
|
+
# @param update_template_data
|
1546
|
+
# @param [Hash] opts the optional parameters
|
1547
|
+
# @return [Array<(UpdateTemplateResponse, Fixnum, Hash)>] UpdateTemplateResponse data, response status code and response headers
|
1548
|
+
def update_template_with_http_info(template_id, update_template_data, opts = {})
|
1549
|
+
if @api_client.config.debugging
|
1550
|
+
@api_client.config.logger.debug 'Calling API: PDFApi.update_template ...'
|
1551
|
+
end
|
1552
|
+
# verify the required parameter 'template_id' is set
|
1553
|
+
if @api_client.config.client_side_validation && template_id.nil?
|
1554
|
+
fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.update_template"
|
1555
|
+
end
|
1556
|
+
# verify the required parameter 'update_template_data' is set
|
1557
|
+
if @api_client.config.client_side_validation && update_template_data.nil?
|
1558
|
+
fail ArgumentError, "Missing the required parameter 'update_template_data' when calling PDFApi.update_template"
|
1559
|
+
end
|
1560
|
+
# resource path
|
1561
|
+
local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)
|
1562
|
+
|
1563
|
+
# query parameters
|
1564
|
+
query_params = {}
|
1565
|
+
|
1566
|
+
# header parameters
|
1567
|
+
header_params = {}
|
1568
|
+
# HTTP header 'Accept' (if needed)
|
1569
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1570
|
+
# HTTP header 'Content-Type'
|
1571
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1572
|
+
|
1573
|
+
# form parameters
|
1574
|
+
form_params = {}
|
1575
|
+
|
1576
|
+
# http body (model)
|
1577
|
+
post_body = @api_client.object_to_http_body(update_template_data)
|
1578
|
+
auth_names = ['api_token_basic']
|
1579
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
1580
|
+
:header_params => header_params,
|
1581
|
+
:query_params => query_params,
|
1582
|
+
:form_params => form_params,
|
1583
|
+
:body => post_body,
|
1584
|
+
:auth_names => auth_names,
|
1585
|
+
:return_type => 'UpdateTemplateResponse')
|
1586
|
+
if @api_client.config.debugging
|
1587
|
+
@api_client.config.logger.debug "API called: PDFApi#update_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1588
|
+
end
|
1589
|
+
return data, status_code, headers
|
1590
|
+
end
|
1591
|
+
|
1480
1592
|
end
|
1481
1593
|
end
|
@@ -22,6 +22,8 @@ module DocSpring
|
|
22
22
|
|
23
23
|
attr_accessor :source_pdfs
|
24
24
|
|
25
|
+
attr_accessor :pdf_hash
|
26
|
+
|
25
27
|
attr_accessor :download_url
|
26
28
|
|
27
29
|
attr_accessor :submission_ids
|
@@ -61,6 +63,7 @@ module DocSpring
|
|
61
63
|
:'expired' => :'expired',
|
62
64
|
:'expires_at' => :'expires_at',
|
63
65
|
:'source_pdfs' => :'source_pdfs',
|
66
|
+
:'pdf_hash' => :'pdf_hash',
|
64
67
|
:'download_url' => :'download_url',
|
65
68
|
:'submission_ids' => :'submission_ids',
|
66
69
|
:'id' => :'id',
|
@@ -76,6 +79,7 @@ module DocSpring
|
|
76
79
|
:'expired' => :'BOOLEAN',
|
77
80
|
:'expires_at' => :'String',
|
78
81
|
:'source_pdfs' => :'Array<Object>',
|
82
|
+
:'pdf_hash' => :'String',
|
79
83
|
:'download_url' => :'String',
|
80
84
|
:'submission_ids' => :'Array<String>',
|
81
85
|
:'id' => :'String',
|
@@ -110,6 +114,10 @@ module DocSpring
|
|
110
114
|
end
|
111
115
|
end
|
112
116
|
|
117
|
+
if attributes.has_key?(:'pdf_hash')
|
118
|
+
self.pdf_hash = attributes[:'pdf_hash']
|
119
|
+
end
|
120
|
+
|
113
121
|
if attributes.has_key?(:'download_url')
|
114
122
|
self.download_url = attributes[:'download_url']
|
115
123
|
end
|
@@ -169,6 +177,7 @@ module DocSpring
|
|
169
177
|
expired == o.expired &&
|
170
178
|
expires_at == o.expires_at &&
|
171
179
|
source_pdfs == o.source_pdfs &&
|
180
|
+
pdf_hash == o.pdf_hash &&
|
172
181
|
download_url == o.download_url &&
|
173
182
|
submission_ids == o.submission_ids &&
|
174
183
|
id == o.id &&
|
@@ -185,7 +194,7 @@ module DocSpring
|
|
185
194
|
# Calculates hash code according to all attributes.
|
186
195
|
# @return [Fixnum] Hash code
|
187
196
|
def hash
|
188
|
-
[metadata, expired, expires_at, source_pdfs, download_url, submission_ids, id, state, actions].hash
|
197
|
+
[metadata, expired, expires_at, source_pdfs, pdf_hash, download_url, submission_ids, id, state, actions].hash
|
189
198
|
end
|
190
199
|
|
191
200
|
# Builds the object from hash
|
@@ -0,0 +1,188 @@
|
|
1
|
+
=begin
|
2
|
+
#API v1
|
3
|
+
|
4
|
+
#DocSpring is a service that helps you fill out and sign PDF templates.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 3.3.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module DocSpring
|
16
|
+
class CreateTemplateData1
|
17
|
+
attr_accessor :template
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'template' => :'template'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.openapi_types
|
28
|
+
{
|
29
|
+
:'template' => :'TemplatesdesccachedUploadTemplate'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
+
|
41
|
+
if attributes.has_key?(:'template')
|
42
|
+
self.template = attributes[:'template']
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
47
|
+
# @return Array for valid properties with the reasons
|
48
|
+
def list_invalid_properties
|
49
|
+
invalid_properties = Array.new
|
50
|
+
if @template.nil?
|
51
|
+
invalid_properties.push('invalid value for "template", template cannot be nil.')
|
52
|
+
end
|
53
|
+
|
54
|
+
invalid_properties
|
55
|
+
end
|
56
|
+
|
57
|
+
# Check to see if the all the properties in the model are valid
|
58
|
+
# @return true if the model is valid
|
59
|
+
def valid?
|
60
|
+
return false if @template.nil?
|
61
|
+
true
|
62
|
+
end
|
63
|
+
|
64
|
+
# Checks equality by comparing each attribute.
|
65
|
+
# @param [Object] Object to be compared
|
66
|
+
def ==(o)
|
67
|
+
return true if self.equal?(o)
|
68
|
+
self.class == o.class &&
|
69
|
+
template == o.template
|
70
|
+
end
|
71
|
+
|
72
|
+
# @see the `==` method
|
73
|
+
# @param [Object] Object to be compared
|
74
|
+
def eql?(o)
|
75
|
+
self == o
|
76
|
+
end
|
77
|
+
|
78
|
+
# Calculates hash code according to all attributes.
|
79
|
+
# @return [Fixnum] Hash code
|
80
|
+
def hash
|
81
|
+
[template].hash
|
82
|
+
end
|
83
|
+
|
84
|
+
# Builds the object from hash
|
85
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
86
|
+
# @return [Object] Returns the model itself
|
87
|
+
def build_from_hash(attributes)
|
88
|
+
return nil unless attributes.is_a?(Hash)
|
89
|
+
self.class.openapi_types.each_pair do |key, type|
|
90
|
+
if type =~ /\AArray<(.*)>/i
|
91
|
+
# check to ensure the input is an array given that the the attribute
|
92
|
+
# is documented as an array but the input is not
|
93
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
94
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
95
|
+
end
|
96
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
97
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
98
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
99
|
+
end
|
100
|
+
|
101
|
+
self
|
102
|
+
end
|
103
|
+
|
104
|
+
# Deserializes the data based on type
|
105
|
+
# @param string type Data type
|
106
|
+
# @param string value Value to be deserialized
|
107
|
+
# @return [Object] Deserialized data
|
108
|
+
def _deserialize(type, value)
|
109
|
+
case type.to_sym
|
110
|
+
when :DateTime
|
111
|
+
DateTime.parse(value)
|
112
|
+
when :Date
|
113
|
+
Date.parse(value)
|
114
|
+
when :String
|
115
|
+
value.to_s
|
116
|
+
when :Integer
|
117
|
+
value.to_i
|
118
|
+
when :Float
|
119
|
+
value.to_f
|
120
|
+
when :BOOLEAN
|
121
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
122
|
+
true
|
123
|
+
else
|
124
|
+
false
|
125
|
+
end
|
126
|
+
when :Object
|
127
|
+
# generic object (usually a Hash), return directly
|
128
|
+
value
|
129
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
130
|
+
inner_type = Regexp.last_match[:inner_type]
|
131
|
+
value.map { |v| _deserialize(inner_type, v) }
|
132
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
133
|
+
k_type = Regexp.last_match[:k_type]
|
134
|
+
v_type = Regexp.last_match[:v_type]
|
135
|
+
{}.tap do |hash|
|
136
|
+
value.each do |k, v|
|
137
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
else # model
|
141
|
+
temp_model = DocSpring.const_get(type).new
|
142
|
+
temp_model.build_from_hash(value)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
# Returns the string representation of the object
|
147
|
+
# @return [String] String presentation of the object
|
148
|
+
def to_s
|
149
|
+
to_hash.to_s
|
150
|
+
end
|
151
|
+
|
152
|
+
# to_body is an alias to to_hash (backward compatibility)
|
153
|
+
# @return [Hash] Returns the object in the form of hash
|
154
|
+
def to_body
|
155
|
+
to_hash
|
156
|
+
end
|
157
|
+
|
158
|
+
# Returns the object in the form of hash
|
159
|
+
# @return [Hash] Returns the object in the form of hash
|
160
|
+
def to_hash
|
161
|
+
hash = {}
|
162
|
+
self.class.attribute_map.each_pair do |attr, param|
|
163
|
+
value = self.send(attr)
|
164
|
+
next if value.nil?
|
165
|
+
hash[param] = _to_hash(value)
|
166
|
+
end
|
167
|
+
hash
|
168
|
+
end
|
169
|
+
|
170
|
+
# Outputs non-array value in the form of hash
|
171
|
+
# For object, use to_hash. Otherwise, just return the value
|
172
|
+
# @param [Object] value Any valid value
|
173
|
+
# @return [Hash] Returns the value in the form of hash
|
174
|
+
def _to_hash(value)
|
175
|
+
if value.is_a?(Array)
|
176
|
+
value.compact.map { |v| _to_hash(v) }
|
177
|
+
elsif value.is_a?(Hash)
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
180
|
+
end
|
181
|
+
elsif value.respond_to? :to_hash
|
182
|
+
value.to_hash
|
183
|
+
else
|
184
|
+
value
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|