docspring 1.0.0 → 1.3.1

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 (144) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/VERSION +1 -1
  3. data/CHANGELOG.md +14 -37
  4. data/Gemfile +2 -1
  5. data/Gemfile.lock +37 -32
  6. data/LICENSE +1 -1
  7. data/README.md +26 -15
  8. data/docs/AddFieldsData.md +8 -0
  9. data/docs/AddFieldsTemplateResponse.md +10 -0
  10. data/docs/CombinePdfsData.md +4 -4
  11. data/docs/CombinedSubmission.md +1 -0
  12. data/docs/CombinedSubmissionData.md +3 -3
  13. data/docs/{CreateTemplateData.md → CreateHtmlTemplateData.md} +2 -2
  14. data/docs/CreateSubmissionDataRequestData.md +2 -2
  15. data/docs/CreateTemplateFromUploadData.md +8 -0
  16. data/docs/HtmlTemplateData.md +24 -0
  17. data/docs/PDFApi.md +169 -15
  18. data/docs/PendingTemplate.md +2 -0
  19. data/docs/Submission.md +5 -0
  20. data/docs/SubmissionBatchData.md +2 -2
  21. data/docs/SubmissionData.md +4 -3
  22. data/docs/SubmissionDataBatchRequest.md +2 -2
  23. data/docs/SubmissionDataRequest.md +2 -0
  24. data/docs/Template.md +2 -0
  25. data/docs/{Templatesv2Template.md → TemplateData.md} +11 -7
  26. data/docs/TemplatestemplateIdaddFieldsFields.md +92 -0
  27. data/docs/UpdateSubmissionDataRequestData.md +9 -9
  28. data/docs/UpdateTemplateData.md +8 -0
  29. data/docs/UpdateTemplateResponse.md +9 -0
  30. data/docs/UploadTemplateData.md +25 -0
  31. data/docs/{Templatesv2TemplateDocument.md → UploadTemplateDataDocument.md} +2 -2
  32. data/docs/{Templatesv2TemplateDocumentMetadata.md → UploadTemplateDataDocumentMetadata.md} +1 -1
  33. data/docspring.gemspec +3 -3
  34. data/lib/docspring.rb +13 -5
  35. data/lib/docspring/api/pdf_api.rb +193 -22
  36. data/lib/docspring/api_client.rb +1 -1
  37. data/lib/docspring/api_error.rb +1 -1
  38. data/lib/docspring/configuration.rb +1 -1
  39. data/lib/docspring/models/add_fields_data.rb +190 -0
  40. data/lib/docspring/models/add_fields_template_response.rb +239 -0
  41. data/lib/docspring/models/authentication_error.rb +1 -1
  42. data/lib/docspring/models/authentication_success_response.rb +1 -1
  43. data/lib/docspring/models/combine_pdfs_data.rb +28 -28
  44. data/lib/docspring/models/combined_submission.rb +11 -2
  45. data/lib/docspring/models/combined_submission_action.rb +1 -6
  46. data/lib/docspring/models/combined_submission_data.rb +23 -23
  47. data/lib/docspring/models/create_combined_submission_response.rb +1 -1
  48. data/lib/docspring/models/create_custom_file_data.rb +1 -1
  49. data/lib/docspring/models/create_custom_file_response.rb +1 -1
  50. data/lib/docspring/models/create_folder_data.rb +1 -1
  51. data/lib/docspring/models/{create_template_data.rb → create_html_template_data.rb} +3 -3
  52. data/lib/docspring/models/create_submission_batch_response.rb +1 -1
  53. data/lib/docspring/models/create_submission_batch_submissions_response.rb +1 -1
  54. data/lib/docspring/models/create_submission_data_request_data.rb +20 -20
  55. data/lib/docspring/models/create_submission_data_request_token_response.rb +1 -1
  56. data/lib/docspring/models/create_submission_data_request_token_response_token.rb +1 -1
  57. data/lib/docspring/models/create_submission_response.rb +1 -1
  58. data/lib/docspring/models/create_template_from_upload_data.rb +188 -0
  59. data/lib/docspring/models/custom_file.rb +1 -1
  60. data/lib/docspring/models/error.rb +1 -1
  61. data/lib/docspring/models/folder.rb +1 -1
  62. data/lib/docspring/models/folders_folder.rb +1 -1
  63. data/lib/docspring/models/html_template_data.rb +373 -0
  64. data/lib/docspring/models/invalid_request.rb +1 -1
  65. data/lib/docspring/models/move_folder_data.rb +1 -1
  66. data/lib/docspring/models/move_template_data.rb +1 -1
  67. data/lib/docspring/models/pending_template.rb +20 -2
  68. data/lib/docspring/models/rename_folder_data.rb +1 -1
  69. data/lib/docspring/models/submission.rb +52 -7
  70. data/lib/docspring/models/submission_action.rb +1 -6
  71. data/lib/docspring/models/submission_batch.rb +1 -1
  72. data/lib/docspring/models/submission_batch_data.rb +16 -16
  73. data/lib/docspring/models/submission_data.rb +34 -25
  74. data/lib/docspring/models/submission_data_batch_request.rb +20 -20
  75. data/lib/docspring/models/submission_data_request.rb +23 -20
  76. data/lib/docspring/models/template.rb +20 -2
  77. data/lib/docspring/models/{templatesv2_template.rb → template_data.rb} +81 -45
  78. data/lib/docspring/models/templatestemplate_idadd_fields_fields.rb +1306 -0
  79. data/lib/docspring/models/update_data_request_response.rb +1 -1
  80. data/lib/docspring/models/update_submission_data_request_data.rb +79 -79
  81. data/lib/docspring/models/update_template_data.rb +188 -0
  82. data/lib/docspring/models/update_template_response.rb +228 -0
  83. data/lib/docspring/models/upload_template_data.rb +382 -0
  84. data/lib/docspring/models/{templatesv2_template_document.rb → upload_template_data_document.rb} +3 -3
  85. data/lib/docspring/models/{templatesv2_template_document_metadata.rb → upload_template_data_document_metadata.rb} +2 -2
  86. data/lib/docspring/version.rb +2 -2
  87. data/spec/api/client_integration_spec.rb +14 -2
  88. data/spec/api/pdf_api_integration_spec.rb +49 -18
  89. data/spec/api/pdf_api_spec_original.skipped.rb +51 -11
  90. data/spec/api_client_spec.rb +1 -1
  91. data/spec/configuration_spec.rb +1 -1
  92. data/spec/models/add_fields_data_spec.rb +41 -0
  93. data/spec/models/add_fields_template_response_spec.rb +57 -0
  94. data/spec/models/authentication_error_spec.rb +1 -1
  95. data/spec/models/authentication_success_response_spec.rb +1 -1
  96. data/spec/models/combine_pdfs_data_spec.rb +5 -5
  97. data/spec/models/combined_submission_action_spec.rb +1 -1
  98. data/spec/models/combined_submission_data_spec.rb +5 -5
  99. data/spec/models/combined_submission_spec.rb +7 -1
  100. data/spec/models/create_combined_submission_response_spec.rb +1 -1
  101. data/spec/models/create_custom_file_data_spec.rb +1 -1
  102. data/spec/models/create_custom_file_response_spec.rb +1 -1
  103. data/spec/models/create_folder_data_spec.rb +1 -1
  104. data/spec/models/create_html_template_data_spec.rb +41 -0
  105. data/spec/models/create_submission_batch_response_spec.rb +1 -1
  106. data/spec/models/create_submission_batch_submissions_response_spec.rb +1 -1
  107. data/spec/models/create_submission_data_request_data_spec.rb +9 -9
  108. data/spec/models/create_submission_data_request_token_response_spec.rb +1 -1
  109. data/spec/models/create_submission_data_request_token_response_token_spec.rb +1 -1
  110. data/spec/models/create_submission_response_spec.rb +1 -1
  111. data/spec/models/{create_template_data_spec.rb → create_template_from_upload_data_spec.rb} +7 -7
  112. data/spec/models/custom_file_spec.rb +1 -1
  113. data/spec/models/error_spec.rb +1 -1
  114. data/spec/models/folder_spec.rb +1 -1
  115. data/spec/models/folders_folder_spec.rb +1 -1
  116. data/spec/models/html_template_data_spec.rb +145 -0
  117. data/spec/models/invalid_request_spec.rb +1 -1
  118. data/spec/models/move_folder_data_spec.rb +1 -1
  119. data/spec/models/move_template_data_spec.rb +1 -1
  120. data/spec/models/pending_template_spec.rb +13 -1
  121. data/spec/models/rename_folder_data_spec.rb +1 -1
  122. data/spec/models/submission_action_spec.rb +1 -1
  123. data/spec/models/submission_batch_data_spec.rb +3 -3
  124. data/spec/models/submission_batch_spec.rb +1 -1
  125. data/spec/models/submission_data_batch_request_spec.rb +5 -5
  126. data/spec/models/submission_data_request_spec.rb +13 -1
  127. data/spec/models/submission_data_spec.rb +11 -5
  128. data/spec/models/submission_spec.rb +32 -2
  129. data/spec/models/{templatesv2_template_spec.rb → template_data_spec.rb} +40 -16
  130. data/spec/models/template_spec.rb +13 -1
  131. data/spec/models/templatestemplate_idadd_fields_fields_spec.rb +589 -0
  132. data/spec/models/update_data_request_response_spec.rb +1 -1
  133. data/spec/models/update_submission_data_request_data_spec.rb +17 -17
  134. data/spec/models/update_template_data_spec.rb +41 -0
  135. data/spec/models/update_template_response_spec.rb +51 -0
  136. data/spec/models/{templatesv2_template_document_metadata_spec.rb → upload_template_data_document_metadata_spec.rb} +7 -7
  137. data/spec/models/{templatesv2_template_document_spec.rb → upload_template_data_document_spec.rb} +7 -7
  138. data/spec/models/upload_template_data_spec.rb +151 -0
  139. data/spec/spec_helper.rb +1 -1
  140. metadata +60 -32
  141. data/.swagger-codegen-ignore +0 -31
  142. data/.swagger-codegen/VERSION +0 -1
  143. data/.swagger-revision +0 -1
  144. data/.travis.yml +0 -8
