form_api 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +5 -5
  2. data/.swagger-codegen-ignore +31 -0
  3. data/.swagger-codegen/VERSION +1 -0
  4. data/.swagger-revision +1 -0
  5. data/.travis.yml +8 -0
  6. data/Gemfile.lock +3 -2
  7. data/LICENSE +7 -0
  8. data/README.md +10 -6
  9. data/docs/PDFApi.md +152 -0
  10. data/form_api.gemspec +3 -2
  11. data/lib/form_api.rb +3 -2
  12. data/lib/form_api/api/pdf_api.rb +165 -2
  13. data/lib/form_api/api_client.rb +2 -2
  14. data/lib/form_api/api_error.rb +2 -2
  15. data/lib/form_api/configuration.rb +2 -2
  16. data/lib/form_api/models/authentication_error.rb +2 -2
  17. data/lib/form_api/models/authentication_success_response.rb +2 -2
  18. data/lib/form_api/models/combined_submission.rb +2 -2
  19. data/lib/form_api/models/combined_submission_data.rb +2 -2
  20. data/lib/form_api/models/create_combined_submission_response.rb +2 -2
  21. data/lib/form_api/models/create_submission_batch_response.rb +2 -2
  22. data/lib/form_api/models/create_submission_batch_submissions_response.rb +2 -2
  23. data/lib/form_api/models/create_submission_data.rb +2 -2
  24. data/lib/form_api/models/create_submission_data_batch_request.rb +2 -2
  25. data/lib/form_api/models/create_submission_data_batch_v1.rb +2 -2
  26. data/lib/form_api/models/create_submission_data_request_data.rb +2 -2
  27. data/lib/form_api/models/create_submission_data_request_token_response.rb +2 -2
  28. data/lib/form_api/models/create_submission_data_request_token_response_token.rb +2 -2
  29. data/lib/form_api/models/create_submission_response.rb +2 -2
  30. data/lib/form_api/models/error.rb +2 -2
  31. data/lib/form_api/models/invalid_request.rb +2 -2
  32. data/lib/form_api/models/submission.rb +2 -2
  33. data/lib/form_api/models/submission_batch.rb +2 -2
  34. data/lib/form_api/models/submission_batch_data.rb +2 -2
  35. data/lib/form_api/models/submission_data_request.rb +2 -2
  36. data/lib/form_api/models/template.rb +2 -2
  37. data/lib/form_api/models/update_data_request_response.rb +2 -2
  38. data/lib/form_api/models/update_submission_data_request_data.rb +2 -2
  39. data/lib/form_api/version.rb +3 -3
  40. data/spec/api/pdf_api_integration_spec.rb +2 -2
  41. data/spec/api/pdf_api_spec_original.skipped.rb +40 -2
  42. data/spec/api_client_spec.rb +2 -2
  43. data/spec/configuration_spec.rb +2 -2
  44. data/spec/models/authentication_error_spec.rb +2 -2
  45. data/spec/models/authentication_success_response_spec.rb +2 -2
  46. data/spec/models/combined_submission_data_spec.rb +2 -2
  47. data/spec/models/combined_submission_spec.rb +2 -2
  48. data/spec/models/create_combined_submission_response_spec.rb +2 -2
  49. data/spec/models/create_submission_batch_response_spec.rb +2 -2
  50. data/spec/models/create_submission_batch_submissions_response_spec.rb +2 -2
  51. data/spec/models/create_submission_data_batch_request_spec.rb +2 -2
  52. data/spec/models/create_submission_data_batch_v1_spec.rb +2 -2
  53. data/spec/models/create_submission_data_request_data_spec.rb +2 -2
  54. data/spec/models/create_submission_data_request_token_response_spec.rb +2 -2
  55. data/spec/models/create_submission_data_request_token_response_token_spec.rb +2 -2
  56. data/spec/models/create_submission_data_spec.rb +2 -2
  57. data/spec/models/create_submission_response_spec.rb +2 -2
  58. data/spec/models/error_spec.rb +2 -2
  59. data/spec/models/invalid_request_spec.rb +2 -2
  60. data/spec/models/submission_batch_data_spec.rb +2 -2
  61. data/spec/models/submission_batch_spec.rb +2 -2
  62. data/spec/models/submission_data_request_spec.rb +2 -2
  63. data/spec/models/submission_spec.rb +2 -2
  64. data/spec/models/template_spec.rb +2 -2
  65. data/spec/models/update_data_request_response_spec.rb +2 -2
  66. data/spec/models/update_submission_data_request_data_spec.rb +2 -2
  67. data/spec/spec_helper.rb +2 -2
  68. metadata +28 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: af755c2ce95f2c89f1b61a8c7f20b450f2d00c11
