form_api 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +15 -13
  3. data/.swagger-codegen-ignore +0 -8
  4. data/Gemfile +1 -0
  5. data/Gemfile.lock +80 -0
  6. data/README.md +86 -70
  7. data/Rakefile +0 -3
  8. data/docs/CreateCombinedSubmissionBody.md +11 -0
  9. data/docs/CreateSubmissionBatchBody.md +10 -0
  10. data/docs/CreateSubmissionBody.md +10 -0
  11. data/docs/InlineResponse200.md +8 -0
  12. data/docs/InlineResponse2001.md +21 -0
  13. data/docs/InlineResponse201.md +9 -0
  14. data/docs/InlineResponse2011.md +9 -0
  15. data/docs/InlineResponse201CombinedSubmission.md +14 -0
  16. data/docs/InlineResponse400.md +9 -0
  17. data/docs/InlineResponse401.md +8 -0
  18. data/docs/InlineResponse422.md +9 -0
  19. data/docs/PDFApi.md +482 -0
  20. data/docs/TemplatestemplateIdsubmissionsbatchSubmission.md +14 -0
  21. data/form_api.gemspec +3 -10
  22. data/git_push.sh +55 -0
  23. data/{extensions/lib → lib}/form_api/api/client.rb +2 -2
  24. data/lib/form_api/api/pdf_api.rb +129 -19
  25. data/lib/form_api/configuration.rb +1 -1
  26. data/lib/form_api/models/{data.rb → create_combined_submission_body.rb} +1 -1
  27. data/lib/form_api/models/create_submission_batch_body.rb +211 -0
  28. data/lib/form_api/models/{data_1.rb → create_submission_body.rb} +1 -1
  29. data/lib/form_api/models/inline_response_200_1.rb +400 -0
  30. data/lib/form_api/models/inline_response_201_1.rb +1 -1
  31. data/lib/form_api/models/{inline_response_201_1_submission.rb → templatestemplate_idsubmissionsbatch_submission.rb} +1 -1
  32. data/lib/form_api/version.rb +1 -1
  33. data/lib/form_api.rb +6 -4
  34. data/spec/api/pdf_api_spec.rb +41 -15
  35. data/spec/api_client_spec.rb +1 -1
  36. data/spec/models/{data_spec.rb → create_combined_submission_body_spec.rb} +6 -6
  37. data/spec/models/create_submission_batch_body_spec.rb +54 -0
  38. data/spec/models/{data_1_spec.rb → create_submission_body_spec.rb} +6 -6
  39. data/spec/models/inline_response_200_1_spec.rb +124 -0
  40. data/spec/models/{inline_response_201_1_submission_spec.rb → templatestemplate_idsubmissionsbatch_submission_spec.rb} +6 -6
  41. data/spec/vcr_cassettes/FormAPI_Client/should_generate_a_PDF_and_wait_for_the_submission_to_be_processed.yml +2 -2
  42. metadata +45 -47
  43. data/.swagger-revision +0 -1
  44. data/.travis.yml +0 -8
  45. data/CHANGELOG.md +0 -2
  46. data/LICENSE +0 -7
  47. data/examples/generate_and_download_pdf.rb +0 -60
  48. data/examples/generate_pdf_async.rb +0 -57
  49. data/examples/merge_generated_pdfs.rb +0 -31
  50. data/scripts/clean +0 -5
  51. data/scripts/fix_gemspec.rb +0 -31
  52. data/scripts/generate +0 -22
  53. data/scripts/post_generate +0 -22
  54. data/scripts/release +0 -6
  55. data/scripts/swagger +0 -35
  56. data/scripts/test +0 -24
  57. data/swagger-config.json +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '00169a4fbb7ab1b2beb13f813f396f46dcc2b085'
4
- data.tar.gz: a13b337783a72f2e63485661d340d18ead404619
3
+ metadata.gz: 7b00921152a148d757ec6772ee4da728448e8c3b
4
+ data.tar.gz: fedf600a57f3cfda8daf9616ddcfade8779902f8
5
5
  SHA512:
6
- metadata.gz: b59bb93e0c541f0149d58f3fb5d9b6184337a8cbffecfb5ed993aaab97d94fff4228859cd1db49af3adb3592193ed45798d720d90d47c23a2d83c94469cea393
7
- data.tar.gz: 60076f7208a1398837a4a417c9abe6764b3c2a2d41c473647f9c213d4de6efd87c0b8b7e1789d08bf4ab08ad71ea45c158410afe6b23c506cd814cd72bab65b4
6
+ metadata.gz: 304fb110f255378abfd32295b2002d968fe3b1a26d789936c5faf33d8250a0cb911c344af7fe6ffe392491aa6f44d50b978f9a06ea7a2e2d9de7143619944232
7
+ data.tar.gz: 832fc6b95b6bab276a13ba6ecc52acf7eda99c334a32b0405e9fe76feed22806a334a4070a3b9b4506855164fee829d33fbb4424efa87af23ba27a2484e0161a
data/.gitignore CHANGED
@@ -1,3 +1,6 @@
1
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
2
+ #
3
+
1
4
  *.gem
2
5
  *.rbc
3
6
  /.config
@@ -9,7 +12,11 @@
9
12
  /test/tmp/
10
13
  /test/version_tmp/
11
14
  /tmp/
12
- .byebug_history
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
13
20
 
14
21
  ## Documentation cache and generated files:
15
22
  /.yardoc/
@@ -21,17 +28,12 @@
21
28
  /.bundle/
22
29
  /vendor/bundle
23
30
  /lib/bundler/man/
24
- Gemfile.lock
25
- .ruby-version
26
- .ruby-gemset
27
- .rvmrc
28
31
 
29
- ## Emacs files
30
- *~
32
+ # for a library or gem, you might want to ignore these files since the code is
33
+ # intended to run in multiple environments; otherwise, check them in:
34
+ # Gemfile.lock
35
+ # .ruby-version
36
+ # .ruby-gemset
31
37
 
32
- ## OSX files
33
- .DS_Store
34
- Thumbs.db
35
-
36
- ## Ignore baked in swagger generator
37
- swagger-codegen
38
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
39
+ .rvmrc
@@ -21,11 +21,3 @@
21
21
  #docs/*.md
22
22
  # Then explicitly reverse the ignore rule for a single file:
23
23
  #!docs/README.md
24
-
25
- README.md
26
- CHANGELOG.md
27
- git_push.sh
28
- docs/
29
- .gitignore
30
- LICENSE
31
- Rakefile
data/Gemfile CHANGED
@@ -4,4 +4,5 @@ gemspec
4
4
 
5
5
  group :development, :test do
6
6
  gem 'rake', '~> 12.0.0'
7
+ gem 'pry-byebug'
7
8
  end
data/Gemfile.lock ADDED
@@ -0,0 +1,80 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ form_api (0.2.0)
5
+ json (~> 2.1, >= 2.1.0)
6
+ typhoeus (~> 1.0, >= 1.0.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ZenTest (4.11.1)
12
+ addressable (2.5.2)
13
+ public_suffix (>= 2.0.2, < 4.0)
14
+ autotest (4.4.6)
15
+ ZenTest (>= 4.4.1)
16
+ autotest-fsevent (0.2.13)
17
+ sys-uname
18
+ autotest-growl (0.2.16)
19
+ autotest-rails-pure (4.1.2)
20
+ byebug (10.0.2)
21
+ coderay (1.1.2)
22
+ crack (0.4.3)
23
+ safe_yaml (~> 1.0.0)
24
+ diff-lcs (1.3)
25
+ ethon (0.11.0)
26
+ ffi (>= 1.3.0)
27
+ ffi (1.9.23)
28
+ hashdiff (0.3.7)
29
+ json (2.1.0)
30
+ method_source (0.9.0)
31
+ pry (0.11.3)
32
+ coderay (~> 1.1.0)
33
+ method_source (~> 0.9.0)
34
+ pry-byebug (3.6.0)
35
+ byebug (~> 10.0)
36
+ pry (~> 0.10)
37
+ public_suffix (3.0.2)
38
+ rake (12.0.0)
39
+ rspec (3.7.0)
40
+ rspec-core (~> 3.7.0)
41
+ rspec-expectations (~> 3.7.0)
42
+ rspec-mocks (~> 3.7.0)
43
+ rspec-core (3.7.1)
44
+ rspec-support (~> 3.7.0)
45
+ rspec-expectations (3.7.0)
46
+ diff-lcs (>= 1.2.0, < 2.0)
47
+ rspec-support (~> 3.7.0)
48
+ rspec-mocks (3.7.0)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.7.0)
51
+ rspec-support (3.7.1)
52
+ safe_yaml (1.0.4)
53
+ sys-uname (1.0.3)
54
+ ffi (>= 1.0.0)
55
+ typhoeus (1.3.0)
56
+ ethon (>= 0.9.0)
57
+ vcr (3.0.3)
58
+ webmock (1.24.6)
59
+ addressable (>= 2.3.6)
60
+ crack (>= 0.3.2)
61
+ hashdiff
62
+
63
+ PLATFORMS
64
+ ruby
65
+
66
+ DEPENDENCIES
67
+ autotest (~> 4.4, >= 4.4.6)
68
+ autotest-fsevent (~> 0.2, >= 0.2.12)
69
+ autotest-growl (~> 0.2, >= 0.2.16)
70
+ autotest-rails-pure (~> 4.1, >= 4.1.2)
71
+ form_api!
72
+ pry (~> 0.10, >= 0.10.4)
73
+ pry-byebug
74
+ rake (~> 12.0.0)
75
+ rspec (~> 3.6, >= 3.6.0)
76
+ vcr (~> 3.0, >= 3.0.1)
77
+ webmock (~> 1.24, >= 1.24.3)
78
+
79
+ BUNDLED WITH
80
+ 1.16.2
data/README.md CHANGED
@@ -1,105 +1,121 @@
1
- # FormAPI Ruby Client
1
+ # form_api
2
2
 