@@ -3,18 +3,18 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
- **name** | **String** | | [optional]
7
- **email** | **String** | | [optional]
8
- **order** | **Integer** | | [optional]
9
- **fields** | **Array<String>** | | [optional]
10
- **metadata** | **Object** | | [optional]
11
- **auth_type** | **String** | | [optional]
12
- **auth_second_factor_type** | **String** | | [optional]
6
+ **auth_phone_number_hash** | **String** | | [optional]
13
7
  **auth_provider** | **String** | | [optional]
14
- **auth_session_started_at** | **String** | | [optional]
8
+ **auth_second_factor_type** | **String** | | [optional]
15
9
  **auth_session_id_hash** | **String** | | [optional]
10
+ **auth_session_started_at** | **String** | | [optional]
11
+ **auth_type** | **String** | | [optional]
16
12
  **auth_user_id_hash** | **String** | | [optional]
17
13
  **auth_username_hash** | **String** | | [optional]
18
- **auth_phone_number_hash** | **String** | | [optional]
14
+ **email** | **String** | | [optional]
15
+ **fields** | **Array<String>** | | [optional]
16
+ **metadata** | **Object** | | [optional]
17
+ **name** | **String** | | [optional]
18
+ **order** | **Integer** | | [optional]
19
19
 
20
20
 