4
- data.tar.gz: a0cda83d2f444986fe463e58e55e9431503a4073
2
+ SHA256:
3
+ metadata.gz: 6dd09b3224514218c63ed4c1752f8d815c6532b65c0189e04e67a923e51a003b
4
+ data.tar.gz: 73e413951e1122745546ba9532f467be904461f2b05cbc0881ea626899540c9f
5
5
  SHA512:
6
- metadata.gz: b7ca49414dfcb85f294ebb0075eec300bd7b8f4eb61c91f8de8850892edfb2f9b26c8ba3fdd34c3ed2c561a97d559df9856c1211f4cbed38b25fb6398ba093b9
7
- data.tar.gz: c5839a4716ab0f937d012443b33c7353e98bfa1ac404dc874f751e26b8babbf989147ddab4681d6f5916577df6195fb65a71dac7cd766b128f8124c92a55e56c
6
+ metadata.gz: b3eb0272496eccf34f371532c6865364982a5e929a403457baa601e334b5d76892de124f9c5ccd60e15f7f14ced8bc4c197e53909a7406b11fac330843497972
7
+ data.tar.gz: 59fed76f6536c9e371a96d733923e27bc6d2e9660e8cc22682e95529e05ca9bedf63545aa5ac8086e86543bd02c3e235c93cf867cbe3bd49193fe3f9f36b8c64
@@ -0,0 +1,31 @@
1
+ # Swagger Codegen Ignore
2
+ # Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
3
+
4
+ # Use this file to prevent files from being overwritten by the generator.
5
+ # The patterns follow closely to .gitignore or .dockerignore.
6
+
7
+ # As an example, the C# client generator defines ApiClient.cs.
8
+ # You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
9
+ #ApiClient.cs
10
+
11
+ # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12
+ #foo/*/qux
13
+ # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14
+
15
+ # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16
+ #foo/**/qux
17
+ # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18
+
19
+ # You can also negate patterns with an exclamation (!).
20
+ # For example, you can ignore all files in a docs folder with the file extension .md:
21
+ #docs/*.md
22
+ # Then explicitly reverse the ignore rule for a single file:
23
+ #!docs/README.md
24
+
25
+ README.md
26
+ CHANGELOG.md
27
+ git_push.sh
28
+ docs/
29
+ .gitignore
30
+ LICENSE
31
+ Rakefile
@@ -0,0 +1 @@
1
+ 2.3.0-SNAPSHOT
@@ -0,0 +1 @@
1
+ 28a5b74dbf313529a2fc697d46e9ed870cfd6a30
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.4.2
4
+ - 2.1.10
5
+ - 1.9.3
6
+
7
+ before_install:
8
+ - gem update bundler
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- form_api (1.0.0)
4
+ form_api (1.4.0)
5
+ ffi (~> 1.0, >= 1.9.24)
5
6
  json (~> 2.1, >= 2.1.0)
6
7
  typhoeus (~> 1.0, >= 1.0.1)
7
8
 
@@ -76,4 +77,4 @@ DEPENDENCIES
76
77
  webmock (~> 1.24, >= 1.24.3)
77
78
 
78
79
  BUNDLED WITH
79
- 1.16.2
80
+ 1.17.1
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright © 2018 Form Applications Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # form_api
2
2
 
3
- FormAPI - the Ruby gem for the API V1
3
+ FormAPI - the Ruby gem for the API v1
4
4
 
5
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+ FormAPI is a service that helps you fill out and sign PDF templates.
6
6
 
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 1.3.0
10
+ - Package version: 1.4.0
11
11
  - Build package: io.formapi.codegen.FormApiRubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build form_api.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./form_api-1.3.0.gem