3
- [![Build Status](https://travis-ci.org/FormAPI/formapi-ruby.svg?branch=master)](https://travis-ci.org/FormAPI/formapi-ruby)
3
+ FormAPI - the Ruby gem for the API V1
4
4
 
5
- The `form_api` gem is an API client library for [FormAPI](https://formapi.io).
6
- You can use FormAPI to generate PDFs. Configure your PDF template in our online editor,
7
- then post data to fill out the PDF.
5
+ No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
8
6
 
9
- ## Supported Ruby Versions
7
+ This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
10
8
 
11
- The `form_api` gem supports Ruby >= `1.9.3`. We run our tests with the following Ruby versions:
12
-
13
- * `1.9.3`
14
- * `2.1.10`
15
- * `2.4.2`
9
+ - API version: v1
10
+ - Package version: 0.2.0
11
+ - Build package: io.swagger.codegen.languages.RubyClientCodegen
16
12
 
17
13
  ## Installation
18
14
 
19
- ```bash
20
- gem install form_api
21
- ```
15
+ ### Build a gem
22
16
 
23
- Or add the following to your `Gemfile`.
17
+ To build the Ruby code into a gem:
24
18
 
25
- ```ruby
26
- gem "form_api"
19
+ ```shell
20
+ gem build form_api.gemspec
27
21
  ```
28
22
 
29
- Then run:
23
+ Then either install the gem locally:
30
24
 
31
- ```bash
32
- bundle install
25
+ ```shell
26
+ gem install ./form_api-0.2.0.gem
33
27
  ```
28
+ (for development, run `gem install --dev ./form_api-0.2.0.gem` to install the development dependencies)
29
+
30
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
+
32
+ Finally add this to the Gemfile:
34
33
 
34
+ gem 'form_api', '~> 0.2.0'
35
35
 
36
- ## Usage
36
+ ### Install from Git
37
37
 
38
- See [examples](examples/) for some runnable examples.
38
+ If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
39
39
 
40
+ gem 'form_api', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
41
+
42
+ ### Include the Ruby code directly
43
+
44
+ Include the Ruby code directly using `-I` as follows:
45
+
46
+ ```shell
47
+ ruby -Ilib script.rb
48
+ ```
49
+
50
+ ## Getting Started
51
+
52
+ Please follow the [installation](#installation) procedure and then run the following code:
40
53
  ```ruby
54
+ # Load the gem
55
+ require 'form_api'
56
+
57
+ # Setup authorization
41
58
  FormAPI.configure do |config|
42
- config.username = "YOUR_API_TOKEN_ID"
43
- config.password = "YOUR_API_TOKEN_SECRET"
59
+ # Configure HTTP basic authorization: api_token_basic
60
+ config.username = 'YOUR USERNAME'
61
+ config.password = 'YOUR PASSWORD'
44
62
  end
45
63
 
46
- formapi = FormAPI::Client.new
47
-
48
- response = formapi.generate_pdf(
49
- template_id: 'YOUR_TEMPLATE_ID', # ID of a template that you have configured
50
- test: true, # Test documents are free but watermarked
51
- wait: true, # Wait for the PDF to be processed (default: true)
52
- data: { # Data to render in the template
53
- name: "foo",
54
- number: 42
55
- },
56
- metadata: { # Custom data to include in the request, for your own purposes
57
- user_id: 123
58
- }
59
- )
60
-
61
- # {
62
- # status: "success",
63
- # submission: {
64
- # id: "bymRSZYTKDnd6jfY",
65
- # test: true,
66
- # state: "processed",
67
- # download_url: "https://..."
68
- # }
69
- # }
70
- ```
64
+ api_instance = FormAPI::PDFApi.new
71
65
 
72
- This submits a PDF request and waits for the job to finish.
66
+ template_id = "template_id_example" # String |
73
67
 
68
+ opts = {
69
+ create_submission_batch_body: [FormAPI::CreateSubmissionBatchBody.new] # Array<CreateSubmissionBatchBody> |
70
+ }
71
+
72
+ begin
73
+ #Generates multiple PDFs
74
+ result = api_instance.batch_generate_pdf(template_id, opts)
75
+ p result
76
+ rescue FormAPI::ApiError => e
77
+ puts "Exception when calling PDFApi->batch_generate_pdf: #{e}"
78
+ end
79
+
80
+ ```
74
81
 
75
- ## More Help
82
+ ## Documentation for API Endpoints
76
83
 
77
- See the [FormAPI documentation](https://formapi.io/docs) for more information.
84
+ All URIs are relative to *https://app.formapi.io/api/v1*
78
85
 
79
- Please [email us](mailto:support@formapi.io) if you need any help.
86
+ Class | Method | HTTP request | Description
87
+ ------------ | ------------- | ------------- | -------------
88
+ *FormAPI::PDFApi* | [**batch_generate_pdf**](docs/PDFApi.md#batch_generate_pdf) | **POST** /templates/{template_id}/submissions/batch | Generates multiple PDFs
89
+ *FormAPI::PDFApi* | [**combine_submissions**](docs/PDFApi.md#combine_submissions) | **POST** /combined_submissions | Merge generated PDFs together
90
+ *FormAPI::PDFApi* | [**expire_combined_submission**](docs/PDFApi.md#expire_combined_submission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission
91
+ *FormAPI::PDFApi* | [**expire_submission**](docs/PDFApi.md#expire_submission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission
92
+ *FormAPI::PDFApi* | [**generate_pdf**](docs/PDFApi.md#generate_pdf) | **POST** /templates/{template_id}/submissions | Generates a new PDF
93
+ *FormAPI::PDFApi* | [**get_combined_submission**](docs/PDFApi.md#get_combined_submission) | **GET** /combined_submissions/{combined_submission_id} | Check the status of a combined submission (merged PDFs)
94
+ *FormAPI::PDFApi* | [**get_submission**](docs/PDFApi.md#get_submission) | **GET** /submissions/{submission_id} | Check the status of a PDF
95
+ *FormAPI::PDFApi* | [**get_templates**](docs/PDFApi.md#get_templates) | **GET** /templates | Get a list of all templates
96
+ *FormAPI::PDFApi* | [**test_authentication**](docs/PDFApi.md#test_authentication) | **GET** /authentication | Test Authentication
80
97
 
81
98
 
82
- ## Development
99
+ ## Documentation for Models
83
100
 
84
- The majority of the code in this repo is generated using swagger-codegen.
85
- You can modify this file and regenerate the client using `scripts/generate`.
101
+ - [FormAPI::CreateCombinedSubmissionBody](docs/CreateCombinedSubmissionBody.md)
102
+ - [FormAPI::CreateSubmissionBatchBody](docs/CreateSubmissionBatchBody.md)
103
+ - [FormAPI::CreateSubmissionBody](docs/CreateSubmissionBody.md)
104
+ - [FormAPI::InlineResponse200](docs/InlineResponse200.md)
105
+ - [FormAPI::InlineResponse2001](docs/InlineResponse2001.md)
106
+ - [FormAPI::InlineResponse201](docs/InlineResponse201.md)
107
+ - [FormAPI::InlineResponse2011](docs/InlineResponse2011.md)
108
+ - [FormAPI::InlineResponse201CombinedSubmission](docs/InlineResponse201CombinedSubmission.md)
109
+ - [FormAPI::InlineResponse400](docs/InlineResponse400.md)
110
+ - [FormAPI::InlineResponse401](docs/InlineResponse401.md)
111
+ - [FormAPI::InlineResponse422](docs/InlineResponse422.md)
112
+ - [FormAPI::TemplatestemplateIdsubmissionsbatchSubmission](docs/TemplatestemplateIdsubmissionsbatchSubmission.md)
86
113
 
87
114
 
88
- ## Release Process
115
+ ## Documentation for Authorization
89
116
 
90
- 1. Pull latest master
91
- 2. Merge feature branch(es) into master
92
- 3. `script/test`
93
- 4. Increment version in code:
94
- - `swagger-config.json`
95
- - `lib/formapi/version.rb`
96
- 5. Update [CHANGELOG.md](CHANGELOG.md)
97
- 6. Commit "Release version vX.Y.Z"
98
- 7. `rake release`
99
- 8. Verify package release at https://rubygems.org/gems/formapi
100
- 9. Refresh documentation on formapi.io
101
117
 
118
+ ### api_token_basic
102
119
 
103
- ## Version Policy
120
+ - **Type**: HTTP basic authentication
104
121
 
105
- This library follows [Semantic Versioning 2.0.0](http://semver.org).
data/Rakefile CHANGED
@@ -1,6 +1,3 @@
1
- require 'bundler/setup'
2
- require 'bundler/gem_tasks'
3
-
4
1
  begin
5
2
  require 'rspec/core/rake_task'
6
3
 
@@ -0,0 +1,11 @@
1
+ # FormAPI::CreateCombinedSubmissionBody
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **test** | **BOOLEAN** | | [optional]
7
+ **submission_ids** | **Array&lt;String&gt;** | |
8
+ **metadata** | **Object** | | [optional]
9
+ **expires_in** | **Float** | | [optional]
10
+
11
+
@@ -0,0 +1,10 @@
1
+ # FormAPI::CreateSubmissionBatchBody
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **test** | **BOOLEAN** | | [optional]
7
+ **data** | **Object** | |
8
+ **metadata** | **Object** | | [optional]
9
+
10
+
@@ -0,0 +1,10 @@
1
+ # FormAPI::CreateSubmissionBody
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **test** | **BOOLEAN** | | [optional]
7
+ **data** | **Object** | |
8
+ **metadata** | **Object** | | [optional]
9
+
10
+
@@ -0,0 +1,8 @@
1
+ # FormAPI::InlineResponse200
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **status** | **String** | |
7
+
8
+
@@ -0,0 +1,21 @@
1
+ # FormAPI::InlineResponse2001
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **String** | |
7
+ **name** | **String** | |
8
+ **template_type** | **String** | |
9
+ **public_web_form** | **BOOLEAN** | |
10
+ **public_submissions** | **BOOLEAN** | |
11
+ **expire_submissions** | **BOOLEAN** | |
12
+ **expire_after** | **Float** | | [optional]
13
+ **expiration_interval** | **String** | | [optional]
14
+ **allow_additional_properties** | **BOOLEAN** | |
15
+ **page_dimensions** | **Array&lt;Array&lt;Float&gt;&gt;** | |
16
+ **webhook_url** | **String** | |
17
+ **slack_webhook_url** | **String** | |
18
+ **redirect_url** | **String** | |
19
+ **blockchain_timestamp_verification** | **BOOLEAN** | |
20
+
21
+
@@ -0,0 +1,9 @@
1
+ # FormAPI::InlineResponse201
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **status** | **String** | |
7
+ **combined_submission** | [**InlineResponse201CombinedSubmission**](InlineResponse201CombinedSubmission.md) | | [optional]
8
+
9
+
@@ -0,0 +1,9 @@
1
+ # FormAPI::InlineResponse2011
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **status** | **String** | |
7
+ **submission** | [**TemplatestemplateIdsubmissionsbatchSubmission**](TemplatestemplateIdsubmissionsbatchSubmission.md) | | [optional]
8
+
9
+
@@ -0,0 +1,14 @@
1
+ # FormAPI::InlineResponse201CombinedSubmission
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **String** | |
7
+ **expired** | **BOOLEAN** | |
8
+ **expires_at** | **String** | | [optional]
9
+ **state** | **String** | |
10
+ **metadata** | **Object** | | [optional]
11
+ **submission_ids** | **Array&lt;String&gt;** | |
12
+ **download_url** | **String** | | [optional]
13
+
14
+
@@ -0,0 +1,9 @@
1
+ # FormAPI::InlineResponse400
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **status** | **String** | |
7
+ **error** | **String** | |
8
+
9
+
@@ -0,0 +1,8 @@
1
+ # FormAPI::InlineResponse401
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **error** | **String** | |
7
+
8
+
@@ -0,0 +1,9 @@
1
+ # FormAPI::InlineResponse422
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **status** | **String** | |
7
+ **errors** | **Array&lt;String&gt;** | |
8
+
9
+