@@ -0,0 +1,8 @@
1
+ # DocSpring::UpdateTemplateData
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **template** | [**TemplateData**](TemplateData.md) | |
7
+
8
+
@@ -0,0 +1,9 @@
1
+ # DocSpring::UpdateTemplateResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **errors** | **Array<String>** | | [optional]
7
+ **status** | **String** | | [optional]
8
+
9
+
@@ -0,0 +1,25 @@
1
+ # DocSpring::UploadTemplateData
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **expiration_interval** | **String** | | [optional]
7
+ **webhook_url** | **String** | | [optional]
8
+ **scss** | **String** | | [optional]
9
+ **allow_additional_properties** | **BOOLEAN** | | [optional]
10
+ **document** | [**UploadTemplateDataDocument**](UploadTemplateDataDocument.md) | | [optional]
11
+ **expire_after** | **Float** | | [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
+ **footer_html** | **String** | | [optional]
21
+ **html** | **String** | | [optional]
22
+ **template_type** | **String** | | [optional]
23
+ **redirect_url** | **String** | | [optional]
24
+
25
+
@@ -1,9 +1,9 @@
1
- # DocSpring::Templatesv2TemplateDocument
1
+ # DocSpring::UploadTemplateDataDocument
2
2
 
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
- **metadata** | [**Templatesv2TemplateDocumentMetadata**](Templatesv2TemplateDocumentMetadata.md) | | [optional]
6
+ **metadata** | [**UploadTemplateDataDocumentMetadata**](UploadTemplateDataDocumentMetadata.md) | | [optional]
7
7
  **id** | **String** | | [optional]
8
8
  **storage** | **String** | | [optional]
9
9
 
@@ -1,4 +1,4 @@
1
- # DocSpring::Templatesv2TemplateDocumentMetadata
1
+ # DocSpring::UploadTemplateDataDocumentMetadata
2
2
 
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
@@ -8,7 +8,7 @@
8
8
  OpenAPI spec version: v1
9
9
 
10
10
  Generated by: https://openapi-generator.tech
11
- OpenAPI Generator version: 3.3.0-SNAPSHOT
11
+ OpenAPI Generator version: 3.3.0
12
12
 
13
13
  =end
14
14
 
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.name = "docspring"
20
20
  s.version = DocSpring::VERSION
21
21
  s.platform = Gem::Platform::RUBY
22
- s.authors = ["Form Applications, Inc."]
22
+ s.authors = ["DocSpring"]
23
23
  s.email = ["support@docspring.com"]
24
24
  s.homepage = "https://github.com/DocSpring/docspring-ruby"
25
25
  s.summary = "DocSpring API Client"
@@ -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.12'
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? }
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -17,6 +17,8 @@ require 'docspring/version'
17
17
  require 'docspring/configuration'
