cloudmersive-convert-api-client 1.4.0 → 1.4.1
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 +63 -0
- data/docs/SplitXlsxWorksheetResult.md +9 -0
- data/docs/WorksheetResult.md +10 -0
- data/lib/cloudmersive-convert-api-client.rb +3 -0
- data/lib/cloudmersive-convert-api-client/api/split_document_api.rb +79 -0
- data/lib/cloudmersive-convert-api-client/models/split_xlsx_worksheet_result.rb +200 -0
- data/lib/cloudmersive-convert-api-client/models/worksheet_result.rb +209 -0
- data/lib/cloudmersive-convert-api-client/version.rb +1 -1
- data/spec/api/split_document_api_spec.rb +47 -0
- data/spec/models/split_xlsx_worksheet_result_spec.rb +48 -0
- data/spec/models/worksheet_result_spec.rb +54 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d324bff7f1c50055f485369755d325a49436277ec2faa4183bd6a702260164dc
|
4
|
+
data.tar.gz: 7a33b9aa43f4838204a0ba6a883d0919a2b6a2cb112fcdfeb682e15807340018
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c866de9095a506451d3b426370d7f424908a85f16c82d31492eed6b6c4c35ed94af1646cdd9ef1210bc5d23dde4f79085fb3738e139817b7de4b9440eccbb37
|
7
|
+
data.tar.gz: b1939639e7b04029348e1cc971bdcc5903b99dfd1442d571d8f047ffde79907916d107dfeb4d71b18d55335f20481577eb67c144fa5a7b7230090f71d1c88a96
|
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.4.
|
10
|
+
- Package version: 1.4.1
|
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.4.
|
26
|
+
gem install ./cloudmersive-convert-api-client-1.4.1.gem
|
27
27
|
```
|
28
|
-
(for development, run `gem install --dev ./cloudmersive-convert-api-client-1.4.
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-convert-api-client-1.4.1.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.4.
|
34
|
+
gem 'cloudmersive-convert-api-client', '~> 1.4.1'
|
35
35
|
|
36
36
|
### Install from Git
|
37
37
|
|
@@ -153,6 +153,7 @@ Class | Method | HTTP request | Description
|
|
153
153
|
*CloudmersiveConvertApiClient::MergeDocumentApi* | [**merge_document_pdf**](docs/MergeDocumentApi.md#merge_document_pdf) | **POST** /convert/merge/pdf | Merge Multple PDF Files Together
|
154
154
|
*CloudmersiveConvertApiClient::MergeDocumentApi* | [**merge_document_pptx**](docs/MergeDocumentApi.md#merge_document_pptx) | **POST** /convert/merge/pptx | Merge Multple PowerPoint PPTX Together
|
155
155
|
*CloudmersiveConvertApiClient::MergeDocumentApi* | [**merge_document_xlsx**](docs/MergeDocumentApi.md#merge_document_xlsx) | **POST** /convert/merge/xlsx | Merge Multple Excel XLSX Together
|
156
|
+
*CloudmersiveConvertApiClient::SplitDocumentApi* | [**split_document_xlsx**](docs/SplitDocumentApi.md#split_document_xlsx) | **POST** /convert/split/xlsx | Split a single Excel XLSX into Separate Worksheets
|
156
157
|
*CloudmersiveConvertApiClient::ValidateDocumentApi* | [**validate_document_docx_validation**](docs/ValidateDocumentApi.md#validate_document_docx_validation) | **POST** /convert/validate/docx | Validate a Word document (DOCX)
|
157
158
|
*CloudmersiveConvertApiClient::ValidateDocumentApi* | [**validate_document_pptx_validation**](docs/ValidateDocumentApi.md#validate_document_pptx_validation) | **POST** /convert/validate/pptx | Validate a PowerPoint presentation (PPTX)
|
158
159
|
*CloudmersiveConvertApiClient::ValidateDocumentApi* | [**validate_document_xlsx_validation**](docs/ValidateDocumentApi.md#validate_document_xlsx_validation) | **POST** /convert/validate/xlsx | Validate a Excel document (XLSX)
|
@@ -234,8 +235,10 @@ Class | Method | HTTP request | Description
|
|
234
235
|
- [CloudmersiveConvertApiClient::RemoveDocxHeadersAndFootersResponse](docs/RemoveDocxHeadersAndFootersResponse.md)
|
235
236
|
- [CloudmersiveConvertApiClient::ReplaceStringRequest](docs/ReplaceStringRequest.md)
|
236
237
|
- [CloudmersiveConvertApiClient::ScreenshotRequest](docs/ScreenshotRequest.md)
|
238
|
+
- [CloudmersiveConvertApiClient::SplitXlsxWorksheetResult](docs/SplitXlsxWorksheetResult.md)
|
237
239
|
- [CloudmersiveConvertApiClient::TextConversionResult](docs/TextConversionResult.md)
|
238
240
|
- [CloudmersiveConvertApiClient::ViewerResponse](docs/ViewerResponse.md)
|
241
|
+
- [CloudmersiveConvertApiClient::WorksheetResult](docs/WorksheetResult.md)
|
239
242
|
- [CloudmersiveConvertApiClient::XlsxImage](docs/XlsxImage.md)
|
240
243
|
- [CloudmersiveConvertApiClient::XlsxSpreadsheetCell](docs/XlsxSpreadsheetCell.md)
|
241
244
|
- [CloudmersiveConvertApiClient::XlsxSpreadsheetColumn](docs/XlsxSpreadsheetColumn.md)
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# CloudmersiveConvertApiClient::SplitDocumentApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api.cloudmersive.com*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**split_document_xlsx**](SplitDocumentApi.md#split_document_xlsx) | **POST** /convert/split/xlsx | Split a single Excel XLSX into Separate Worksheets
|
8
|
+
|
9
|
+
|
10
|
+
# **split_document_xlsx**
|
11
|
+
> SplitXlsxWorksheetResult split_document_xlsx(input_file)
|
12
|
+
|
13
|
+
Split a single Excel XLSX into Separate Worksheets
|
14
|
+
|
15
|
+
Split an Excel XLSX Spreadsheet, comprised of multiple Worksheets (or Tabs) into separate Excel XLSX spreadsheet files, with each containing exactly one Worksheet.
|
16
|
+
|
17
|
+
### Example
|
18
|
+
```ruby
|
19
|
+
# load the gem
|
20
|
+
require 'cloudmersive-convert-api-client'
|
21
|
+
# setup authorization
|
22
|
+
CloudmersiveConvertApiClient.configure do |config|
|
23
|
+
# Configure API key authorization: Apikey
|
24
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
25
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
26
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
27
|
+
end
|
28
|
+
|
29
|
+
api_instance = CloudmersiveConvertApiClient::SplitDocumentApi.new
|
30
|
+
|
31
|
+
input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
|
32
|
+
|
33
|
+
|
34
|
+
begin
|
35
|
+
#Split a single Excel XLSX into Separate Worksheets
|
36
|
+
result = api_instance.split_document_xlsx(input_file)
|
37
|
+
p result
|
38
|
+
rescue CloudmersiveConvertApiClient::ApiError => e
|
39
|
+
puts "Exception when calling SplitDocumentApi->split_document_xlsx: #{e}"
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
### Parameters
|
44
|
+
|
45
|
+
Name | Type | Description | Notes
|
46
|
+
------------- | ------------- | ------------- | -------------
|
47
|
+
**input_file** | **File**| Input file to perform the operation on. |
|
48
|
+
|
49
|
+
### Return type
|
50
|
+
|
51
|
+
[**SplitXlsxWorksheetResult**](SplitXlsxWorksheetResult.md)
|
52
|
+
|
53
|
+
### Authorization
|
54
|
+
|
55
|
+
[Apikey](../README.md#Apikey)
|
56
|
+
|
57
|
+
### HTTP request headers
|
58
|
+
|
59
|
+
- **Content-Type**: multipart/form-data
|
60
|
+
- **Accept**: application/octet-stream
|
61
|
+
|
62
|
+
|
63
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CloudmersiveConvertApiClient::SplitXlsxWorksheetResult
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**result_worksheets** | [**Array<WorksheetResult>**](WorksheetResult.md) | | [optional]
|
7
|
+
**successful** | **BOOLEAN** | True if the operation was successful, false otherwise | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# CloudmersiveConvertApiClient::WorksheetResult
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**worksheet_number** | **Integer** | Worksheet number of the converted page, starting with 1 for the left-most worksheet | [optional]
|
7
|
+
**worksheet_name** | **String** | The name of the worksheet | [optional]
|
8
|
+
**url** | **String** | URL to the XLSX file of this worksheet; file is stored in an in-memory cache and will be deleted | [optional]
|
9
|
+
|
10
|
+
|
@@ -90,8 +90,10 @@ require 'cloudmersive-convert-api-client/models/remove_docx_headers_and_footers_
|
|
90
90
|
require 'cloudmersive-convert-api-client/models/remove_docx_headers_and_footers_response'
|
91
91
|
require 'cloudmersive-convert-api-client/models/replace_string_request'
|
92
92
|
require 'cloudmersive-convert-api-client/models/screenshot_request'
|
93
|
+
require 'cloudmersive-convert-api-client/models/split_xlsx_worksheet_result'
|
93
94
|
require 'cloudmersive-convert-api-client/models/text_conversion_result'
|
94
95
|
require 'cloudmersive-convert-api-client/models/viewer_response'
|
96
|
+
require 'cloudmersive-convert-api-client/models/worksheet_result'
|
95
97
|
require 'cloudmersive-convert-api-client/models/xlsx_image'
|
96
98
|
require 'cloudmersive-convert-api-client/models/xlsx_spreadsheet_cell'
|
97
99
|
require 'cloudmersive-convert-api-client/models/xlsx_spreadsheet_column'
|
@@ -107,6 +109,7 @@ require 'cloudmersive-convert-api-client/api/convert_template_api'
|
|
107
109
|
require 'cloudmersive-convert-api-client/api/convert_web_api'
|
108
110
|
require 'cloudmersive-convert-api-client/api/edit_document_api'
|
109
111
|
require 'cloudmersive-convert-api-client/api/merge_document_api'
|
112
|
+
require 'cloudmersive-convert-api-client/api/split_document_api'
|
110
113
|
require 'cloudmersive-convert-api-client/api/validate_document_api'
|
111
114
|
require 'cloudmersive-convert-api-client/api/viewer_tools_api'
|
112
115
|
|
@@ -0,0 +1,79 @@
|
|
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: unset
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require "uri"
|
14
|
+
|
15
|
+
module CloudmersiveConvertApiClient
|
16
|
+
class SplitDocumentApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Split a single Excel XLSX into Separate Worksheets
|
24
|
+
# Split an Excel XLSX Spreadsheet, comprised of multiple Worksheets (or Tabs) into separate Excel XLSX spreadsheet files, with each containing exactly one Worksheet.
|
25
|
+
# @param input_file Input file to perform the operation on.
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [SplitXlsxWorksheetResult]
|
28
|
+
def split_document_xlsx(input_file, opts = {})
|
29
|
+
data, _status_code, _headers = split_document_xlsx_with_http_info(input_file, opts)
|
30
|
+
return data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Split a single Excel XLSX into Separate Worksheets
|
34
|
+
# Split an Excel XLSX Spreadsheet, comprised of multiple Worksheets (or Tabs) into separate Excel XLSX spreadsheet files, with each containing exactly one Worksheet.
|
35
|
+
# @param input_file Input file to perform the operation on.
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [Array<(SplitXlsxWorksheetResult, Fixnum, Hash)>] SplitXlsxWorksheetResult data, response status code and response headers
|
38
|
+
def split_document_xlsx_with_http_info(input_file, opts = {})
|
39
|
+
if @api_client.config.debugging
|
40
|
+
@api_client.config.logger.debug "Calling API: SplitDocumentApi.split_document_xlsx ..."
|
41
|
+
end
|
42
|
+
# verify the required parameter 'input_file' is set
|
43
|
+
if @api_client.config.client_side_validation && input_file.nil?
|
44
|
+
fail ArgumentError, "Missing the required parameter 'input_file' when calling SplitDocumentApi.split_document_xlsx"
|
45
|
+
end
|
46
|
+
# resource path
|
47
|
+
local_var_path = "/convert/split/xlsx"
|
48
|
+
|
49
|
+
# query parameters
|
50
|
+
query_params = {}
|
51
|
+
|
52
|
+
# header parameters
|
53
|
+
header_params = {}
|
54
|
+
# HTTP header 'Accept' (if needed)
|
55
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
56
|
+
# HTTP header 'Content-Type'
|
57
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
58
|
+
|
59
|
+
# form parameters
|
60
|
+
form_params = {}
|
61
|
+
form_params["inputFile"] = input_file
|
62
|
+
|
63
|
+
# http body (model)
|
64
|
+
post_body = nil
|
65
|
+
auth_names = ['Apikey']
|
66
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
67
|
+
:header_params => header_params,
|
68
|
+
:query_params => query_params,
|
69
|
+
:form_params => form_params,
|
70
|
+
:body => post_body,
|
71
|
+
:auth_names => auth_names,
|
72
|
+
:return_type => 'SplitXlsxWorksheetResult')
|
73
|
+
if @api_client.config.debugging
|
74
|
+
@api_client.config.logger.debug "API called: SplitDocumentApi#split_document_xlsx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
+
end
|
76
|
+
return data, status_code, headers
|
77
|
+
end
|
78
|
+
end
|
79
|
+
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: unset
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CloudmersiveConvertApiClient
|
16
|
+
# The result of splitting a spreadsheet into individual Excel XLSX worksheets
|
17
|
+
class SplitXlsxWorksheetResult
|
18
|
+
attr_accessor :result_worksheets
|
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_worksheets' => :'ResultWorksheets',
|
28
|
+
:'successful' => :'Successful'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.swagger_types
|
34
|
+
{
|
35
|
+
:'result_worksheets' => :'Array<WorksheetResult>',
|
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?(:'ResultWorksheets')
|
49
|
+
if (value = attributes[:'ResultWorksheets']).is_a?(Array)
|
50
|
+
self.result_worksheets = 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_worksheets == o.result_worksheets &&
|
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_worksheets, 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
|
@@ -0,0 +1,209 @@
|
|
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: unset
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CloudmersiveConvertApiClient
|
16
|
+
# A single Excel XLSX file corresponding to one worksheet (tab) in the original spreadsheet
|
17
|
+
class WorksheetResult
|
18
|
+
# Worksheet number of the converted page, starting with 1 for the left-most worksheet
|
19
|
+
attr_accessor :worksheet_number
|
20
|
+
|
21
|
+
# The name of the worksheet
|
22
|
+
attr_accessor :worksheet_name
|
23
|
+
|
24
|
+
# URL to the XLSX file of this worksheet; file is stored in an in-memory cache and will be deleted
|
25
|
+
attr_accessor :url
|
26
|
+
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'worksheet_number' => :'WorksheetNumber',
|
32
|
+
:'worksheet_name' => :'WorksheetName',
|
33
|
+
:'url' => :'URL'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.swagger_types
|
39
|
+
{
|
40
|
+
:'worksheet_number' => :'Integer',
|
41
|
+
:'worksheet_name' => :'String',
|
42
|
+
:'url' => :'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?(:'WorksheetNumber')
|
55
|
+
self.worksheet_number = attributes[:'WorksheetNumber']
|
56
|
+
end
|
57
|
+
|
58
|
+
if attributes.has_key?(:'WorksheetName')
|
59
|
+
self.worksheet_name = attributes[:'WorksheetName']
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes.has_key?(:'URL')
|
63
|
+
self.url = attributes[:'URL']
|
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
|
+
return invalid_properties
|
73
|
+
end
|
74
|
+
|
75
|
+
# Check to see if the all the properties in the model are valid
|
76
|
+
# @return true if the model is valid
|
77
|
+
def valid?
|
78
|
+
return true
|
79
|
+
end
|
80
|
+
|
81
|
+
# Checks equality by comparing each attribute.
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def ==(o)
|
84
|
+
return true if self.equal?(o)
|
85
|
+
self.class == o.class &&
|
86
|
+
worksheet_number == o.worksheet_number &&
|
87
|
+
worksheet_name == o.worksheet_name &&
|
88
|
+
url == o.url
|
89
|
+
end
|
90
|
+
|
91
|
+
# @see the `==` method
|
92
|
+
# @param [Object] Object to be compared
|
93
|
+
def eql?(o)
|
94
|
+
self == o
|
95
|
+
end
|
96
|
+
|
97
|
+
# Calculates hash code according to all attributes.
|
98
|
+
# @return [Fixnum] Hash code
|
99
|
+
def hash
|
100
|
+
[worksheet_number, worksheet_name, url].hash
|
101
|
+
end
|
102
|
+
|
103
|
+
# Builds the object from hash
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
+
# @return [Object] Returns the model itself
|
106
|
+
def build_from_hash(attributes)
|
107
|
+
return nil unless attributes.is_a?(Hash)
|
108
|
+
self.class.swagger_types.each_pair do |key, type|
|
109
|
+
if type =~ /\AArray<(.*)>/i
|
110
|
+
# check to ensure the input is an array given that the the attribute
|
111
|
+
# is documented as an array but the input is not
|
112
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
113
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
114
|
+
end
|
115
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
116
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
117
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
118
|
+
end
|
119
|
+
|
120
|
+
self
|
121
|
+
end
|
122
|
+
|
123
|
+
# Deserializes the data based on type
|
124
|
+
# @param string type Data type
|
125
|
+
# @param string value Value to be deserialized
|
126
|
+
# @return [Object] Deserialized data
|
127
|
+
def _deserialize(type, value)
|
128
|
+
case type.to_sym
|
129
|
+
when :DateTime
|
130
|
+
DateTime.parse(value)
|
131
|
+
when :Date
|
132
|
+
Date.parse(value)
|
133
|
+
when :String
|
134
|
+
value.to_s
|
135
|
+
when :Integer
|
136
|
+
value.to_i
|
137
|
+
when :Float
|
138
|
+
value.to_f
|
139
|
+
when :BOOLEAN
|
140
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
141
|
+
true
|
142
|
+
else
|
143
|
+
false
|
144
|
+
end
|
145
|
+
when :Object
|
146
|
+
# generic object (usually a Hash), return directly
|
147
|
+
value
|
148
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
149
|
+
inner_type = Regexp.last_match[:inner_type]
|
150
|
+
value.map { |v| _deserialize(inner_type, v) }
|
151
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
152
|
+
k_type = Regexp.last_match[:k_type]
|
153
|
+
v_type = Regexp.last_match[:v_type]
|
154
|
+
{}.tap do |hash|
|
155
|
+
value.each do |k, v|
|
156
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
else # model
|
160
|
+
temp_model = CloudmersiveConvertApiClient.const_get(type).new
|
161
|
+
temp_model.build_from_hash(value)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
# Returns the string representation of the object
|
166
|
+
# @return [String] String presentation of the object
|
167
|
+
def to_s
|
168
|
+
to_hash.to_s
|
169
|
+
end
|
170
|
+
|
171
|
+
# to_body is an alias to to_hash (backward compatibility)
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
173
|
+
def to_body
|
174
|
+
to_hash
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the object in the form of hash
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_hash
|
180
|
+
hash = {}
|
181
|
+
self.class.attribute_map.each_pair do |attr, param|
|
182
|
+
value = self.send(attr)
|
183
|
+
next if value.nil?
|
184
|
+
hash[param] = _to_hash(value)
|
185
|
+
end
|
186
|
+
hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Outputs non-array value in the form of hash
|
190
|
+
# For object, use to_hash. Otherwise, just return the value
|
191
|
+
# @param [Object] value Any valid value
|
192
|
+
# @return [Hash] Returns the value in the form of hash
|
193
|
+
def _to_hash(value)
|
194
|
+
if value.is_a?(Array)
|
195
|
+
value.compact.map{ |v| _to_hash(v) }
|
196
|
+
elsif value.is_a?(Hash)
|
197
|
+
{}.tap do |hash|
|
198
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
199
|
+
end
|
200
|
+
elsif value.respond_to? :to_hash
|
201
|
+
value.to_hash
|
202
|
+
else
|
203
|
+
value
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
end
|
208
|
+
|
209
|
+
end
|
@@ -0,0 +1,47 @@
|
|
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: unset
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for CloudmersiveConvertApiClient::SplitDocumentApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'SplitDocumentApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = CloudmersiveConvertApiClient::SplitDocumentApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of SplitDocumentApi' do
|
30
|
+
it 'should create an instance of SplitDocumentApi' do
|
31
|
+
expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::SplitDocumentApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for split_document_xlsx
|
36
|
+
# Split a single Excel XLSX into Separate Worksheets
|
37
|
+
# Split an Excel XLSX Spreadsheet, comprised of multiple Worksheets (or Tabs) into separate Excel XLSX spreadsheet files, with each containing exactly one Worksheet.
|
38
|
+
# @param input_file Input file to perform the operation on.
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [SplitXlsxWorksheetResult]
|
41
|
+
describe 'split_document_xlsx 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
|
+
end
|
@@ -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: unset
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for CloudmersiveConvertApiClient::SplitXlsxWorksheetResult
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'SplitXlsxWorksheetResult' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveConvertApiClient::SplitXlsxWorksheetResult.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of SplitXlsxWorksheetResult' do
|
31
|
+
it 'should create an instance of SplitXlsxWorksheetResult' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::SplitXlsxWorksheetResult)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "result_worksheets"' 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
|
+
|
@@ -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: unset
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for CloudmersiveConvertApiClient::WorksheetResult
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'WorksheetResult' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveConvertApiClient::WorksheetResult.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of WorksheetResult' do
|
31
|
+
it 'should create an instance of WorksheetResult' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::WorksheetResult)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "worksheet_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 "worksheet_name"' 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 "url"' 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
|
+
|
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.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloudmersive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -283,10 +283,13 @@ files:
|
|
283
283
|
- "./docs/RemoveDocxHeadersAndFootersResponse.md"
|
284
284
|
- "./docs/ReplaceStringRequest.md"
|
285
285
|
- "./docs/ScreenshotRequest.md"
|
286
|
+
- "./docs/SplitDocumentApi.md"
|
287
|
+
- "./docs/SplitXlsxWorksheetResult.md"
|
286
288
|
- "./docs/TextConversionResult.md"
|
287
289
|
- "./docs/ValidateDocumentApi.md"
|
288
290
|
- "./docs/ViewerResponse.md"
|
289
291
|
- "./docs/ViewerToolsApi.md"
|
292
|
+
- "./docs/WorksheetResult.md"
|
290
293
|
- "./docs/XlsxImage.md"
|
291
294
|
- "./docs/XlsxSpreadsheetCell.md"
|
292
295
|
- "./docs/XlsxSpreadsheetColumn.md"
|
@@ -302,6 +305,7 @@ files:
|
|
302
305
|
- "./lib/cloudmersive-convert-api-client/api/convert_web_api.rb"
|
303
306
|
- "./lib/cloudmersive-convert-api-client/api/edit_document_api.rb"
|
304
307
|
- "./lib/cloudmersive-convert-api-client/api/merge_document_api.rb"
|
308
|
+
- "./lib/cloudmersive-convert-api-client/api/split_document_api.rb"
|
305
309
|
- "./lib/cloudmersive-convert-api-client/api/validate_document_api.rb"
|
306
310
|
- "./lib/cloudmersive-convert-api-client/api/viewer_tools_api.rb"
|
307
311
|
- "./lib/cloudmersive-convert-api-client/api_client.rb"
|
@@ -380,8 +384,10 @@ files:
|
|
380
384
|
- "./lib/cloudmersive-convert-api-client/models/remove_docx_headers_and_footers_response.rb"
|
381
385
|
- "./lib/cloudmersive-convert-api-client/models/replace_string_request.rb"
|
382
386
|
- "./lib/cloudmersive-convert-api-client/models/screenshot_request.rb"
|
387
|
+
- "./lib/cloudmersive-convert-api-client/models/split_xlsx_worksheet_result.rb"
|
383
388
|
- "./lib/cloudmersive-convert-api-client/models/text_conversion_result.rb"
|
384
389
|
- "./lib/cloudmersive-convert-api-client/models/viewer_response.rb"
|
390
|
+
- "./lib/cloudmersive-convert-api-client/models/worksheet_result.rb"
|
385
391
|
- "./lib/cloudmersive-convert-api-client/models/xlsx_image.rb"
|
386
392
|
- "./lib/cloudmersive-convert-api-client/models/xlsx_spreadsheet_cell.rb"
|
387
393
|
- "./lib/cloudmersive-convert-api-client/models/xlsx_spreadsheet_column.rb"
|
@@ -396,6 +402,7 @@ files:
|
|
396
402
|
- "./spec/api/convert_web_api_spec.rb"
|
397
403
|
- "./spec/api/edit_document_api_spec.rb"
|
398
404
|
- "./spec/api/merge_document_api_spec.rb"
|
405
|
+
- "./spec/api/split_document_api_spec.rb"
|
399
406
|
- "./spec/api/validate_document_api_spec.rb"
|
400
407
|
- "./spec/api/viewer_tools_api_spec.rb"
|
401
408
|
- "./spec/api_client_spec.rb"
|
@@ -473,8 +480,10 @@ files:
|
|
473
480
|
- "./spec/models/remove_docx_headers_and_footers_response_spec.rb"
|
474
481
|
- "./spec/models/replace_string_request_spec.rb"
|
475
482
|
- "./spec/models/screenshot_request_spec.rb"
|
483
|
+
- "./spec/models/split_xlsx_worksheet_result_spec.rb"
|
476
484
|
- "./spec/models/text_conversion_result_spec.rb"
|
477
485
|
- "./spec/models/viewer_response_spec.rb"
|
486
|
+
- "./spec/models/worksheet_result_spec.rb"
|
478
487
|
- "./spec/models/xlsx_image_spec.rb"
|
479
488
|
- "./spec/models/xlsx_spreadsheet_cell_spec.rb"
|
480
489
|
- "./spec/models/xlsx_spreadsheet_column_spec.rb"
|