pdf4me 1.0.1 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{LICENSE → LICENSE.txt} +6 -6
- data/README.md +124 -395
- data/lib/pdf4me.rb +40 -110
- data/lib/pdf4me/actions/complex_action.rb +64 -0
- data/lib/pdf4me/actions/convert_file_to_pdf.rb +30 -0
- data/lib/pdf4me/actions/convert_to_pdf.rb +14 -0
- data/lib/pdf4me/actions/create_pdf_a.rb +29 -0
- data/lib/pdf4me/actions/create_thumbnail.rb +55 -0
- data/lib/pdf4me/actions/extract_pages.rb +49 -0
- data/lib/pdf4me/actions/merge_two_pdfs.rb +34 -0
- data/lib/pdf4me/actions/optimize.rb +10 -0
- data/lib/pdf4me/actions/optimize_by_profile.rb +42 -0
- data/lib/pdf4me/actions/split_by_page_nr.rb +55 -0
- data/lib/pdf4me/actions/text_stamp.rb +63 -0
- data/lib/pdf4me/actions/wrapper_action.rb +65 -0
- data/lib/pdf4me/client.rb +87 -0
- data/lib/pdf4me/configuration.rb +9 -88
- data/lib/pdf4me/exceptions.rb +26 -0
- data/lib/pdf4me/models/base.rb +26 -0
- data/lib/pdf4me/models/convert_to_pdf_action.rb +26 -246
- data/lib/pdf4me/models/convert_to_pdf_res.rb +5 -185
- data/lib/pdf4me/models/doc_log.rb +12 -257
- data/lib/pdf4me/models/doc_metadata.rb +13 -282
- data/lib/pdf4me/models/document.rb +14 -282
- data/lib/pdf4me/models/notification.rb +8 -191
- data/lib/pdf4me/models/optimize_action.rb +72 -508
- data/lib/pdf4me/models/optimize_res.rb +5 -195
- data/lib/pdf4me/models/page.rb +12 -254
- data/lib/pdf4me/utils/assigner.rb +10 -0
- data/lib/pdf4me/utils/serializer.rb +43 -0
- data/lib/pdf4me/version.rb +1 -13
- data/spec/actions/create_pdf_a_spec.rb +21 -0
- data/spec/actions/wrapper_action_spec.rb +24 -0
- data/spec/files/4.pdf +0 -0
- data/spec/spec_helper.rb +17 -100
- metadata +70 -421
- data/Gemfile +0 -7
- data/Rakefile +0 -8
- data/docs/ActionFlow.md +0 -8
- data/docs/ApiUsageRes.md +0 -11
- data/docs/ArchiveConfig.md +0 -11
- data/docs/ArchiveJobReq.md +0 -12
- data/docs/ArchiveJobRes.md +0 -9
- data/docs/Color.md +0 -10
- data/docs/ConvertApi.md +0 -102
- data/docs/ConvertToPdf.md +0 -10
- data/docs/ConvertToPdfAction.md +0 -10
- data/docs/ConvertToPdfRes.md +0 -8
- data/docs/CreateImages.md +0 -10
- data/docs/CreateImagesRes.md +0 -8
- data/docs/CreatePdfA.md +0 -10
- data/docs/CreatePdfARes.md +0 -8
- data/docs/CustomCMSConfig.md +0 -23
- data/docs/DocAction.md +0 -8
- data/docs/DocLog.md +0 -12
- data/docs/DocMetadata.md +0 -16
- data/docs/Document.md +0 -16
- data/docs/DocumentApi.md +0 -203
- data/docs/DropDocumentReq.md +0 -20
- data/docs/DropDocumentRes.md +0 -15
- data/docs/ExecutionTrigger.md +0 -10
- data/docs/Extract.md +0 -10
- data/docs/ExtractAction.md +0 -9
- data/docs/ExtractApi.md +0 -102
- data/docs/ExtractRes.md +0 -8
- data/docs/GetDocumentListRes.md +0 -13
- data/docs/GetDocumentReq.md +0 -14
- data/docs/GetDocumentRes.md +0 -14
- data/docs/IFormFile.md +0 -13
- data/docs/Image.md +0 -15
- data/docs/ImageAction.md +0 -30
- data/docs/ImageApi.md +0 -107
- data/docs/Job.md +0 -10
- data/docs/JobApi.md +0 -197
- data/docs/JobConfig.md +0 -18
- data/docs/JobConfigRes.md +0 -8
- data/docs/KeyValuePairStringObject.md +0 -9
- data/docs/KeyValuePairStringString.md +0 -9
- data/docs/ManagementApi.md +0 -92
- data/docs/Merge.md +0 -10
- data/docs/MergeAction.md +0 -8
- data/docs/MergeApi.md +0 -102
- data/docs/MergeRes.md +0 -8
- data/docs/Notification.md +0 -9
- data/docs/OcrAction.md +0 -12
- data/docs/OcrApi.md +0 -57
- data/docs/Optimize.md +0 -10
- data/docs/OptimizeAction.md +0 -35
- data/docs/OptimizeApi.md +0 -103
- data/docs/OptimizeRes.md +0 -9
- data/docs/Page.md +0 -14
- data/docs/PageSelection.md +0 -10
- data/docs/Pdf4meAction.md +0 -12
- data/docs/Pdf4meDocument.md +0 -32
- data/docs/Pdf4meException.md +0 -8
- data/docs/PdfAAction.md +0 -14
- data/docs/PdfAApi.md +0 -102
- data/docs/PdfFont.md +0 -9
- data/docs/Pricing.md +0 -13
- data/docs/ProduceDocuments.md +0 -14
- data/docs/ProduceDocumentsRes.md +0 -8
- data/docs/ProduceOutput.md +0 -8
- data/docs/RGBSet.md +0 -10
- data/docs/RecognizeDocument.md +0 -10
- data/docs/RecognizeDocumentRes.md +0 -9
- data/docs/Rectangle.md +0 -11
- data/docs/Rotate.md +0 -10
- data/docs/RunJobRes.md +0 -10
- data/docs/SignatureConfig.md +0 -7
- data/docs/Split.md +0 -10
- data/docs/SplitAction.md +0 -11
- data/docs/SplitApi.md +0 -103
- data/docs/SplitRes.md +0 -8
- data/docs/Stamp.md +0 -10
- data/docs/StampAction.md +0 -22
- data/docs/StampApi.md +0 -110
- data/docs/StampRes.md +0 -8
- data/docs/StorageFolder.md +0 -10
- data/docs/Text.md +0 -17
- data/docs/Transform.md +0 -13
- data/docs/Translate.md +0 -9
- data/docs/UserFingerprint.md +0 -9
- data/docs/VersionRes.md +0 -8
- data/docs/java.md +0 -425
- data/lib/pdf4me/api/convert_api.rb +0 -130
- data/lib/pdf4me/api/document_api.rb +0 -218
- data/lib/pdf4me/api/extract_api.rb +0 -131
- data/lib/pdf4me/api/image_api.rb +0 -139
- data/lib/pdf4me/api/job_api.rb +0 -223
- data/lib/pdf4me/api/management_api.rb +0 -117
- data/lib/pdf4me/api/merge_api.rb +0 -131
- data/lib/pdf4me/api/ocr_api.rb +0 -74
- data/lib/pdf4me/api/optimize_api.rb +0 -139
- data/lib/pdf4me/api/pdf_a_api.rb +0 -134
- data/lib/pdf4me/api/split_api.rb +0 -135
- data/lib/pdf4me/api/stamp_api.rb +0 -159
- data/lib/pdf4me/api_client.rb +0 -380
- data/lib/pdf4me/api_error.rb +0 -38
- data/lib/pdf4me/models/action_flow.rb +0 -190
- data/lib/pdf4me/models/api_usage_res.rb +0 -219
- data/lib/pdf4me/models/archive_config.rb +0 -226
- data/lib/pdf4me/models/archive_job_req.rb +0 -249
- data/lib/pdf4me/models/archive_job_res.rb +0 -207
- data/lib/pdf4me/models/color.rb +0 -206
- data/lib/pdf4me/models/convert_to_pdf.rb +0 -209
- data/lib/pdf4me/models/create_images.rb +0 -209
- data/lib/pdf4me/models/create_images_res.rb +0 -189
- data/lib/pdf4me/models/create_pdf_a.rb +0 -209
- data/lib/pdf4me/models/create_pdf_a_res.rb +0 -189
- data/lib/pdf4me/models/custom_cms_config.rb +0 -323
- data/lib/pdf4me/models/doc_action.rb +0 -190
- data/lib/pdf4me/models/drop_document_req.rb +0 -348
- data/lib/pdf4me/models/drop_document_res.rb +0 -260
- data/lib/pdf4me/models/execution_trigger.rb +0 -206
- data/lib/pdf4me/models/extract.rb +0 -207
- data/lib/pdf4me/models/extract_action.rb +0 -201
- data/lib/pdf4me/models/extract_res.rb +0 -188
- data/lib/pdf4me/models/get_document_list_res.rb +0 -237
- data/lib/pdf4me/models/get_document_req.rb +0 -243
- data/lib/pdf4me/models/get_document_res.rb +0 -246
- data/lib/pdf4me/models/i_form_file.rb +0 -235
- data/lib/pdf4me/models/image.rb +0 -300
- data/lib/pdf4me/models/image_action.rb +0 -513
- data/lib/pdf4me/models/job.rb +0 -213
- data/lib/pdf4me/models/job_config.rb +0 -298
- data/lib/pdf4me/models/job_config_res.rb +0 -193
- data/lib/pdf4me/models/key_value_pair_string_object.rb +0 -197
- data/lib/pdf4me/models/key_value_pair_string_string.rb +0 -197
- data/lib/pdf4me/models/merge.rb +0 -209
- data/lib/pdf4me/models/merge_action.rb +0 -190
- data/lib/pdf4me/models/merge_res.rb +0 -188
- data/lib/pdf4me/models/ocr_action.rb +0 -259
- data/lib/pdf4me/models/optimize.rb +0 -209
- data/lib/pdf4me/models/page_selection.rb +0 -246
- data/lib/pdf4me/models/pdf4me_action.rb +0 -259
- data/lib/pdf4me/models/pdf4me_document.rb +0 -511
- data/lib/pdf4me/models/pdf4me_exception.rb +0 -189
- data/lib/pdf4me/models/pdf_a_action.rb +0 -297
- data/lib/pdf4me/models/pdf_font.rb +0 -213
- data/lib/pdf4me/models/pricing.rb +0 -278
- data/lib/pdf4me/models/produce_documents.rb +0 -251
- data/lib/pdf4me/models/produce_documents_res.rb +0 -191
- data/lib/pdf4me/models/produce_output.rb +0 -221
- data/lib/pdf4me/models/recognize_document.rb +0 -209
- data/lib/pdf4me/models/recognize_document_res.rb +0 -198
- data/lib/pdf4me/models/rectangle.rb +0 -215
- data/lib/pdf4me/models/rgb_set.rb +0 -206
- data/lib/pdf4me/models/rotate.rb +0 -221
- data/lib/pdf4me/models/run_job_res.rb +0 -215
- data/lib/pdf4me/models/signature_config.rb +0 -179
- data/lib/pdf4me/models/split.rb +0 -207
- data/lib/pdf4me/models/split_action.rb +0 -219
- data/lib/pdf4me/models/split_res.rb +0 -190
- data/lib/pdf4me/models/stamp.rb +0 -209
- data/lib/pdf4me/models/stamp_action.rb +0 -387
- data/lib/pdf4me/models/stamp_res.rb +0 -189
- data/lib/pdf4me/models/storage_folder.rb +0 -239
- data/lib/pdf4me/models/text.rb +0 -320
- data/lib/pdf4me/models/transform.rb +0 -263
- data/lib/pdf4me/models/translate.rb +0 -207
- data/lib/pdf4me/models/user_fingerprint.rb +0 -197
- data/lib/pdf4me/models/version_res.rb +0 -188
- data/pdf4me.gemspec +0 -47
- data/spec/api/convert_api_spec.rb +0 -60
- data/spec/api/document_api_spec.rb +0 -83
- data/spec/api/extract_api_spec.rb +0 -60
- data/spec/api/image_api_spec.rb +0 -62
- data/spec/api/job_api_spec.rb +0 -82
- data/spec/api/management_api_spec.rb +0 -57
- data/spec/api/merge_api_spec.rb +0 -60
- data/spec/api/ocr_api_spec.rb +0 -47
- data/spec/api/optimize_api_spec.rb +0 -60
- data/spec/api/pdf_a_api_spec.rb +0 -60
- data/spec/api/split_api_spec.rb +0 -60
- data/spec/api/stamp_api_spec.rb +0 -63
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/action_flow_spec.rb +0 -42
- data/spec/models/api_usage_res_spec.rb +0 -60
- data/spec/models/archive_config_spec.rb +0 -60
- data/spec/models/archive_job_req_spec.rb +0 -66
- data/spec/models/archive_job_res_spec.rb +0 -48
- data/spec/models/color_spec.rb +0 -54
- data/spec/models/convert_to_pdf_action_spec.rb +0 -62
- data/spec/models/convert_to_pdf_res_spec.rb +0 -42
- data/spec/models/convert_to_pdf_spec.rb +0 -54
- data/spec/models/create_images_res_spec.rb +0 -42
- data/spec/models/create_images_spec.rb +0 -54
- data/spec/models/create_pdf_a_res_spec.rb +0 -42
- data/spec/models/create_pdf_a_spec.rb +0 -54
- data/spec/models/custom_cms_config_spec.rb +0 -132
- data/spec/models/doc_action_spec.rb +0 -42
- data/spec/models/doc_log_spec.rb +0 -70
- data/spec/models/doc_metadata_spec.rb +0 -90
- data/spec/models/document_spec.rb +0 -90
- data/spec/models/drop_document_req_spec.rb +0 -118
- data/spec/models/drop_document_res_spec.rb +0 -84
- data/spec/models/execution_trigger_spec.rb +0 -54
- data/spec/models/extract_action_spec.rb +0 -48
- data/spec/models/extract_res_spec.rb +0 -42
- data/spec/models/extract_spec.rb +0 -54
- data/spec/models/get_document_list_res_spec.rb +0 -72
- data/spec/models/get_document_req_spec.rb +0 -78
- data/spec/models/get_document_res_spec.rb +0 -78
- data/spec/models/i_form_file_spec.rb +0 -72
- data/spec/models/image_action_spec.rb +0 -206
- data/spec/models/image_spec.rb +0 -88
- data/spec/models/job_config_res_spec.rb +0 -42
- data/spec/models/job_config_spec.rb +0 -102
- data/spec/models/job_spec.rb +0 -54
- data/spec/models/key_value_pair_string_object_spec.rb +0 -48
- data/spec/models/key_value_pair_string_string_spec.rb +0 -48
- data/spec/models/merge_action_spec.rb +0 -42
- data/spec/models/merge_res_spec.rb +0 -42
- data/spec/models/merge_spec.rb +0 -54
- data/spec/models/notification_spec.rb +0 -48
- data/spec/models/ocr_action_spec.rb +0 -70
- data/spec/models/optimize_action_spec.rb +0 -228
- data/spec/models/optimize_res_spec.rb +0 -48
- data/spec/models/optimize_spec.rb +0 -54
- data/spec/models/page_selection_spec.rb +0 -58
- data/spec/models/page_spec.rb +0 -78
- data/spec/models/pdf4me_action_spec.rb +0 -70
- data/spec/models/pdf4me_document_spec.rb +0 -202
- data/spec/models/pdf4me_exception_spec.rb +0 -42
- data/spec/models/pdf_a_action_spec.rb +0 -86
- data/spec/models/pdf_font_spec.rb +0 -48
- data/spec/models/pricing_spec.rb +0 -80
- data/spec/models/produce_documents_res_spec.rb +0 -42
- data/spec/models/produce_documents_spec.rb +0 -78
- data/spec/models/produce_output_spec.rb +0 -46
- data/spec/models/recognize_document_res_spec.rb +0 -48
- data/spec/models/recognize_document_spec.rb +0 -54
- data/spec/models/rectangle_spec.rb +0 -60
- data/spec/models/rgb_set_spec.rb +0 -54
- data/spec/models/rotate_spec.rb +0 -54
- data/spec/models/run_job_res_spec.rb +0 -54
- data/spec/models/signature_config_spec.rb +0 -36
- data/spec/models/split_action_spec.rb +0 -60
- data/spec/models/split_res_spec.rb +0 -42
- data/spec/models/split_spec.rb +0 -54
- data/spec/models/stamp_action_spec.rb +0 -142
- data/spec/models/stamp_res_spec.rb +0 -42
- data/spec/models/stamp_spec.rb +0 -54
- data/spec/models/storage_folder_spec.rb +0 -58
- data/spec/models/text_spec.rb +0 -104
- data/spec/models/transform_spec.rb +0 -72
- data/spec/models/translate_spec.rb +0 -48
- data/spec/models/user_fingerprint_spec.rb +0 -48
- data/spec/models/version_res_spec.rb +0 -42
@@ -1,60 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#DmsApi
|
3
|
-
|
4
|
-
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
-
|
6
|
-
OpenAPI spec version: v1
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
|
16
|
-
# Unit tests for Pdf4me::OptimizeApi
|
17
|
-
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
-
# Please update as you see appropriate
|
19
|
-
describe 'OptimizeApi' do
|
20
|
-
before do
|
21
|
-
# run before each test
|
22
|
-
@instance = Pdf4me::OptimizeApi.new
|
23
|
-
end
|
24
|
-
|
25
|
-
after do
|
26
|
-
# run after each test
|
27
|
-
end
|
28
|
-
|
29
|
-
describe 'test an instance of OptimizeApi' do
|
30
|
-
it 'should create an instance of OptimizeApi' do
|
31
|
-
expect(@instance).to be_instance_of(Pdf4me::OptimizeApi)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# unit tests for optimize
|
36
|
-
#
|
37
|
-
#
|
38
|
-
# @param [Hash] opts the optional parameters
|
39
|
-
# @option opts [Optimize] :req
|
40
|
-
# @return [OptimizeRes]
|
41
|
-
describe 'optimize test' do
|
42
|
-
it "should work" do
|
43
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# unit tests for optimize_by_profile
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# @param profile
|
51
|
-
# @param [Hash] opts the optional parameters
|
52
|
-
# @option opts [String] :file
|
53
|
-
# @return [File]
|
54
|
-
describe 'optimize_by_profile test' do
|
55
|
-
it "should work" do
|
56
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
data/spec/api/pdf_a_api_spec.rb
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#DmsApi
|
3
|
-
|
4
|
-
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
-
|
6
|
-
OpenAPI spec version: v1
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
|
16
|
-
# Unit tests for Pdf4me::PdfAApi
|
17
|
-
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
-
# Please update as you see appropriate
|
19
|
-
describe 'PdfAApi' do
|
20
|
-
before do
|
21
|
-
# run before each test
|
22
|
-
@instance = Pdf4me::PdfAApi.new
|
23
|
-
end
|
24
|
-
|
25
|
-
after do
|
26
|
-
# run after each test
|
27
|
-
end
|
28
|
-
|
29
|
-
describe 'test an instance of PdfAApi' do
|
30
|
-
it 'should create an instance of PdfAApi' do
|
31
|
-
expect(@instance).to be_instance_of(Pdf4me::PdfAApi)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# unit tests for create_pdf_a
|
36
|
-
#
|
37
|
-
#
|
38
|
-
# @param [Hash] opts the optional parameters
|
39
|
-
# @option opts [String] :pdf_compliance
|
40
|
-
# @option opts [String] :file
|
41
|
-
# @return [File]
|
42
|
-
describe 'create_pdf_a test' do
|
43
|
-
it "should work" do
|
44
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# unit tests for pdf_a
|
49
|
-
#
|
50
|
-
#
|
51
|
-
# @param [Hash] opts the optional parameters
|
52
|
-
# @option opts [CreatePdfA] :req
|
53
|
-
# @return [CreatePdfARes]
|
54
|
-
describe 'pdf_a test' do
|
55
|
-
it "should work" do
|
56
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
data/spec/api/split_api_spec.rb
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#DmsApi
|
3
|
-
|
4
|
-
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
-
|
6
|
-
OpenAPI spec version: v1
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
|
16
|
-
# Unit tests for Pdf4me::SplitApi
|
17
|
-
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
-
# Please update as you see appropriate
|
19
|
-
describe 'SplitApi' do
|
20
|
-
before do
|
21
|
-
# run before each test
|
22
|
-
@instance = Pdf4me::SplitApi.new
|
23
|
-
end
|
24
|
-
|
25
|
-
after do
|
26
|
-
# run after each test
|
27
|
-
end
|
28
|
-
|
29
|
-
describe 'test an instance of SplitApi' do
|
30
|
-
it 'should create an instance of SplitApi' do
|
31
|
-
expect(@instance).to be_instance_of(Pdf4me::SplitApi)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# unit tests for split
|
36
|
-
#
|
37
|
-
#
|
38
|
-
# @param [Hash] opts the optional parameters
|
39
|
-
# @option opts [Split] :req
|
40
|
-
# @return [SplitRes]
|
41
|
-
describe 'split test' do
|
42
|
-
it "should work" do
|
43
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# unit tests for split_by_page_nr
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# @param page_nr
|
51
|
-
# @param [Hash] opts the optional parameters
|
52
|
-
# @option opts [String] :file
|
53
|
-
# @return [SplitRes]
|
54
|
-
describe 'split_by_page_nr test' do
|
55
|
-
it "should work" do
|
56
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
data/spec/api/stamp_api_spec.rb
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#DmsApi
|
3
|
-
|
4
|
-
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
-
|
6
|
-
OpenAPI spec version: v1
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
|
16
|
-
# Unit tests for Pdf4me::StampApi
|
17
|
-
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
-
# Please update as you see appropriate
|
19
|
-
describe 'StampApi' do
|
20
|
-
before do
|
21
|
-
# run before each test
|
22
|
-
@instance = Pdf4me::StampApi.new
|
23
|
-
end
|
24
|
-
|
25
|
-
after do
|
26
|
-
# run after each test
|
27
|
-
end
|
28
|
-
|
29
|
-
describe 'test an instance of StampApi' do
|
30
|
-
it 'should create an instance of StampApi' do
|
31
|
-
expect(@instance).to be_instance_of(Pdf4me::StampApi)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# unit tests for stamp
|
36
|
-
#
|
37
|
-
#
|
38
|
-
# @param [Hash] opts the optional parameters
|
39
|
-
# @option opts [Stamp] :req
|
40
|
-
# @return [StampRes]
|
41
|
-
describe 'stamp test' do
|
42
|
-
it "should work" do
|
43
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# unit tests for text_stamp
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# @param align_x
|
51
|
-
# @param align_y
|
52
|
-
# @param [Hash] opts the optional parameters
|
53
|
-
# @option opts [String] :text
|
54
|
-
# @option opts [String] :pages
|
55
|
-
# @option opts [String] :file
|
56
|
-
# @return [File]
|
57
|
-
describe 'text_stamp test' do
|
58
|
-
it "should work" do
|
59
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
end
|
data/spec/api_client_spec.rb
DELETED
@@ -1,226 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#DmsApi
|
3
|
-
|
4
|
-
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
-
|
6
|
-
OpenAPI spec version: v1
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
|
15
|
-
describe Pdf4me::ApiClient do
|
16
|
-
context 'initialization' do
|
17
|
-
context 'URL stuff' do
|
18
|
-
context 'host' do
|
19
|
-
it 'removes http from host' do
|
20
|
-
Pdf4me.configure { |c| c.host = 'http://example.com' }
|
21
|
-
expect(Pdf4me::Configuration.default.host).to eq('example.com')
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'removes https from host' do
|
25
|
-
Pdf4me.configure { |c| c.host = 'https://wookiee.com' }
|
26
|
-
expect(Pdf4me::ApiClient.default.config.host).to eq('wookiee.com')
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'removes trailing path from host' do
|
30
|
-
Pdf4me.configure { |c| c.host = 'hobo.com/v4' }
|
31
|
-
expect(Pdf4me::Configuration.default.host).to eq('hobo.com')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context 'base_path' do
|
36
|
-
it "prepends a slash to base_path" do
|
37
|
-
Pdf4me.configure { |c| c.base_path = 'v4/dog' }
|
38
|
-
expect(Pdf4me::Configuration.default.base_path).to eq('/v4/dog')
|
39
|
-
end
|
40
|
-
|
41
|
-
it "doesn't prepend a slash if one is already there" do
|
42
|
-
Pdf4me.configure { |c| c.base_path = '/v4/dog' }
|
43
|
-
expect(Pdf4me::Configuration.default.base_path).to eq('/v4/dog')
|
44
|
-
end
|
45
|
-
|
46
|
-
it "ends up as a blank string if nil" do
|
47
|
-
Pdf4me.configure { |c| c.base_path = nil }
|
48
|
-
expect(Pdf4me::Configuration.default.base_path).to eq('')
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
describe "params_encoding in #build_request" do
|
55
|
-
let(:config) { Pdf4me::Configuration.new }
|
56
|
-
let(:api_client) { Pdf4me::ApiClient.new(config) }
|
57
|
-
|
58
|
-
it "defaults to nil" do
|
59
|
-
expect(Pdf4me::Configuration.default.params_encoding).to eq(nil)
|
60
|
-
expect(config.params_encoding).to eq(nil)
|
61
|
-
|
62
|
-
request = api_client.build_request(:get, '/test')
|
63
|
-
expect(request.options[:params_encoding]).to eq(nil)
|
64
|
-
end
|
65
|
-
|
66
|
-
it "can be customized" do
|
67
|
-
config.params_encoding = :multi
|
68
|
-
request = api_client.build_request(:get, '/test')
|
69
|
-
expect(request.options[:params_encoding]).to eq(:multi)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
describe "timeout in #build_request" do
|
74
|
-
let(:config) { Pdf4me::Configuration.new }
|
75
|
-
let(:api_client) { Pdf4me::ApiClient.new(config) }
|
76
|
-
|
77
|
-
it "defaults to 0" do
|
78
|
-
expect(Pdf4me::Configuration.default.timeout).to eq(0)
|
79
|
-
expect(config.timeout).to eq(0)
|
80
|
-
|
81
|
-
request = api_client.build_request(:get, '/test')
|
82
|
-
expect(request.options[:timeout]).to eq(0)
|
83
|
-
end
|
84
|
-
|
85
|
-
it "can be customized" do
|
86
|
-
config.timeout = 100
|
87
|
-
request = api_client.build_request(:get, '/test')
|
88
|
-
expect(request.options[:timeout]).to eq(100)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
describe "#deserialize" do
|
93
|
-
it "handles Array<Integer>" do
|
94
|
-
api_client = Pdf4me::ApiClient.new
|
95
|
-
headers = {'Content-Type' => 'application/json'}
|
96
|
-
response = double('response', headers: headers, body: '[12, 34]')
|
97
|
-
data = api_client.deserialize(response, 'Array<Integer>')
|
98
|
-
expect(data).to be_instance_of(Array)
|
99
|
-
expect(data).to eq([12, 34])
|
100
|
-
end
|
101
|
-
|
102
|
-
it "handles Array<Array<Integer>>" do
|
103
|
-
api_client = Pdf4me::ApiClient.new
|
104
|
-
headers = {'Content-Type' => 'application/json'}
|
105
|
-
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
106
|
-
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
107
|
-
expect(data).to be_instance_of(Array)
|
108
|
-
expect(data).to eq([[12, 34], [56]])
|
109
|
-
end
|
110
|
-
|
111
|
-
it "handles Hash<String, String>" do
|
112
|
-
api_client = Pdf4me::ApiClient.new
|
113
|
-
headers = {'Content-Type' => 'application/json'}
|
114
|
-
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
115
|
-
data = api_client.deserialize(response, 'Hash<String, String>')
|
116
|
-
expect(data).to be_instance_of(Hash)
|
117
|
-
expect(data).to eq({:message => 'Hello'})
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
describe "#object_to_hash" do
|
122
|
-
it "ignores nils and includes empty arrays" do
|
123
|
-
# uncomment below to test object_to_hash for model
|
124
|
-
#api_client = Pdf4me::ApiClient.new
|
125
|
-
#_model = Pdf4me::ModelName.new
|
126
|
-
# update the model attribute below
|
127
|
-
#_model.id = 1
|
128
|
-
# update the expected value (hash) below
|
129
|
-
#expected = {id: 1, name: '', tags: []}
|
130
|
-
#expect(api_client.object_to_hash(_model)).to eq(expected)
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
describe "#build_collection_param" do
|
135
|
-
let(:param) { ['aa', 'bb', 'cc'] }
|
136
|
-
let(:api_client) { Pdf4me::ApiClient.new }
|
137
|
-
|
138
|
-
it "works for csv" do
|
139
|
-
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
140
|
-
end
|
141
|
-
|
142
|
-
it "works for ssv" do
|
143
|
-
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
144
|
-
end
|
145
|
-
|
146
|
-
it "works for tsv" do
|
147
|
-
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
148
|
-
end
|
149
|
-
|
150
|
-
it "works for pipes" do
|
151
|
-
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
152
|
-
end
|
153
|
-
|
154
|
-
it "works for multi" do
|
155
|
-
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
156
|
-
end
|
157
|
-
|
158
|
-
it "fails for invalid collection format" do
|
159
|
-
expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
describe "#json_mime?" do
|
164
|
-
let(:api_client) { Pdf4me::ApiClient.new }
|
165
|
-
|
166
|
-
it "works" do
|
167
|
-
expect(api_client.json_mime?(nil)).to eq false
|
168
|
-
expect(api_client.json_mime?('')).to eq false
|
169
|
-
|
170
|
-
expect(api_client.json_mime?('application/json')).to eq true
|
171
|
-
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
172
|
-
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
173
|
-
|
174
|
-
expect(api_client.json_mime?('application/xml')).to eq false
|
175
|
-
expect(api_client.json_mime?('text/plain')).to eq false
|
176
|
-
expect(api_client.json_mime?('application/jsonp')).to eq false
|
177
|
-
end
|
178
|
-
end
|
179
|
-
|
180
|
-
describe "#select_header_accept" do
|
181
|
-
let(:api_client) { Pdf4me::ApiClient.new }
|
182
|
-
|
183
|
-
it "works" do
|
184
|
-
expect(api_client.select_header_accept(nil)).to be_nil
|
185
|
-
expect(api_client.select_header_accept([])).to be_nil
|
186
|
-
|
187
|
-
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
188
|
-
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
189
|
-
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
190
|
-
|
191
|
-
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
192
|
-
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
describe "#select_header_content_type" do
|
197
|
-
let(:api_client) { Pdf4me::ApiClient.new }
|
198
|
-
|
199
|
-
it "works" do
|
200
|
-
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
201
|
-
expect(api_client.select_header_content_type([])).to eq('application/json')
|
202
|
-
|
203
|
-
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
204
|
-
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
205
|
-
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
206
|
-
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
207
|
-
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
|
-
describe "#sanitize_filename" do
|
212
|
-
let(:api_client) { Pdf4me::ApiClient.new }
|
213
|
-
|
214
|
-
it "works" do
|
215
|
-
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
216
|
-
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
217
|
-
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
218
|
-
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
219
|
-
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
220
|
-
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
221
|
-
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
222
|
-
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
223
|
-
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
224
|
-
end
|
225
|
-
end
|
226
|
-
end
|