18
18
 
19
19
  # Models
20
+ require 'docspring/models/add_fields_data'
21
+ require 'docspring/models/add_fields_template_response'
20
22
  require 'docspring/models/authentication_error'
21
23
  require 'docspring/models/authentication_success_response'
22
24
  require 'docspring/models/combine_pdfs_data'
@@ -27,17 +29,19 @@ require 'docspring/models/create_combined_submission_response'
27
29
  require 'docspring/models/create_custom_file_data'
28
30
  require 'docspring/models/create_custom_file_response'
29
31
  require 'docspring/models/create_folder_data'
32
+ require 'docspring/models/create_html_template_data'
30
33
  require 'docspring/models/create_submission_batch_response'
31
34
  require 'docspring/models/create_submission_batch_submissions_response'
32
35
  require 'docspring/models/create_submission_data_request_data'
33
36
  require 'docspring/models/create_submission_data_request_token_response'
34
37
  require 'docspring/models/create_submission_data_request_token_response_token'
35
38
  require 'docspring/models/create_submission_response'
36
- require 'docspring/models/create_template_data'
39
+ require 'docspring/models/create_template_from_upload_data'
37
40
  require 'docspring/models/custom_file'
38
41
  require 'docspring/models/error'
39
42
  require 'docspring/models/folder'
40
43
  require 'docspring/models/folders_folder'
44
+ require 'docspring/models/html_template_data'
41
45
  require 'docspring/models/invalid_request'
42
46
  require 'docspring/models/move_folder_data'
43
47
  require 'docspring/models/move_template_data'
@@ -51,11 +55,15 @@ require 'docspring/models/submission_data'
51
55
  require 'docspring/models/submission_data_batch_request'
52
56
  require 'docspring/models/submission_data_request'
53
57
  require 'docspring/models/template'
54
- require 'docspring/models/templatesv2_template'
55
- require 'docspring/models/templatesv2_template_document'
56
- require 'docspring/models/templatesv2_template_document_metadata'
58
+ require 'docspring/models/template_data'
59
+ require 'docspring/models/templatestemplate_idadd_fields_fields'
57
60
  require 'docspring/models/update_data_request_response'
58
61
  require 'docspring/models/update_submission_data_request_data'
62
+ require 'docspring/models/update_template_data'
63
+ require 'docspring/models/update_template_response'
64
+ require 'docspring/models/upload_template_data'
65
+ require 'docspring/models/upload_template_data_document'
66
+ require 'docspring/models/upload_template_data_document_metadata'
59
67
 
60
68
  # APIs