26
+ gem install ./form_api-1.4.0.gem
27
27
  ```
28
- (for development, run `gem install --dev ./form_api-1.3.0.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./form_api-1.4.0.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'form_api', '~> 1.3.0'
34
+ gem 'form_api', '~> 1.4.0'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -85,6 +85,7 @@ Class | Method | HTTP request | Description
85
85
  *FormAPI::PDFApi* | [**batch_generate_pdfs**](docs/PDFApi.md#batch_generate_pdfs) | **POST** /submissions/batches | Generates multiple PDFs
86
86
  *FormAPI::PDFApi* | [**combine_submissions**](docs/PDFApi.md#combine_submissions) | **POST** /combined_submissions | Merge generated PDFs together
87
87
  *FormAPI::PDFApi* | [**create_data_request_token**](docs/PDFApi.md#create_data_request_token) | **POST** /data_requests/{data_request_id}/tokens | Creates a new data request token for form authentication
88
+ *FormAPI::PDFApi* | [**create_template**](docs/PDFApi.md#create_template) | **POST** /templates | Upload a new PDF template
88
89
  *FormAPI::PDFApi* | [**expire_combined_submission**](docs/PDFApi.md#expire_combined_submission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission
89
90
  *FormAPI::PDFApi* | [**expire_submission**](docs/PDFApi.md#expire_submission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission
90
91
  *FormAPI::PDFApi* | [**generate_pdf**](docs/PDFApi.md#generate_pdf) | **POST** /templates/{template_id}/submissions | Generates a new PDF
@@ -92,6 +93,8 @@ Class | Method | HTTP request | Description
92
93
  *FormAPI::PDFApi* | [**get_data_request**](docs/PDFApi.md#get_data_request) | **GET** /data_requests/{data_request_id} | Look up a submission data request
93
94
  *FormAPI::PDFApi* | [**get_submission**](docs/PDFApi.md#get_submission) | **GET** /submissions/{submission_id} | Check the status of a PDF
94
95
  *FormAPI::PDFApi* | [**get_submission_batch**](docs/PDFApi.md#get_submission_batch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job
96
+ *FormAPI::PDFApi* | [**get_template**](docs/PDFApi.md#get_template) | **GET** /templates/{template_id} | Check the status of an uploaded template
97
+ *FormAPI::PDFApi* | [**get_template_schema**](docs/PDFApi.md#get_template_schema) | **GET** /templates/{template_id}/schema | Fetch the JSON schema for a template
95
98
  *FormAPI::PDFApi* | [**get_templates**](docs/PDFApi.md#get_templates) | **GET** /templates | Get a list of all templates
96
99
  *FormAPI::PDFApi* | [**test_authentication**](docs/PDFApi.md#test_authentication) | **GET** /authentication | Test Authentication
97
100
  *FormAPI::PDFApi* | [**update_data_request**](docs/PDFApi.md#update_data_request) | **PUT** /data_requests/{data_request_id} | Update a submission data request
@@ -120,6 +123,7 @@ Class | Method | HTTP request | Description
120
123
  - [FormAPI::SubmissionBatchData](docs/SubmissionBatchData.md)
121
124
  - [FormAPI::SubmissionDataRequest](docs/SubmissionDataRequest.md)
122
125
  - [FormAPI::Template](docs/Template.md)
126
+ - [FormAPI::Template1](docs/Template1.md)
123
127
  - [FormAPI::UpdateDataRequestResponse](docs/UpdateDataRequestResponse.md)
124
128
  - [FormAPI::UpdateSubmissionDataRequestData](docs/UpdateSubmissionDataRequestData.md)
125
129
 
@@ -8,6 +8,7 @@ Method | HTTP request | Description
8
8
  [**batch_generate_pdfs**](PDFApi.md#batch_generate_pdfs) | **POST** /submissions/batches | Generates multiple PDFs
9
9
  [**combine_submissions**](PDFApi.md#combine_submissions) | **POST** /combined_submissions | Merge generated PDFs together
10
10
  [**create_data_request_token**](PDFApi.md#create_data_request_token) | **POST** /data_requests/{data_request_id}/tokens | Creates a new data request token for form authentication
11
+ [**create_template**](PDFApi.md#create_template) | **POST** /templates | Upload a new PDF template
11
12
  [**expire_combined_submission**](PDFApi.md#expire_combined_submission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission
12
13
  [**expire_submission**](PDFApi.md#expire_submission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission
13
14
  [**generate_pdf**](PDFApi.md#generate_pdf) | **POST** /templates/{template_id}/submissions | Generates a new PDF
@@ -15,6 +16,8 @@ Method | HTTP request | Description
15
16
  [**get_data_request**](PDFApi.md#get_data_request) | **GET** /data_requests/{data_request_id} | Look up a submission data request
16
17
  [**get_submission**](PDFApi.md#get_submission) | **GET** /submissions/{submission_id} | Check the status of a PDF
17
18
  [**get_submission_batch**](PDFApi.md#get_submission_batch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job
19
+ [**get_template**](PDFApi.md#get_template) | **GET** /templates/{template_id} | Check the status of an uploaded template
20
+ [**get_template_schema**](PDFApi.md#get_template_schema) | **GET** /templates/{template_id}/schema | Fetch the JSON schema for a template
18
21
  [**get_templates**](PDFApi.md#get_templates) | **GET** /templates | Get a list of all templates
19
22
  [**test_authentication**](PDFApi.md#test_authentication) | **GET** /authentication | Test Authentication
20
23
  [**update_data_request**](PDFApi.md#update_data_request) | **PUT** /data_requests/{data_request_id} | Update a submission data request
@@ -218,6 +221,57 @@ Name | Type | Description | Notes
218
221
 
219
222
 
220
223
 
224
+ # **create_template**
225
+ > Template1 create_template(template_document, template_name)
226
+
227
+ Upload a new PDF template
228
+
229
+ ### Example
230
+ ```ruby
231
+ # load the gem
232
+ require 'form_api'
233
+ # setup authorization
234
+ FormAPI.configure do |config|
235
+ # Configure HTTP basic authorization: api_token_basic
236
+ config.username = 'YOUR USERNAME'
237
+ config.password = 'YOUR PASSWORD'
238
+ end
239
+
240
+ api_instance = FormAPI::PDFApi.new
241
+ template_document = File.new('/path/to/file') # File |
242
+ template_name = 'template_name_example' # String |
243
+
244
+ begin
245
+ #Upload a new PDF template
246
+ result = api_instance.create_template(template_document, template_name)
247
+ p result
248
+ rescue FormAPI::ApiError => e
249
+ puts "Exception when calling PDFApi->create_template: #{e}"
250
+ end
251
+ ```
252
+
253
+ ### Parameters
254
+
255
+ Name | Type | Description | Notes
256
+ ------------- | ------------- | ------------- | -------------
257
+ **template_document** | **File**| |
258
+ **template_name** | **String**| |
259
+
260
+ ### Return type
261
+
262
+ [**Template1**](Template1.md)
263
+
264
+ ### Authorization
265
+
266
+ [api_token_basic](../README.md#api_token_basic)
267
+
268
+ ### HTTP request headers
269
+
270
+ - **Content-Type**: multipart/form-data
271
+ - **Accept**: application/json
272
+
273
+
274
+
221
275
  # **expire_combined_submission**
222
276
  > CombinedSubmission expire_combined_submission(combined_submission_id)
223
277
 
@@ -567,6 +621,104 @@ Name | Type | Description | Notes
567
621
 
568
622
 
569
623
 
624
+ # **get_template**
625
+ > Template get_template(template_id)
626
+
627
+ Check the status of an uploaded template
628
+
629
+ ### Example
630
+ ```ruby
631
+ # load the gem
632
+ require 'form_api'
633
+ # setup authorization
634
+ FormAPI.configure do |config|
635
+ # Configure HTTP basic authorization: api_token_basic
636
+ config.username = 'YOUR USERNAME'
637
+ config.password = 'YOUR PASSWORD'
638
+ end
639
+
640
+ api_instance = FormAPI::PDFApi.new
641
+ template_id = 'tpl_000000000000000001' # String |
642
+
643
+ begin
644
+ #Check the status of an uploaded template
645
+ result = api_instance.get_template(template_id)
646
+ p result
647
+ rescue FormAPI::ApiError => e
648
+ puts "Exception when calling PDFApi->get_template: #{e}"
649
+ end
650
+ ```
651
+
652
+ ### Parameters
653
+
654
+ Name | Type | Description | Notes
655
+ ------------- | ------------- | ------------- | -------------
656
+ **template_id** | **String**| |
657
+
658
+ ### Return type
659
+
660
+ [**Template**](Template.md)
661
+
662
+ ### Authorization
663
+
664
+ [api_token_basic](../README.md#api_token_basic)
665
+
666
+ ### HTTP request headers
667
+
668
+ - **Content-Type**: Not defined
669
+ - **Accept**: application/json
670
+
671
+
672
+
673
+ # **get_template_schema**
674
+ > Hash<String, Object> get_template_schema(template_id)
675
+
676
+ Fetch the JSON schema for a template
677
+
678
+ ### Example
679
+ ```ruby
680
+ # load the gem
681
+ require 'form_api'
682
+ # setup authorization
683
+ FormAPI.configure do |config|
684
+ # Configure HTTP basic authorization: api_token_basic
685
+ config.username = 'YOUR USERNAME'
686
+ config.password = 'YOUR PASSWORD'
687
+ end
688
+
689
+ api_instance = FormAPI::PDFApi.new
690
+ template_id = 'tpl_000000000000000001' # String |
691
+
692
+ begin
693
+ #Fetch the JSON schema for a template
694
+ result = api_instance.get_template_schema(template_id)
695
+ p result
696
+ rescue FormAPI::ApiError => e
697
+ puts "Exception when calling PDFApi->get_template_schema: #{e}"
698
+ end
699
+ ```
700
+
701
+ ### Parameters
702
+
703
+ Name | Type | Description | Notes
704
+ ------------- | ------------- | ------------- | -------------
705
+ **template_id** | **String**| |
706
+
707
+ ### Return type
708
+
709
+ **Hash<String, Object>**
710
+
711
+ ### Authorization
712
+
713
+ [api_token_basic](../README.md#api_token_basic)
714
+
715
+ ### HTTP request headers
716
+
717
+ - **Content-Type**: Not defined
718
+ - **Accept**: application/json
719
+
720
+
721
+
570
722
  # **get_templates**
571
723
  > Array<Template> get_templates(opts)
572
724
 
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  =begin
4
- #API V1
4
+ #API v1
5
5
 
6
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ #FormAPI is a service that helps you fill out and sign PDF templates.
7
7
 
8
8
  OpenAPI spec version: v1
9
9
 
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.required_ruby_version = ">= 1.9"
29
29
 
30
30
  s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
31
+ s.add_runtime_dependency 'ffi', '~> 1.0', '>= 1.9.24'
31
32
  s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
32
33
 
33
34
  s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
@@ -1,7 +1,7 @@
1
1
  =begin
2
- #API V1
2
+ #API v1
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #FormAPI is a service that helps you fill out and sign PDF templates.
5
5
 
6
6
  OpenAPI spec version: v1
7
7
 
@@ -38,6 +38,7 @@ require 'form_api/models/submission_batch'
38
38
  require 'form_api/models/submission_batch_data'
39
39
  require 'form_api/models/submission_data_request'
40
40
  require 'form_api/models/template'
41
+ require 'form_api/models/template1'
41
42
  require 'form_api/models/update_data_request_response'
42
43
  require 'form_api/models/update_submission_data_request_data'
43
44
 
@@ -1,7 +1,7 @@
1
1
  =begin
2
- #API V1
2
+ #API v1
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #FormAPI is a service that helps you fill out and sign PDF templates.
5
5
 
6
6
  OpenAPI spec version: v1
7
7
 
@@ -235,6 +235,67 @@ module FormAPI
235
235
  return data, status_code, headers
236
236
  end
237
237
 
238
+ # Upload a new PDF template
239
+ # @param template_document
240
+ # @param template_name
241
+ # @param [Hash] opts the optional parameters
242
+ # @return [Template1]
243
+ def create_template(template_document, template_name, opts = {})
244
+ data, _status_code, _headers = create_template_with_http_info(template_document, template_name, opts)
245
+ data
246
+ end
247
+
248
+ # Upload a new PDF template
249
+ # @param template_document
250
+ # @param template_name
251
+ # @param [Hash] opts the optional parameters
252
+ # @return [Array<(Template1, Fixnum, Hash)>] Template1 data, response status code and response headers
253
+ def create_template_with_http_info(template_document, template_name, opts = {})
254
+ if @api_client.config.debugging
255
+ @api_client.config.logger.debug 'Calling API: PDFApi.create_template ...'
256
+ end
257
+ # verify the required parameter 'template_document' is set
258
+ if @api_client.config.client_side_validation && template_document.nil?
259
+ fail ArgumentError, "Missing the required parameter 'template_document' when calling PDFApi.create_template"
260
+ end
261
+ # verify the required parameter 'template_name' is set
262
+ if @api_client.config.client_side_validation && template_name.nil?
263
+ fail ArgumentError, "Missing the required parameter 'template_name' when calling PDFApi.create_template"
264
+ end
265
+ # resource path
266
+ local_var_path = '/templates'
267
+
268
+ # query parameters
269
+ query_params = {}
270
+
271
+ # header parameters
272
+ header_params = {}
273
+ # HTTP header 'Accept' (if needed)
274
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
275
+ # HTTP header 'Content-Type'
276
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
277
+
278
+ # form parameters
279
+ form_params = {}
280
+ form_params['template[document]'] = template_document
281
+ form_params['template[name]'] = template_name
282
+
283
+ # http body (model)
284
+ post_body = nil
285
+ auth_names = ['api_token_basic']
286
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
287
+ :header_params => header_params,
288
+ :query_params => query_params,
289
+ :form_params => form_params,
290
+ :body => post_body,
291
+ :auth_names => auth_names,
292
+ :return_type => 'Template1')
293
+ if @api_client.config.debugging
294
+ @api_client.config.logger.debug "API called: PDFApi#create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
295
+ end
296
+ return data, status_code, headers
297
+ end
298
+
238
299
  # Expire a combined submission
239
300
  # @param combined_submission_id
240
301
  # @param [Hash] opts the optional parameters
@@ -603,6 +664,108 @@ module FormAPI
603
664
  return data, status_code, headers
604
665
  end
605
666
 
667
+ # Check the status of an uploaded template
668
+ # @param template_id
669
+ # @param [Hash] opts the optional parameters
670
+ # @return [Template]
671
+ def get_template(template_id, opts = {})
672
+ data, _status_code, _headers = get_template_with_http_info(template_id, opts)
673
+ data
674
+ end
675
+
676
+ # Check the status of an uploaded template
677
+ # @param template_id
678
+ # @param [Hash] opts the optional parameters
679
+ # @return [Array<(Template, Fixnum, Hash)>] Template data, response status code and response headers
680
+ def get_template_with_http_info(template_id, opts = {})
681
+ if @api_client.config.debugging
682
+ @api_client.config.logger.debug 'Calling API: PDFApi.get_template ...'
683
+ end
684
+ # verify the required parameter 'template_id' is set
685
+ if @api_client.config.client_side_validation && template_id.nil?
686
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.get_template"
687
+ end
688
+ # resource path
689
+ local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)
690
+
691
+ # query parameters
692
+ query_params = {}
693
+
694
+ # header parameters
695
+ header_params = {}
696
+ # HTTP header 'Accept' (if needed)
697
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
698
+
699
+ # form parameters
700
+ form_params = {}
701
+
702
+ # http body (model)
703
+ post_body = nil
704
+ auth_names = ['api_token_basic']
705
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
706
+ :header_params => header_params,
707
+ :query_params => query_params,
708
+ :form_params => form_params,
709
+ :body => post_body,
710
+ :auth_names => auth_names,
711
+ :return_type => 'Template')
712
+ if @api_client.config.debugging
713
+ @api_client.config.logger.debug "API called: PDFApi#get_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
714
+ end
715
+ return data, status_code, headers
716
+ end
717
+
718
+ # Fetch the JSON schema for a template
719
+ # @param template_id
720
+ # @param [Hash] opts the optional parameters
721
+ # @return [Hash<String, Object>]
722
+ def get_template_schema(template_id, opts = {})
723
+ data, _status_code, _headers = get_template_schema_with_http_info(template_id, opts)
724
+ data
725
+ end
726
+
727
+ # Fetch the JSON schema for a template
728
+ # @param template_id
729
+ # @param [Hash] opts the optional parameters
730
+ # @return [Array<(Hash<String, Object>, Fixnum, Hash)>] Hash<String, Object> data, response status code and response headers
731
+ def get_template_schema_with_http_info(template_id, opts = {})
732
+ if @api_client.config.debugging
733
+ @api_client.config.logger.debug 'Calling API: PDFApi.get_template_schema ...'
734
+ end
735
+ # verify the required parameter 'template_id' is set
736
+ if @api_client.config.client_side_validation && template_id.nil?
737
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling PDFApi.get_template_schema"
738
+ end
739
+ # resource path
740
+ local_var_path = '/templates/{template_id}/schema'.sub('{' + 'template_id' + '}', template_id.to_s)
741
+
742
+ # query parameters
743
+ query_params = {}
744
+
745
+ # header parameters
746
+ header_params = {}
747
+ # HTTP header 'Accept' (if needed)
748
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
749
+
750
+ # form parameters
751
+ form_params = {}
752
+
753
+ # http body (model)
754
+ post_body = nil
755
+ auth_names = ['api_token_basic']
756
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
757
+ :header_params => header_params,
758
+ :query_params => query_params,
759
+ :form_params => form_params,
760
+ :body => post_body,
761
+ :auth_names => auth_names,
762
+ :return_type => 'Hash<String, Object>')
763
+ if @api_client.config.debugging
764
+ @api_client.config.logger.debug "API called: PDFApi#get_template_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
765
+ end
766
+ return data, status_code, headers
767
+ end
768
+
606
769
  # Get a list of all templates
607
770
  # @param [Hash] opts the optional parameters
608
771
  # @option opts [Integer] :page Default: 1