cloudmersive-convert-api-client 1.5.9 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -4
- data/docs/SplitDocumentApi.md +61 -2
- data/docs/SplitDocumentResult.md +10 -0
- data/docs/SplitDocxDocumentResult.md +9 -0
- data/lib/cloudmersive-convert-api-client.rb +2 -0
- data/lib/cloudmersive-convert-api-client/api/split_document_api.rb +61 -2
- data/lib/cloudmersive-convert-api-client/models/split_document_result.rb +225 -0
- data/lib/cloudmersive-convert-api-client/models/split_docx_document_result.rb +200 -0
- data/lib/cloudmersive-convert-api-client/version.rb +1 -1
- data/spec/api/split_document_api_spec.rb +14 -1
- data/spec/models/split_document_result_spec.rb +54 -0
- data/spec/models/split_docx_document_result_spec.rb +48 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bc136756aa34717f5cf5e54d84e554aec53ee59b88eea57ebb69df436887a10
|
4
|
+
data.tar.gz: be3965f7188826efbd429b9cad94e8a9155c70b8740e3c2cd5a1fc1c3bb57287
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a44e3c4d9679980936502f9c8f61ba1d8aca8be483c6e916099cf08bf3abfa3dee29f7fe1356668f70e44319c27cc95553647b875bd47f8dff3f2e7ad510d7a
|
7
|
+
data.tar.gz: 2835682855bce70a93712ca6c69d67db4bdcd6d6bc72c038734679ef73675c4b07df32d83e67acfec0fe633331bfc90deec383a1c7179ced9e28e62c98efe8b0
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Convert API lets you effortlessly convert file formats and types.
|
|
7
7
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
8
|
|
9
9
|
- API version: v1
|
10
|
-
- Package version: 1.
|
10
|
+
- Package version: 1.6.0
|
11
11
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
12
12
|
|
13
13
|
## Installation
|
@@ -23,15 +23,15 @@ gem build cloudmersive-convert-api-client.gemspec
|
|
23
23
|
Then either install the gem locally:
|
24
24
|
|
25
25
|
```shell
|
26
|
-
gem install ./cloudmersive-convert-api-client-1.
|
26
|
+
gem install ./cloudmersive-convert-api-client-1.6.0.gem
|
27
27
|
```
|
28
|
-
(for development, run `gem install --dev ./cloudmersive-convert-api-client-1.
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-convert-api-client-1.6.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 'cloudmersive-convert-api-client', '~> 1.
|
34
|
+
gem 'cloudmersive-convert-api-client', '~> 1.6.0'
|
35
35
|
|
36
36
|
### Install from Git
|
37
37
|
|
@@ -207,6 +207,7 @@ Class | Method | HTTP request | Description
|
|
207
207
|
*CloudmersiveConvertApiClient::MergeDocumentApi* | [**merge_document_pptx_multi**](docs/MergeDocumentApi.md#merge_document_pptx_multi) | **POST** /convert/merge/pptx/multi | Merge Multple PowerPoint PPTX Together
|
208
208
|
*CloudmersiveConvertApiClient::MergeDocumentApi* | [**merge_document_xlsx**](docs/MergeDocumentApi.md#merge_document_xlsx) | **POST** /convert/merge/xlsx | Merge Two Excel XLSX Together
|
209
209
|
*CloudmersiveConvertApiClient::MergeDocumentApi* | [**merge_document_xlsx_multi**](docs/MergeDocumentApi.md#merge_document_xlsx_multi) | **POST** /convert/merge/xlsx/multi | Merge Multple Excel XLSX Together
|
210
|
+
*CloudmersiveConvertApiClient::SplitDocumentApi* | [**split_document_docx**](docs/SplitDocumentApi.md#split_document_docx) | **POST** /convert/split/docx | Split a single Word Document DOCX into Separate Documents by Page
|
210
211
|
*CloudmersiveConvertApiClient::SplitDocumentApi* | [**split_document_pdf_by_page**](docs/SplitDocumentApi.md#split_document_pdf_by_page) | **POST** /convert/split/pdf | Split a PDF file into separate PDF files, one per page
|
211
212
|
*CloudmersiveConvertApiClient::SplitDocumentApi* | [**split_document_pptx**](docs/SplitDocumentApi.md#split_document_pptx) | **POST** /convert/split/pptx | Split a single PowerPoint Presentation PPTX into Separate Slides
|
212
213
|
*CloudmersiveConvertApiClient::SplitDocumentApi* | [**split_document_xlsx**](docs/SplitDocumentApi.md#split_document_xlsx) | **POST** /convert/split/xlsx | Split a single Excel XLSX into Separate Worksheets
|
@@ -333,6 +334,8 @@ Class | Method | HTTP request | Description
|
|
333
334
|
- [CloudmersiveConvertApiClient::SetFormFieldValue](docs/SetFormFieldValue.md)
|
334
335
|
- [CloudmersiveConvertApiClient::SetPdfFormFieldsRequest](docs/SetPdfFormFieldsRequest.md)
|
335
336
|
- [CloudmersiveConvertApiClient::SetPdfMetadataRequest](docs/SetPdfMetadataRequest.md)
|
337
|
+
- [CloudmersiveConvertApiClient::SplitDocumentResult](docs/SplitDocumentResult.md)
|
338
|
+
- [CloudmersiveConvertApiClient::SplitDocxDocumentResult](docs/SplitDocxDocumentResult.md)
|
336
339
|
- [CloudmersiveConvertApiClient::SplitPdfResult](docs/SplitPdfResult.md)
|
337
340
|
- [CloudmersiveConvertApiClient::SplitPptxPresentationResult](docs/SplitPptxPresentationResult.md)
|
338
341
|
- [CloudmersiveConvertApiClient::SplitXlsxWorksheetResult](docs/SplitXlsxWorksheetResult.md)
|
data/docs/SplitDocumentApi.md
CHANGED
@@ -4,11 +4,70 @@ All URIs are relative to *https://api.cloudmersive.com*
|
|
4
4
|
|
5
5
|
Method | HTTP request | Description
|
6
6
|
------------- | ------------- | -------------
|
7
|
+
[**split_document_docx**](SplitDocumentApi.md#split_document_docx) | **POST** /convert/split/docx | Split a single Word Document DOCX into Separate Documents by Page
|
7
8
|
[**split_document_pdf_by_page**](SplitDocumentApi.md#split_document_pdf_by_page) | **POST** /convert/split/pdf | Split a PDF file into separate PDF files, one per page
|
8
9
|
[**split_document_pptx**](SplitDocumentApi.md#split_document_pptx) | **POST** /convert/split/pptx | Split a single PowerPoint Presentation PPTX into Separate Slides
|
9
10
|
[**split_document_xlsx**](SplitDocumentApi.md#split_document_xlsx) | **POST** /convert/split/xlsx | Split a single Excel XLSX into Separate Worksheets
|
10
11
|
|
11
12
|
|
13
|
+
# **split_document_docx**
|
14
|
+
> SplitDocxDocumentResult split_document_docx(input_file, opts)
|
15
|
+
|
16
|
+
Split a single Word Document DOCX into Separate Documents by Page
|
17
|
+
|
18
|
+
Split a Word DOCX Document, comprised of multiple pages into separate Word DOCX document files, with each containing exactly one page.
|
19
|
+
|
20
|
+
### Example
|
21
|
+
```ruby
|
22
|
+
# load the gem
|
23
|
+
require 'cloudmersive-convert-api-client'
|
24
|
+
# setup authorization
|
25
|
+
CloudmersiveConvertApiClient.configure do |config|
|
26
|
+
# Configure API key authorization: Apikey
|
27
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
28
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
29
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
30
|
+
end
|
31
|
+
|
32
|
+
api_instance = CloudmersiveConvertApiClient::SplitDocumentApi.new
|
33
|
+
|
34
|
+
input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
|
35
|
+
|
36
|
+
opts = {
|
37
|
+
return_document_contents: true # BOOLEAN | Set to true to return the contents of each Worksheet directly, set to false to only return URLs to each resulting document. Default is true.
|
38
|
+
}
|
39
|
+
|
40
|
+
begin
|
41
|
+
#Split a single Word Document DOCX into Separate Documents by Page
|
42
|
+
result = api_instance.split_document_docx(input_file, opts)
|
43
|
+
p result
|
44
|
+
rescue CloudmersiveConvertApiClient::ApiError => e
|
45
|
+
puts "Exception when calling SplitDocumentApi->split_document_docx: #{e}"
|
46
|
+
end
|
47
|
+
```
|
48
|
+
|
49
|
+
### Parameters
|
50
|
+
|
51
|
+
Name | Type | Description | Notes
|
52
|
+
------------- | ------------- | ------------- | -------------
|
53
|
+
**input_file** | **File**| Input file to perform the operation on. |
|
54
|
+
**return_document_contents** | **BOOLEAN**| Set to true to return the contents of each Worksheet directly, set to false to only return URLs to each resulting document. Default is true. | [optional]
|
55
|
+
|
56
|
+
### Return type
|
57
|
+
|
58
|
+
[**SplitDocxDocumentResult**](SplitDocxDocumentResult.md)
|
59
|
+
|
60
|
+
### Authorization
|
61
|
+
|
62
|
+
[Apikey](../README.md#Apikey)
|
63
|
+
|
64
|
+
### HTTP request headers
|
65
|
+
|
66
|
+
- **Content-Type**: multipart/form-data
|
67
|
+
- **Accept**: application/json, text/json, application/xml, text/xml
|
68
|
+
|
69
|
+
|
70
|
+
|
12
71
|
# **split_document_pdf_by_page**
|
13
72
|
> SplitPdfResult split_document_pdf_by_page(input_file, opts)
|
14
73
|
|
@@ -91,7 +150,7 @@ api_instance = CloudmersiveConvertApiClient::SplitDocumentApi.new
|
|
91
150
|
input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
|
92
151
|
|
93
152
|
opts = {
|
94
|
-
return_document_contents: true # BOOLEAN | Set to true to return the contents of each
|
153
|
+
return_document_contents: true # BOOLEAN | Set to true to return the contents of each presentation directly, set to false to only return URLs to each resulting presentation. Default is true.
|
95
154
|
}
|
96
155
|
|
97
156
|
begin
|
@@ -108,7 +167,7 @@ end
|
|
108
167
|
Name | Type | Description | Notes
|
109
168
|
------------- | ------------- | ------------- | -------------
|
110
169
|
**input_file** | **File**| Input file to perform the operation on. |
|
111
|
-
**return_document_contents** | **BOOLEAN**| Set to true to return the contents of each
|
170
|
+
**return_document_contents** | **BOOLEAN**| Set to true to return the contents of each presentation directly, set to false to only return URLs to each resulting presentation. Default is true. | [optional]
|
112
171
|
|
113
172
|
### Return type
|
114
173
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# CloudmersiveConvertApiClient::SplitDocumentResult
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**page_number** | **Integer** | Page number of the converted page, starting with 1 for the first page | [optional]
|
7
|
+
**url** | **String** | URL to the DOCX file of this slide; file is stored in an in-memory cache and will be deleted | [optional]
|
8
|
+
**document_contents** | **String** | Contents of the document in bytes | [optional]
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CloudmersiveConvertApiClient::SplitDocxDocumentResult
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**result_documents** | [**Array<SplitDocumentResult>**](SplitDocumentResult.md) | | [optional]
|
7
|
+
**successful** | **BOOLEAN** | True if the operation was successful, false otherwise | [optional]
|
8
|
+
|
9
|
+
|
@@ -127,6 +127,8 @@ require 'cloudmersive-convert-api-client/models/screenshot_request'
|
|
127
127
|
require 'cloudmersive-convert-api-client/models/set_form_field_value'
|
128
128
|
require 'cloudmersive-convert-api-client/models/set_pdf_form_fields_request'
|
129
129
|
require 'cloudmersive-convert-api-client/models/set_pdf_metadata_request'
|
130
|
+
require 'cloudmersive-convert-api-client/models/split_document_result'
|
131
|
+
require 'cloudmersive-convert-api-client/models/split_docx_document_result'
|
130
132
|
require 'cloudmersive-convert-api-client/models/split_pdf_result'
|
131
133
|
require 'cloudmersive-convert-api-client/models/split_pptx_presentation_result'
|
132
134
|
require 'cloudmersive-convert-api-client/models/split_xlsx_worksheet_result'
|
@@ -20,6 +20,65 @@ module CloudmersiveConvertApiClient
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
|
23
|
+
# Split a single Word Document DOCX into Separate Documents by Page
|
24
|
+
# Split a Word DOCX Document, comprised of multiple pages into separate Word DOCX document files, with each containing exactly one page.
|
25
|
+
# @param input_file Input file to perform the operation on.
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @option opts [BOOLEAN] :return_document_contents Set to true to return the contents of each Worksheet directly, set to false to only return URLs to each resulting document. Default is true.
|
28
|
+
# @return [SplitDocxDocumentResult]
|
29
|
+
def split_document_docx(input_file, opts = {})
|
30
|
+
data, _status_code, _headers = split_document_docx_with_http_info(input_file, opts)
|
31
|
+
return data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Split a single Word Document DOCX into Separate Documents by Page
|
35
|
+
# Split a Word DOCX Document, comprised of multiple pages into separate Word DOCX document files, with each containing exactly one page.
|
36
|
+
# @param input_file Input file to perform the operation on.
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [BOOLEAN] :return_document_contents Set to true to return the contents of each Worksheet directly, set to false to only return URLs to each resulting document. Default is true.
|
39
|
+
# @return [Array<(SplitDocxDocumentResult, Fixnum, Hash)>] SplitDocxDocumentResult data, response status code and response headers
|
40
|
+
def split_document_docx_with_http_info(input_file, opts = {})
|
41
|
+
if @api_client.config.debugging
|
42
|
+
@api_client.config.logger.debug "Calling API: SplitDocumentApi.split_document_docx ..."
|
43
|
+
end
|
44
|
+
# verify the required parameter 'input_file' is set
|
45
|
+
if @api_client.config.client_side_validation && input_file.nil?
|
46
|
+
fail ArgumentError, "Missing the required parameter 'input_file' when calling SplitDocumentApi.split_document_docx"
|
47
|
+
end
|
48
|
+
# resource path
|
49
|
+
local_var_path = "/convert/split/docx"
|
50
|
+
|
51
|
+
# query parameters
|
52
|
+
query_params = {}
|
53
|
+
|
54
|
+
# header parameters
|
55
|
+
header_params = {}
|
56
|
+
# HTTP header 'Accept' (if needed)
|
57
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
58
|
+
# HTTP header 'Content-Type'
|
59
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
60
|
+
header_params[:'returnDocumentContents'] = opts[:'return_document_contents'] if !opts[:'return_document_contents'].nil?
|
61
|
+
|
62
|
+
# form parameters
|
63
|
+
form_params = {}
|
64
|
+
form_params["inputFile"] = input_file
|
65
|
+
|
66
|
+
# http body (model)
|
67
|
+
post_body = nil
|
68
|
+
auth_names = ['Apikey']
|
69
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
70
|
+
:header_params => header_params,
|
71
|
+
:query_params => query_params,
|
72
|
+
:form_params => form_params,
|
73
|
+
:body => post_body,
|
74
|
+
:auth_names => auth_names,
|
75
|
+
:return_type => 'SplitDocxDocumentResult')
|
76
|
+
if @api_client.config.debugging
|
77
|
+
@api_client.config.logger.debug "API called: SplitDocumentApi#split_document_docx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
78
|
+
end
|
79
|
+
return data, status_code, headers
|
80
|
+
end
|
81
|
+
|
23
82
|
# Split a PDF file into separate PDF files, one per page
|
24
83
|
# Split an input PDF file into separate pages, comprised of one PDF file per page.
|
25
84
|
# @param input_file Input file to perform the operation on.
|
@@ -83,7 +142,7 @@ module CloudmersiveConvertApiClient
|
|
83
142
|
# Split an PowerPoint PPTX Presentation, comprised of multiple slides into separate PowerPoint PPTX presentation files, with each containing exactly one slide.
|
84
143
|
# @param input_file Input file to perform the operation on.
|
85
144
|
# @param [Hash] opts the optional parameters
|
86
|
-
# @option opts [BOOLEAN] :return_document_contents Set to true to return the contents of each
|
145
|
+
# @option opts [BOOLEAN] :return_document_contents Set to true to return the contents of each presentation directly, set to false to only return URLs to each resulting presentation. Default is true.
|
87
146
|
# @return [SplitPptxPresentationResult]
|
88
147
|
def split_document_pptx(input_file, opts = {})
|
89
148
|
data, _status_code, _headers = split_document_pptx_with_http_info(input_file, opts)
|
@@ -94,7 +153,7 @@ module CloudmersiveConvertApiClient
|
|
94
153
|
# Split an PowerPoint PPTX Presentation, comprised of multiple slides into separate PowerPoint PPTX presentation files, with each containing exactly one slide.
|
95
154
|
# @param input_file Input file to perform the operation on.
|
96
155
|
# @param [Hash] opts the optional parameters
|
97
|
-
# @option opts [BOOLEAN] :return_document_contents Set to true to return the contents of each
|
156
|
+
# @option opts [BOOLEAN] :return_document_contents Set to true to return the contents of each presentation directly, set to false to only return URLs to each resulting presentation. Default is true.
|
98
157
|
# @return [Array<(SplitPptxPresentationResult, Fixnum, Hash)>] SplitPptxPresentationResult data, response status code and response headers
|
99
158
|
def split_document_pptx_with_http_info(input_file, opts = {})
|
100
159
|
if @api_client.config.debugging
|
@@ -0,0 +1,225 @@
|
|
1
|
+
=begin
|
2
|
+
#convertapi
|
3
|
+
|
4
|
+
#Convert API lets you effortlessly convert file formats and types.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CloudmersiveConvertApiClient
|
16
|
+
# A single Word DOCX file corresponding to one page in the original document
|
17
|
+
class SplitDocumentResult
|
18
|
+
# Page number of the converted page, starting with 1 for the first page
|
19
|
+
attr_accessor :page_number
|
20
|
+
|
21
|
+
# URL to the DOCX file of this slide; file is stored in an in-memory cache and will be deleted
|
22
|
+
attr_accessor :url
|
23
|
+
|
24
|
+
# Contents of the document in bytes
|
25
|
+
attr_accessor :document_contents
|
26
|
+
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'page_number' => :'PageNumber',
|
32
|
+
:'url' => :'URL',
|
33
|
+
:'document_contents' => :'DocumentContents'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.swagger_types
|
39
|
+
{
|
40
|
+
:'page_number' => :'Integer',
|
41
|
+
:'url' => :'String',
|
42
|
+
:'document_contents' => :'String'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
return unless attributes.is_a?(Hash)
|
50
|
+
|
51
|
+
# convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
53
|
+
|
54
|
+
if attributes.has_key?(:'PageNumber')
|
55
|
+
self.page_number = attributes[:'PageNumber']
|
56
|
+
end
|
57
|
+
|
58
|
+
if attributes.has_key?(:'URL')
|
59
|
+
self.url = attributes[:'URL']
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes.has_key?(:'DocumentContents')
|
63
|
+
self.document_contents = attributes[:'DocumentContents']
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
69
|
+
# @return Array for valid properties with the reasons
|
70
|
+
def list_invalid_properties
|
71
|
+
invalid_properties = Array.new
|
72
|
+
if !@document_contents.nil? && @document_contents !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
|
73
|
+
invalid_properties.push("invalid value for 'document_contents', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.")
|
74
|
+
end
|
75
|
+
|
76
|
+
return invalid_properties
|
77
|
+
end
|
78
|
+
|
79
|
+
# Check to see if the all the properties in the model are valid
|
80
|
+
# @return true if the model is valid
|
81
|
+
def valid?
|
82
|
+
return false if !@document_contents.nil? && @document_contents !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
|
83
|
+
return true
|
84
|
+
end
|
85
|
+
|
86
|
+
# Custom attribute writer method with validation
|
87
|
+
# @param [Object] document_contents Value to be assigned
|
88
|
+
def document_contents=(document_contents)
|
89
|
+
|
90
|
+
if !document_contents.nil? && document_contents !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
|
91
|
+
fail ArgumentError, "invalid value for 'document_contents', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."
|
92
|
+
end
|
93
|
+
|
94
|
+
@document_contents = document_contents
|
95
|
+
end
|
96
|
+
|
97
|
+
# Checks equality by comparing each attribute.
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def ==(o)
|
100
|
+
return true if self.equal?(o)
|
101
|
+
self.class == o.class &&
|
102
|
+
page_number == o.page_number &&
|
103
|
+
url == o.url &&
|
104
|
+
document_contents == o.document_contents
|
105
|
+
end
|
106
|
+
|
107
|
+
# @see the `==` method
|
108
|
+
# @param [Object] Object to be compared
|
109
|
+
def eql?(o)
|
110
|
+
self == o
|
111
|
+
end
|
112
|
+
|
113
|
+
# Calculates hash code according to all attributes.
|
114
|
+
# @return [Fixnum] Hash code
|
115
|
+
def hash
|
116
|
+
[page_number, url, document_contents].hash
|
117
|
+
end
|
118
|
+
|
119
|
+
# Builds the object from hash
|
120
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
121
|
+
# @return [Object] Returns the model itself
|
122
|
+
def build_from_hash(attributes)
|
123
|
+
return nil unless attributes.is_a?(Hash)
|
124
|
+
self.class.swagger_types.each_pair do |key, type|
|
125
|
+
if type =~ /\AArray<(.*)>/i
|
126
|
+
# check to ensure the input is an array given that the the attribute
|
127
|
+
# is documented as an array but the input is not
|
128
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
129
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
130
|
+
end
|
131
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
132
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
133
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
134
|
+
end
|
135
|
+
|
136
|
+
self
|
137
|
+
end
|
138
|
+
|
139
|
+
# Deserializes the data based on type
|
140
|
+
# @param string type Data type
|
141
|
+
# @param string value Value to be deserialized
|
142
|
+
# @return [Object] Deserialized data
|
143
|
+
def _deserialize(type, value)
|
144
|
+
case type.to_sym
|
145
|
+
when :DateTime
|
146
|
+
DateTime.parse(value)
|
147
|
+
when :Date
|
148
|
+
Date.parse(value)
|
149
|
+
when :String
|
150
|
+
value.to_s
|
151
|
+
when :Integer
|
152
|
+
value.to_i
|
153
|
+
when :Float
|
154
|
+
value.to_f
|
155
|
+
when :BOOLEAN
|
156
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
157
|
+
true
|
158
|
+
else
|
159
|
+
false
|
160
|
+
end
|
161
|
+
when :Object
|
162
|
+
# generic object (usually a Hash), return directly
|
163
|
+
value
|
164
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
165
|
+
inner_type = Regexp.last_match[:inner_type]
|
166
|
+
value.map { |v| _deserialize(inner_type, v) }
|
167
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
168
|
+
k_type = Regexp.last_match[:k_type]
|
169
|
+
v_type = Regexp.last_match[:v_type]
|
170
|
+
{}.tap do |hash|
|
171
|
+
value.each do |k, v|
|
172
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
else # model
|
176
|
+
temp_model = CloudmersiveConvertApiClient.const_get(type).new
|
177
|
+
temp_model.build_from_hash(value)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Returns the string representation of the object
|
182
|
+
# @return [String] String presentation of the object
|
183
|
+
def to_s
|
184
|
+
to_hash.to_s
|
185
|
+
end
|
186
|
+
|
187
|
+
# to_body is an alias to to_hash (backward compatibility)
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_body
|
190
|
+
to_hash
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the object in the form of hash
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
195
|
+
def to_hash
|
196
|
+
hash = {}
|
197
|
+
self.class.attribute_map.each_pair do |attr, param|
|
198
|
+
value = self.send(attr)
|
199
|
+
next if value.nil?
|
200
|
+
hash[param] = _to_hash(value)
|
201
|
+
end
|
202
|
+
hash
|
203
|
+
end
|
204
|
+
|
205
|
+
# Outputs non-array value in the form of hash
|
206
|
+
# For object, use to_hash. Otherwise, just return the value
|
207
|
+
# @param [Object] value Any valid value
|
208
|
+
# @return [Hash] Returns the value in the form of hash
|
209
|
+
def _to_hash(value)
|
210
|
+
if value.is_a?(Array)
|
211
|
+
value.compact.map{ |v| _to_hash(v) }
|
212
|
+
elsif value.is_a?(Hash)
|
213
|
+
{}.tap do |hash|
|
214
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
215
|
+
end
|
216
|
+
elsif value.respond_to? :to_hash
|
217
|
+
value.to_hash
|
218
|
+
else
|
219
|
+
value
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
224
|
+
|
225
|
+
end
|
@@ -0,0 +1,200 @@
|
|
1
|
+
=begin
|
2
|
+
#convertapi
|
3
|
+
|
4
|
+
#Convert API lets you effortlessly convert file formats and types.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CloudmersiveConvertApiClient
|
16
|
+
# The result of splitting a Word document into individual Word DOCX pages
|
17
|
+
class SplitDocxDocumentResult
|
18
|
+
attr_accessor :result_documents
|
19
|
+
|
20
|
+
# True if the operation was successful, false otherwise
|
21
|
+
attr_accessor :successful
|
22
|
+
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'result_documents' => :'ResultDocuments',
|
28
|
+
:'successful' => :'Successful'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.swagger_types
|
34
|
+
{
|
35
|
+
:'result_documents' => :'Array<SplitDocumentResult>',
|
36
|
+
:'successful' => :'BOOLEAN'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
return unless attributes.is_a?(Hash)
|
44
|
+
|
45
|
+
# convert string to symbol for hash key
|
46
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
47
|
+
|
48
|
+
if attributes.has_key?(:'ResultDocuments')
|
49
|
+
if (value = attributes[:'ResultDocuments']).is_a?(Array)
|
50
|
+
self.result_documents = value
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
if attributes.has_key?(:'Successful')
|
55
|
+
self.successful = attributes[:'Successful']
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
61
|
+
# @return Array for valid properties with the reasons
|
62
|
+
def list_invalid_properties
|
63
|
+
invalid_properties = Array.new
|
64
|
+
return invalid_properties
|
65
|
+
end
|
66
|
+
|
67
|
+
# Check to see if the all the properties in the model are valid
|
68
|
+
# @return true if the model is valid
|
69
|
+
def valid?
|
70
|
+
return true
|
71
|
+
end
|
72
|
+
|
73
|
+
# Checks equality by comparing each attribute.
|
74
|
+
# @param [Object] Object to be compared
|
75
|
+
def ==(o)
|
76
|
+
return true if self.equal?(o)
|
77
|
+
self.class == o.class &&
|
78
|
+
result_documents == o.result_documents &&
|
79
|
+
successful == o.successful
|
80
|
+
end
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def eql?(o)
|
85
|
+
self == o
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
# @return [Fixnum] Hash code
|
90
|
+
def hash
|
91
|
+
[result_documents, successful].hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def build_from_hash(attributes)
|
98
|
+
return nil unless attributes.is_a?(Hash)
|
99
|
+
self.class.swagger_types.each_pair do |key, type|
|
100
|
+
if type =~ /\AArray<(.*)>/i
|
101
|
+
# check to ensure the input is an array given that the the attribute
|
102
|
+
# is documented as an array but the input is not
|
103
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
104
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
105
|
+
end
|
106
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
107
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
108
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
109
|
+
end
|
110
|
+
|
111
|
+
self
|
112
|
+
end
|
113
|
+
|
114
|
+
# Deserializes the data based on type
|
115
|
+
# @param string type Data type
|
116
|
+
# @param string value Value to be deserialized
|
117
|
+
# @return [Object] Deserialized data
|
118
|
+
def _deserialize(type, value)
|
119
|
+
case type.to_sym
|
120
|
+
when :DateTime
|
121
|
+
DateTime.parse(value)
|
122
|
+
when :Date
|
123
|
+
Date.parse(value)
|
124
|
+
when :String
|
125
|
+
value.to_s
|
126
|
+
when :Integer
|
127
|
+
value.to_i
|
128
|
+
when :Float
|
129
|
+
value.to_f
|
130
|
+
when :BOOLEAN
|
131
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
132
|
+
true
|
133
|
+
else
|
134
|
+
false
|
135
|
+
end
|
136
|
+
when :Object
|
137
|
+
# generic object (usually a Hash), return directly
|
138
|
+
value
|
139
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
140
|
+
inner_type = Regexp.last_match[:inner_type]
|
141
|
+
value.map { |v| _deserialize(inner_type, v) }
|
142
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
143
|
+
k_type = Regexp.last_match[:k_type]
|
144
|
+
v_type = Regexp.last_match[:v_type]
|
145
|
+
{}.tap do |hash|
|
146
|
+
value.each do |k, v|
|
147
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
else # model
|
151
|
+
temp_model = CloudmersiveConvertApiClient.const_get(type).new
|
152
|
+
temp_model.build_from_hash(value)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# Returns the string representation of the object
|
157
|
+
# @return [String] String presentation of the object
|
158
|
+
def to_s
|
159
|
+
to_hash.to_s
|
160
|
+
end
|
161
|
+
|
162
|
+
# to_body is an alias to to_hash (backward compatibility)
|
163
|
+
# @return [Hash] Returns the object in the form of hash
|
164
|
+
def to_body
|
165
|
+
to_hash
|
166
|
+
end
|
167
|
+
|
168
|
+
# Returns the object in the form of hash
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
170
|
+
def to_hash
|
171
|
+
hash = {}
|
172
|
+
self.class.attribute_map.each_pair do |attr, param|
|
173
|
+
value = self.send(attr)
|
174
|
+
next if value.nil?
|
175
|
+
hash[param] = _to_hash(value)
|
176
|
+
end
|
177
|
+
hash
|
178
|
+
end
|
179
|
+
|
180
|
+
# Outputs non-array value in the form of hash
|
181
|
+
# For object, use to_hash. Otherwise, just return the value
|
182
|
+
# @param [Object] value Any valid value
|
183
|
+
# @return [Hash] Returns the value in the form of hash
|
184
|
+
def _to_hash(value)
|
185
|
+
if value.is_a?(Array)
|
186
|
+
value.compact.map{ |v| _to_hash(v) }
|
187
|
+
elsif value.is_a?(Hash)
|
188
|
+
{}.tap do |hash|
|
189
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
190
|
+
end
|
191
|
+
elsif value.respond_to? :to_hash
|
192
|
+
value.to_hash
|
193
|
+
else
|
194
|
+
value
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
end
|
199
|
+
|
200
|
+
end
|
@@ -32,6 +32,19 @@ describe 'SplitDocumentApi' do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
# unit tests for split_document_docx
|
36
|
+
# Split a single Word Document DOCX into Separate Documents by Page
|
37
|
+
# Split a Word DOCX Document, comprised of multiple pages into separate Word DOCX document files, with each containing exactly one page.
|
38
|
+
# @param input_file Input file to perform the operation on.
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @option opts [BOOLEAN] :return_document_contents Set to true to return the contents of each Worksheet directly, set to false to only return URLs to each resulting document. Default is true.
|
41
|
+
# @return [SplitDocxDocumentResult]
|
42
|
+
describe 'split_document_docx 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
|
+
|
35
48
|
# unit tests for split_document_pdf_by_page
|
36
49
|
# Split a PDF file into separate PDF files, one per page
|
37
50
|
# Split an input PDF file into separate pages, comprised of one PDF file per page.
|
@@ -50,7 +63,7 @@ describe 'SplitDocumentApi' do
|
|
50
63
|
# Split an PowerPoint PPTX Presentation, comprised of multiple slides into separate PowerPoint PPTX presentation files, with each containing exactly one slide.
|
51
64
|
# @param input_file Input file to perform the operation on.
|
52
65
|
# @param [Hash] opts the optional parameters
|
53
|
-
# @option opts [BOOLEAN] :return_document_contents Set to true to return the contents of each
|
66
|
+
# @option opts [BOOLEAN] :return_document_contents Set to true to return the contents of each presentation directly, set to false to only return URLs to each resulting presentation. Default is true.
|
54
67
|
# @return [SplitPptxPresentationResult]
|
55
68
|
describe 'split_document_pptx test' do
|
56
69
|
it "should work" do
|
@@ -0,0 +1,54 @@
|
|
1
|
+
=begin
|
2
|
+
#convertapi
|
3
|
+
|
4
|
+
#Convert API lets you effortlessly convert file formats and types.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for CloudmersiveConvertApiClient::SplitDocumentResult
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'SplitDocumentResult' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveConvertApiClient::SplitDocumentResult.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of SplitDocumentResult' do
|
31
|
+
it 'should create an instance of SplitDocumentResult' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::SplitDocumentResult)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "page_number"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "url"' 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
|
+
describe 'test attribute "document_contents"' do
|
48
|
+
it 'should work' do
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
@@ -0,0 +1,48 @@
|
|
1
|
+
=begin
|
2
|
+
#convertapi
|
3
|
+
|
4
|
+
#Convert API lets you effortlessly convert file formats and types.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for CloudmersiveConvertApiClient::SplitDocxDocumentResult
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'SplitDocxDocumentResult' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveConvertApiClient::SplitDocxDocumentResult.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of SplitDocxDocumentResult' do
|
31
|
+
it 'should create an instance of SplitDocxDocumentResult' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::SplitDocxDocumentResult)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "result_documents"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "successful"' 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
|
+
end
|
48
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudmersive-convert-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloudmersive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -322,6 +322,8 @@ files:
|
|
322
322
|
- "./docs/SetPdfFormFieldsRequest.md"
|
323
323
|
- "./docs/SetPdfMetadataRequest.md"
|
324
324
|
- "./docs/SplitDocumentApi.md"
|
325
|
+
- "./docs/SplitDocumentResult.md"
|
326
|
+
- "./docs/SplitDocxDocumentResult.md"
|
325
327
|
- "./docs/SplitPdfResult.md"
|
326
328
|
- "./docs/SplitPptxPresentationResult.md"
|
327
329
|
- "./docs/SplitXlsxWorksheetResult.md"
|
@@ -477,6 +479,8 @@ files:
|
|
477
479
|
- "./lib/cloudmersive-convert-api-client/models/set_form_field_value.rb"
|
478
480
|
- "./lib/cloudmersive-convert-api-client/models/set_pdf_form_fields_request.rb"
|
479
481
|
- "./lib/cloudmersive-convert-api-client/models/set_pdf_metadata_request.rb"
|
482
|
+
- "./lib/cloudmersive-convert-api-client/models/split_document_result.rb"
|
483
|
+
- "./lib/cloudmersive-convert-api-client/models/split_docx_document_result.rb"
|
480
484
|
- "./lib/cloudmersive-convert-api-client/models/split_pdf_result.rb"
|
481
485
|
- "./lib/cloudmersive-convert-api-client/models/split_pptx_presentation_result.rb"
|
482
486
|
- "./lib/cloudmersive-convert-api-client/models/split_xlsx_worksheet_result.rb"
|
@@ -628,6 +632,8 @@ files:
|
|
628
632
|
- "./spec/models/set_form_field_value_spec.rb"
|
629
633
|
- "./spec/models/set_pdf_form_fields_request_spec.rb"
|
630
634
|
- "./spec/models/set_pdf_metadata_request_spec.rb"
|
635
|
+
- "./spec/models/split_document_result_spec.rb"
|
636
|
+
- "./spec/models/split_docx_document_result_spec.rb"
|
631
637
|
- "./spec/models/split_pdf_result_spec.rb"
|
632
638
|
- "./spec/models/split_pptx_presentation_result_spec.rb"
|
633
639
|
- "./spec/models/split_xlsx_worksheet_result_spec.rb"
|