61
69
  require 'docspring/api/pdf_api'
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -19,6 +19,65 @@ module DocSpring
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Add new fields to a Template
23
+ # @param template_id
24
+ # @param add_fields_data
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [AddFieldsTemplateResponse]
27
+ def add_fields_to_template(template_id, add_fields_data, opts = {})
28
+ data, _status_code, _headers = add_fields_to_template_with_http_info(template_id, add_fields_data, opts)
29
+ data
30
+ end
31
+
32
+ # Add new fields to a Template
33
+ # @param template_id
34
+ # @param add_fields_data
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(AddFieldsTemplateResponse, Fixnum, Hash)>] AddFieldsTemplateResponse data, response status code and response headers
37
+ def add_fields_to_template_with_http_info(template_id, add_fields_data, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: PDFApi.add_fields_to_template ...'
40
+ end
41
+ # verify the required parameter 'template_id' is set
42
+ if @api_client.config.client_side_validation && template_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.add_fields_to_template"
44
+ end
45
+ # verify the required parameter 'add_fields_data' is set
46
+ if @api_client.config.client_side_validation && add_fields_data.nil?
47
+ fail ArgumentError, "Missing the required parameter 'add_fields_data' when calling PDFApi.add_fields_to_template"
48
+ end
49
+ # resource path
50
+ local_var_path = '/templates/{template_id}/add_fields'.sub('{' + 'template_id' + '}', template_id.to_s)
51
+
52
+ # query parameters
53
+ query_params = {}
54
+
55
+ # header parameters
56
+ header_params = {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+ # HTTP header 'Content-Type'
60
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
61
+
62
+ # form parameters
63
+ form_params = {}
64
+
65
+ # http body (model)
66
+ post_body = @api_client.object_to_http_body(add_fields_data)
67
+ auth_names = ['api_token_basic']
68
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => 'AddFieldsTemplateResponse')
75
+ if @api_client.config.debugging
76
+ @api_client.config.logger.debug "API called: PDFApi#add_fields_to_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
77
+ end
78
+ return data, status_code, headers
79
+ end
80
+
22
81
  # Generates multiple PDFs
23
82
  # @param template_id
24
83
  # @param request_body
@@ -394,34 +453,87 @@ module DocSpring
394
453
  return data, status_code, headers
395
454
  end
396
455
 
397
- # Upload a new PDF template with a file upload
456
+ # Create a new HTML template
457
+ # @param create_html_template_data
458
+ # @param [Hash] opts the optional parameters
459
+ # @return [PendingTemplate]
460
+ def create_html_template(create_html_template_data, opts = {})
461
+ data, _status_code, _headers = create_html_template_with_http_info(create_html_template_data, opts)
462
+ data
463
+ end
464
+
465
+ # Create a new HTML template
466
+ # @param create_html_template_data
467
+ # @param [Hash] opts the optional parameters
468
+ # @return [Array<(PendingTemplate, Fixnum, Hash)>] PendingTemplate data, response status code and response headers
469
+ def create_html_template_with_http_info(create_html_template_data, opts = {})
470
+ if @api_client.config.debugging
471
+ @api_client.config.logger.debug 'Calling API: PDFApi.create_html_template ...'
472
+ end
473
+ # verify the required parameter 'create_html_template_data' is set
474
+ if @api_client.config.client_side_validation && create_html_template_data.nil?
475
+ fail ArgumentError, "Missing the required parameter 'create_html_template_data' when calling PDFApi.create_html_template"
476
+ end
477
+ # resource path
478
+ local_var_path = '/templates?desc=html'
479
+
480
+ # query parameters
481
+ query_params = {}
482
+
483
+ # header parameters
484
+ header_params = {}
485
+ # HTTP header 'Accept' (if needed)
486
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
487
+ # HTTP header 'Content-Type'
488
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
489
+
490
+ # form parameters
491
+ form_params = {}
492
+
493
+ # http body (model)
494
+ post_body = @api_client.object_to_http_body(create_html_template_data)
495
+ auth_names = ['api_token_basic']
496
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
497
+ :header_params => header_params,
498
+ :query_params => query_params,
499
+ :form_params => form_params,
500
+ :body => post_body,
501
+ :auth_names => auth_names,
502
+ :return_type => 'PendingTemplate')
503
+ if @api_client.config.debugging
504
+ @api_client.config.logger.debug "API called: PDFApi#create_html_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
505
+ end
506
+ return data, status_code, headers
507
+ end
508
+
509
+ # Create a new PDF template with a form POST file upload
398
510
  # @param template_document
399
511
  # @param template_name
400
512
  # @param [Hash] opts the optional parameters
401
513
  # @option opts [String] :template_parent_folder_id
402
514
  # @return [PendingTemplate]
403
- def create_template(template_document, template_name, opts = {})
404
- data, _status_code, _headers = create_template_with_http_info(template_document, template_name, opts)
515
+ def create_pdf_template(template_document, template_name, opts = {})
516
+ data, _status_code, _headers = create_pdf_template_with_http_info(template_document, template_name, opts)
405
517
  data
406
518
  end
407
519
 
408
- # Upload a new PDF template with a file upload
520
+ # Create a new PDF template with a form POST file upload
409
521
  # @param template_document
410
522
  # @param template_name
411
523
  # @param [Hash] opts the optional parameters
412
524
  # @option opts [String] :template_parent_folder_id
413
525
  # @return [Array<(PendingTemplate, Fixnum, Hash)>] PendingTemplate data, response status code and response headers
414
- def create_template_with_http_info(template_document, template_name, opts = {})
526
+ def create_pdf_template_with_http_info(template_document, template_name, opts = {})
415
527
  if @api_client.config.debugging
416
- @api_client.config.logger.debug 'Calling API: PDFApi.create_template ...'
528
+ @api_client.config.logger.debug 'Calling API: PDFApi.create_pdf_template ...'
417
529
  end
418
530
  # verify the required parameter 'template_document' is set
419
531
  if @api_client.config.client_side_validation && template_document.nil?
420
- fail ArgumentError, "Missing the required parameter 'template_document' when calling PDFApi.create_template"
532
+ fail ArgumentError, "Missing the required parameter 'template_document' when calling PDFApi.create_pdf_template"
421
533
  end
422
534
  # verify the required parameter 'template_name' is set
423
535
  if @api_client.config.client_side_validation && template_name.nil?
424
- fail ArgumentError, "Missing the required parameter 'template_name' when calling PDFApi.create_template"
536
+ fail ArgumentError, "Missing the required parameter 'template_name' when calling PDFApi.create_pdf_template"
425
537
  end
426
538
  # resource path
427
539
  local_var_path = '/templates'
@@ -453,34 +565,34 @@ module DocSpring
453
565
  :auth_names => auth_names,
454
566
  :return_type => 'PendingTemplate')
455
567
  if @api_client.config.debugging
456
- @api_client.config.logger.debug "API called: PDFApi#create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
568
+ @api_client.config.logger.debug "API called: PDFApi#create_pdf_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
457
569
  end
458
570
  return data, status_code, headers
459
571
  end
460
572
 
461
573
  # Create a new PDF template from a cached presign upload
462
- # @param create_template_data
574
+ # @param create_template_from_upload_data
463
575
  # @param [Hash] opts the optional parameters
464
576
  # @return [PendingTemplate]
465
- def create_template_from_upload(create_template_data, opts = {})
466
- data, _status_code, _headers = create_template_from_upload_with_http_info(create_template_data, opts)
577
+ def create_pdf_template_from_upload(create_template_from_upload_data, opts = {})
578
+ data, _status_code, _headers = create_pdf_template_from_upload_with_http_info(create_template_from_upload_data, opts)
467
579
  data
468
580
  end
469
581
 
470
582
  # Create a new PDF template from a cached presign upload
471
- # @param create_template_data
583
+ # @param create_template_from_upload_data
472
584
  # @param [Hash] opts the optional parameters
473
585
  # @return [Array<(PendingTemplate, Fixnum, Hash)>] PendingTemplate data, response status code and response headers
474
- def create_template_from_upload_with_http_info(create_template_data, opts = {})
586
+ def create_pdf_template_from_upload_with_http_info(create_template_from_upload_data, opts = {})
475
587
  if @api_client.config.debugging
476
- @api_client.config.logger.debug 'Calling API: PDFApi.create_template_from_upload ...'
588
+ @api_client.config.logger.debug 'Calling API: PDFApi.create_pdf_template_from_upload ...'
477
589
  end
478
- # verify the required parameter 'create_template_data' is set
479
- if @api_client.config.client_side_validation && create_template_data.nil?
480
- fail ArgumentError, "Missing the required parameter 'create_template_data' when calling PDFApi.create_template_from_upload"
590
+ # verify the required parameter 'create_template_from_upload_data' is set
591
+ if @api_client.config.client_side_validation && create_template_from_upload_data.nil?
592
+ fail ArgumentError, "Missing the required parameter 'create_template_from_upload_data' when calling PDFApi.create_pdf_template_from_upload"
481
593
  end
482
594
  # resource path
483
- local_var_path = '/templates?v=2'
595
+ local_var_path = '/templates?desc=cached_upload'
484
596
 
485
597
  # query parameters
486
598
  query_params = {}
@@ -496,7 +608,7 @@ module DocSpring
496
608
  form_params = {}
497
609
 
498
610
  # http body (model)
499
- post_body = @api_client.object_to_http_body(create_template_data)
611
+ post_body = @api_client.object_to_http_body(create_template_from_upload_data)
500
612
  auth_names = ['api_token_basic']
501
613
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
502
614
  :header_params => header_params,
@@ -506,7 +618,7 @@ module DocSpring
506
618
  :auth_names => auth_names,
507
619
  :return_type => 'PendingTemplate')
508
620
  if @api_client.config.debugging
509
- @api_client.config.logger.debug "API called: PDFApi#create_template_from_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
621
+ @api_client.config.logger.debug "API called: PDFApi#create_pdf_template_from_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
510
622
  end
511
623
  return data, status_code, headers
512
624
  end
@@ -1477,5 +1589,64 @@ module DocSpring
1477
1589
  return data, status_code, headers
1478
1590
  end
1479
1591
 
1592
+ # Update a Template
1593
+ # @param template_id
1594
+ # @param update_template_data
1595
+ # @param [Hash] opts the optional parameters
1596
+ # @return [UpdateTemplateResponse]
1597
+ def update_template(template_id, update_template_data, opts = {})
1598
+ data, _status_code, _headers = update_template_with_http_info(template_id, update_template_data, opts)
1599
+ data
1600
+ end
1601
+
1602
+ # Update a Template
1603
+ # @param template_id
1604
+ # @param update_template_data
1605
+ # @param [Hash] opts the optional parameters
1606
+ # @return [Array<(UpdateTemplateResponse, Fixnum, Hash)>] UpdateTemplateResponse data, response status code and response headers
1607
+ def update_template_with_http_info(template_id, update_template_data, opts = {})
1608
+ if @api_client.config.debugging
1609
+ @api_client.config.logger.debug 'Calling API: PDFApi.update_template ...'
1610
+ end
1611
+ # verify the required parameter 'template_id' is set
1612
+ if @api_client.config.client_side_validation && template_id.nil?
1613
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.update_template"
1614
+ end
1615
+ # verify the required parameter 'update_template_data' is set
1616
+ if @api_client.config.client_side_validation && update_template_data.nil?
1617
+ fail ArgumentError, "Missing the required parameter 'update_template_data' when calling PDFApi.update_template"
1618
+ end
1619
+ # resource path
1620
+ local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)
1621
+
1622
+ # query parameters
1623
+ query_params = {}
1624
+
1625
+ # header parameters
1626
+ header_params = {}
1627
+ # HTTP header 'Accept' (if needed)
1628
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1629
+ # HTTP header 'Content-Type'
1630
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1631
+
1632
+ # form parameters
1633
+ form_params = {}
1634
+
1635
+ # http body (model)
1636
+ post_body = @api_client.object_to_http_body(update_template_data)
1637
+ auth_names = ['api_token_basic']
1638
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
1639
+ :header_params => header_params,
1640
+ :query_params => query_params,
1641
+ :form_params => form_params,
1642
+ :body => post_body,
1643
+ :auth_names => auth_names,
1644
+ :return_type => 'UpdateTemplateResponse')
1645
+ if @api_client.config.debugging
1646
+ @api_client.config.logger.debug "API called: PDFApi#update_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1647
+ end
1648
+ return data, status_code, headers
1649
+ end
1650
+
1480
1651
  end
1481
1652
  end