cloudmersive-convert-api-client 1.3.5 → 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/docs/AutodetectToPngResult.md +9 -0
- data/docs/ConvertDocumentApi.md +57 -2
- data/lib/cloudmersive-convert-api-client.rb +1 -0
- data/lib/cloudmersive-convert-api-client/api/convert_document_api.rb +60 -4
- data/lib/cloudmersive-convert-api-client/models/autodetect_to_png_result.rb +201 -0
- data/lib/cloudmersive-convert-api-client/version.rb +1 -1
- data/spec/api/convert_document_api_spec.rb +14 -2
- data/spec/models/autodetect_to_png_result_spec.rb +48 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75c5b1a36b8cc669f4821132aebb44e28736a37e9ea3d6ec5207cbd2a6735661
|
4
|
+
data.tar.gz: a732298829671b9ea718ee701dc3e091e22347736d0ebfb1d10f138c64fbb63c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36ce9afc46ece0a3bc459f773efc0d50eb29059be7657fd7a2cb95875b400f6c13134736db1059b5a178172812d085c0f59b8069b82e7aed4e6256e817b6451e
|
7
|
+
data.tar.gz: bc5e7fcc48fbfdeedfff151349f39d2ca73c988742438da5b124d59a9e2ffd3a47fac05140c328c024a0984b7153d722f64412cfb74e26796762685568109b03
|
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.3.
|
10
|
+
- Package version: 1.3.6
|
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.3.
|
26
|
+
gem install ./cloudmersive-convert-api-client-1.3.6.gem
|
27
27
|
```
|
28
|
-
(for development, run `gem install --dev ./cloudmersive-convert-api-client-1.3.
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-convert-api-client-1.3.6.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.3.
|
34
|
+
gem 'cloudmersive-convert-api-client', '~> 1.3.6'
|
35
35
|
|
36
36
|
### Install from Git
|
37
37
|
|
@@ -92,6 +92,7 @@ Class | Method | HTTP request | Description
|
|
92
92
|
*CloudmersiveConvertApiClient::ConvertDataApi* | [**convert_data_xml_to_json**](docs/ConvertDataApi.md#convert_data_xml_to_json) | **POST** /convert/xml/to/json | XML to JSON conversion
|
93
93
|
*CloudmersiveConvertApiClient::ConvertDocumentApi* | [**convert_document_autodetect_get_info**](docs/ConvertDocumentApi.md#convert_document_autodetect_get_info) | **POST** /convert/autodetect/get-info | Get document type information
|
94
94
|
*CloudmersiveConvertApiClient::ConvertDocumentApi* | [**convert_document_autodetect_to_pdf**](docs/ConvertDocumentApi.md#convert_document_autodetect_to_pdf) | **POST** /convert/autodetect/to/pdf | Convert Document to PDF
|
95
|
+
*CloudmersiveConvertApiClient::ConvertDocumentApi* | [**convert_document_autodetect_to_png_array**](docs/ConvertDocumentApi.md#convert_document_autodetect_to_png_array) | **POST** /convert/autodetect/to/png | Convert Document to PNG array
|
95
96
|
*CloudmersiveConvertApiClient::ConvertDocumentApi* | [**convert_document_csv_to_xlsx**](docs/ConvertDocumentApi.md#convert_document_csv_to_xlsx) | **POST** /convert/csv/to/xlsx | CSV to Excel XLSX
|
96
97
|
*CloudmersiveConvertApiClient::ConvertDocumentApi* | [**convert_document_doc_to_docx**](docs/ConvertDocumentApi.md#convert_document_doc_to_docx) | **POST** /convert/doc/to/docx | Word DOC (97-03) to DOCX
|
97
98
|
*CloudmersiveConvertApiClient::ConvertDocumentApi* | [**convert_document_doc_to_pdf**](docs/ConvertDocumentApi.md#convert_document_doc_to_pdf) | **POST** /convert/doc/to/pdf | Word DOC (97-03) to PDF
|
@@ -153,6 +154,7 @@ Class | Method | HTTP request | Description
|
|
153
154
|
|
154
155
|
- [CloudmersiveConvertApiClient::AlternateFileFormatCandidate](docs/AlternateFileFormatCandidate.md)
|
155
156
|
- [CloudmersiveConvertApiClient::AutodetectGetInfoResult](docs/AutodetectGetInfoResult.md)
|
157
|
+
- [CloudmersiveConvertApiClient::AutodetectToPngResult](docs/AutodetectToPngResult.md)
|
156
158
|
- [CloudmersiveConvertApiClient::ConvertedPngPage](docs/ConvertedPngPage.md)
|
157
159
|
- [CloudmersiveConvertApiClient::DocumentValidationError](docs/DocumentValidationError.md)
|
158
160
|
- [CloudmersiveConvertApiClient::DocumentValidationResult](docs/DocumentValidationResult.md)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CloudmersiveConvertApiClient::AutodetectToPngResult
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**successful** | **BOOLEAN** | True if the operation was successful, false otherwise | [optional]
|
7
|
+
**png_result_pages** | [**Array<ConvertedPngPage>**](ConvertedPngPage.md) | Array of converted pages | [optional]
|
8
|
+
|
9
|
+
|
data/docs/ConvertDocumentApi.md
CHANGED
@@ -6,6 +6,7 @@ Method | HTTP request | Description
|
|
6
6
|
------------- | ------------- | -------------
|
7
7
|
[**convert_document_autodetect_get_info**](ConvertDocumentApi.md#convert_document_autodetect_get_info) | **POST** /convert/autodetect/get-info | Get document type information
|
8
8
|
[**convert_document_autodetect_to_pdf**](ConvertDocumentApi.md#convert_document_autodetect_to_pdf) | **POST** /convert/autodetect/to/pdf | Convert Document to PDF
|
9
|
+
[**convert_document_autodetect_to_png_array**](ConvertDocumentApi.md#convert_document_autodetect_to_png_array) | **POST** /convert/autodetect/to/png | Convert Document to PNG array
|
9
10
|
[**convert_document_csv_to_xlsx**](ConvertDocumentApi.md#convert_document_csv_to_xlsx) | **POST** /convert/csv/to/xlsx | CSV to Excel XLSX
|
10
11
|
[**convert_document_doc_to_docx**](ConvertDocumentApi.md#convert_document_doc_to_docx) | **POST** /convert/doc/to/docx | Word DOC (97-03) to DOCX
|
11
12
|
[**convert_document_doc_to_pdf**](ConvertDocumentApi.md#convert_document_doc_to_pdf) | **POST** /convert/doc/to/pdf | Word DOC (97-03) to PDF
|
@@ -27,7 +28,7 @@ Method | HTTP request | Description
|
|
27
28
|
|
28
29
|
Get document type information
|
29
30
|
|
30
|
-
Auto-detects a document's type information; does not require file extension. Analyzes file contents to confirm file type.
|
31
|
+
Auto-detects a document's type information; does not require file extension. Analyzes file contents to confirm file type. Even if no file extension is present, the auto-detect system will reliably analyze the contents of the file and identify its file type. Supports over 100 image file formats, Office document file formats, PDF, and more.
|
31
32
|
|
32
33
|
### Example
|
33
34
|
```ruby
|
@@ -81,7 +82,7 @@ Name | Type | Description | Notes
|
|
81
82
|
|
82
83
|
Convert Document to PDF
|
83
84
|
|
84
|
-
Automatically detect file type and convert it to PDF.
|
85
|
+
Automatically detect file type and convert it to PDF. Supports all of the major Office document file formats, over 100 image formats, and even multi-page TIFF files.
|
85
86
|
|
86
87
|
### Example
|
87
88
|
```ruby
|
@@ -130,6 +131,60 @@ Name | Type | Description | Notes
|
|
130
131
|
|
131
132
|
|
132
133
|
|
134
|
+
# **convert_document_autodetect_to_png_array**
|
135
|
+
> AutodetectToPngResult convert_document_autodetect_to_png_array(input_file)
|
136
|
+
|
137
|
+
Convert Document to PNG array
|
138
|
+
|
139
|
+
Automatically detect file type and convert it to an array of PNG images. Supports all of the major Office document file formats, over 100 image formats, and even multi-page TIFF files.
|
140
|
+
|
141
|
+
### Example
|
142
|
+
```ruby
|
143
|
+
# load the gem
|
144
|
+
require 'cloudmersive-convert-api-client'
|
145
|
+
# setup authorization
|
146
|
+
CloudmersiveConvertApiClient.configure do |config|
|
147
|
+
# Configure API key authorization: Apikey
|
148
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
149
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
150
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
151
|
+
end
|
152
|
+
|
153
|
+
api_instance = CloudmersiveConvertApiClient::ConvertDocumentApi.new
|
154
|
+
|
155
|
+
input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
|
156
|
+
|
157
|
+
|
158
|
+
begin
|
159
|
+
#Convert Document to PNG array
|
160
|
+
result = api_instance.convert_document_autodetect_to_png_array(input_file)
|
161
|
+
p result
|
162
|
+
rescue CloudmersiveConvertApiClient::ApiError => e
|
163
|
+
puts "Exception when calling ConvertDocumentApi->convert_document_autodetect_to_png_array: #{e}"
|
164
|
+
end
|
165
|
+
```
|
166
|
+
|
167
|
+
### Parameters
|
168
|
+
|
169
|
+
Name | Type | Description | Notes
|
170
|
+
------------- | ------------- | ------------- | -------------
|
171
|
+
**input_file** | **File**| Input file to perform the operation on. |
|
172
|
+
|
173
|
+
### Return type
|
174
|
+
|
175
|
+
[**AutodetectToPngResult**](AutodetectToPngResult.md)
|
176
|
+
|
177
|
+
### Authorization
|
178
|
+
|
179
|
+
[Apikey](../README.md#Apikey)
|
180
|
+
|
181
|
+
### HTTP request headers
|
182
|
+
|
183
|
+
- **Content-Type**: multipart/form-data
|
184
|
+
- **Accept**: application/octet-stream
|
185
|
+
|
186
|
+
|
187
|
+
|
133
188
|
# **convert_document_csv_to_xlsx**
|
134
189
|
> String convert_document_csv_to_xlsx(input_file)
|
135
190
|
|
@@ -19,6 +19,7 @@ require 'cloudmersive-convert-api-client/configuration'
|
|
19
19
|
# Models
|
20
20
|
require 'cloudmersive-convert-api-client/models/alternate_file_format_candidate'
|
21
21
|
require 'cloudmersive-convert-api-client/models/autodetect_get_info_result'
|
22
|
+
require 'cloudmersive-convert-api-client/models/autodetect_to_png_result'
|
22
23
|
require 'cloudmersive-convert-api-client/models/converted_png_page'
|
23
24
|
require 'cloudmersive-convert-api-client/models/document_validation_error'
|
24
25
|
require 'cloudmersive-convert-api-client/models/document_validation_result'
|
@@ -21,7 +21,7 @@ module CloudmersiveConvertApiClient
|
|
21
21
|
end
|
22
22
|
|
23
23
|
# Get document type information
|
24
|
-
# Auto-detects a document's type information; does not require file extension. Analyzes file contents to confirm file type.
|
24
|
+
# Auto-detects a document's type information; does not require file extension. Analyzes file contents to confirm file type. Even if no file extension is present, the auto-detect system will reliably analyze the contents of the file and identify its file type. Supports over 100 image file formats, Office document file formats, PDF, and more.
|
25
25
|
# @param input_file Input file to perform the operation on.
|
26
26
|
# @param [Hash] opts the optional parameters
|
27
27
|
# @return [AutodetectGetInfoResult]
|
@@ -31,7 +31,7 @@ module CloudmersiveConvertApiClient
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# Get document type information
|
34
|
-
# Auto-detects a document's type information; does not require file extension. Analyzes file contents to confirm file type.
|
34
|
+
# Auto-detects a document's type information; does not require file extension. Analyzes file contents to confirm file type. Even if no file extension is present, the auto-detect system will reliably analyze the contents of the file and identify its file type. Supports over 100 image file formats, Office document file formats, PDF, and more.
|
35
35
|
# @param input_file Input file to perform the operation on.
|
36
36
|
# @param [Hash] opts the optional parameters
|
37
37
|
# @return [Array<(AutodetectGetInfoResult, Fixnum, Hash)>] AutodetectGetInfoResult data, response status code and response headers
|
@@ -77,7 +77,7 @@ module CloudmersiveConvertApiClient
|
|
77
77
|
end
|
78
78
|
|
79
79
|
# Convert Document to PDF
|
80
|
-
# Automatically detect file type and convert it to PDF.
|
80
|
+
# Automatically detect file type and convert it to PDF. Supports all of the major Office document file formats, over 100 image formats, and even multi-page TIFF files.
|
81
81
|
# @param input_file Input file to perform the operation on.
|
82
82
|
# @param [Hash] opts the optional parameters
|
83
83
|
# @return [String]
|
@@ -87,7 +87,7 @@ module CloudmersiveConvertApiClient
|
|
87
87
|
end
|
88
88
|
|
89
89
|
# Convert Document to PDF
|
90
|
-
# Automatically detect file type and convert it to PDF.
|
90
|
+
# Automatically detect file type and convert it to PDF. Supports all of the major Office document file formats, over 100 image formats, and even multi-page TIFF files.
|
91
91
|
# @param input_file Input file to perform the operation on.
|
92
92
|
# @param [Hash] opts the optional parameters
|
93
93
|
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
@@ -132,6 +132,62 @@ module CloudmersiveConvertApiClient
|
|
132
132
|
return data, status_code, headers
|
133
133
|
end
|
134
134
|
|
135
|
+
# Convert Document to PNG array
|
136
|
+
# Automatically detect file type and convert it to an array of PNG images. Supports all of the major Office document file formats, over 100 image formats, and even multi-page TIFF files.
|
137
|
+
# @param input_file Input file to perform the operation on.
|
138
|
+
# @param [Hash] opts the optional parameters
|
139
|
+
# @return [AutodetectToPngResult]
|
140
|
+
def convert_document_autodetect_to_png_array(input_file, opts = {})
|
141
|
+
data, _status_code, _headers = convert_document_autodetect_to_png_array_with_http_info(input_file, opts)
|
142
|
+
return data
|
143
|
+
end
|
144
|
+
|
145
|
+
# Convert Document to PNG array
|
146
|
+
# Automatically detect file type and convert it to an array of PNG images. Supports all of the major Office document file formats, over 100 image formats, and even multi-page TIFF files.
|
147
|
+
# @param input_file Input file to perform the operation on.
|
148
|
+
# @param [Hash] opts the optional parameters
|
149
|
+
# @return [Array<(AutodetectToPngResult, Fixnum, Hash)>] AutodetectToPngResult data, response status code and response headers
|
150
|
+
def convert_document_autodetect_to_png_array_with_http_info(input_file, opts = {})
|
151
|
+
if @api_client.config.debugging
|
152
|
+
@api_client.config.logger.debug "Calling API: ConvertDocumentApi.convert_document_autodetect_to_png_array ..."
|
153
|
+
end
|
154
|
+
# verify the required parameter 'input_file' is set
|
155
|
+
if @api_client.config.client_side_validation && input_file.nil?
|
156
|
+
fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDocumentApi.convert_document_autodetect_to_png_array"
|
157
|
+
end
|
158
|
+
# resource path
|
159
|
+
local_var_path = "/convert/autodetect/to/png"
|
160
|
+
|
161
|
+
# query parameters
|
162
|
+
query_params = {}
|
163
|
+
|
164
|
+
# header parameters
|
165
|
+
header_params = {}
|
166
|
+
# HTTP header 'Accept' (if needed)
|
167
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
168
|
+
# HTTP header 'Content-Type'
|
169
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
170
|
+
|
171
|
+
# form parameters
|
172
|
+
form_params = {}
|
173
|
+
form_params["inputFile"] = input_file
|
174
|
+
|
175
|
+
# http body (model)
|
176
|
+
post_body = nil
|
177
|
+
auth_names = ['Apikey']
|
178
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
179
|
+
:header_params => header_params,
|
180
|
+
:query_params => query_params,
|
181
|
+
:form_params => form_params,
|
182
|
+
:body => post_body,
|
183
|
+
:auth_names => auth_names,
|
184
|
+
:return_type => 'AutodetectToPngResult')
|
185
|
+
if @api_client.config.debugging
|
186
|
+
@api_client.config.logger.debug "API called: ConvertDocumentApi#convert_document_autodetect_to_png_array\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
187
|
+
end
|
188
|
+
return data, status_code, headers
|
189
|
+
end
|
190
|
+
|
135
191
|
# CSV to Excel XLSX
|
136
192
|
# Convert CSV file to Office Excel XLSX Workbooks file format.
|
137
193
|
# @param input_file Input file to perform the operation on.
|
@@ -0,0 +1,201 @@
|
|
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
|
+
# Result of converting an autodetected input to a PNG array
|
17
|
+
class AutodetectToPngResult
|
18
|
+
# True if the operation was successful, false otherwise
|
19
|
+
attr_accessor :successful
|
20
|
+
|
21
|
+
# Array of converted pages
|
22
|
+
attr_accessor :png_result_pages
|
23
|
+
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'successful' => :'Successful',
|
29
|
+
:'png_result_pages' => :'PngResultPages'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.swagger_types
|
35
|
+
{
|
36
|
+
:'successful' => :'BOOLEAN',
|
37
|
+
:'png_result_pages' => :'Array<ConvertedPngPage>'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
def initialize(attributes = {})
|
44
|
+
return unless attributes.is_a?(Hash)
|
45
|
+
|
46
|
+
# convert string to symbol for hash key
|
47
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
48
|
+
|
49
|
+
if attributes.has_key?(:'Successful')
|
50
|
+
self.successful = attributes[:'Successful']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.has_key?(:'PngResultPages')
|
54
|
+
if (value = attributes[:'PngResultPages']).is_a?(Array)
|
55
|
+
self.png_result_pages = value
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
62
|
+
# @return Array for valid properties with the reasons
|
63
|
+
def list_invalid_properties
|
64
|
+
invalid_properties = Array.new
|
65
|
+
return invalid_properties
|
66
|
+
end
|
67
|
+
|
68
|
+
# Check to see if the all the properties in the model are valid
|
69
|
+
# @return true if the model is valid
|
70
|
+
def valid?
|
71
|
+
return true
|
72
|
+
end
|
73
|
+
|
74
|
+
# Checks equality by comparing each attribute.
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def ==(o)
|
77
|
+
return true if self.equal?(o)
|
78
|
+
self.class == o.class &&
|
79
|
+
successful == o.successful &&
|
80
|
+
png_result_pages == o.png_result_pages
|
81
|
+
end
|
82
|
+
|
83
|
+
# @see the `==` method
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def eql?(o)
|
86
|
+
self == o
|
87
|
+
end
|
88
|
+
|
89
|
+
# Calculates hash code according to all attributes.
|
90
|
+
# @return [Fixnum] Hash code
|
91
|
+
def hash
|
92
|
+
[successful, png_result_pages].hash
|
93
|
+
end
|
94
|
+
|
95
|
+
# Builds the object from hash
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
97
|
+
# @return [Object] Returns the model itself
|
98
|
+
def build_from_hash(attributes)
|
99
|
+
return nil unless attributes.is_a?(Hash)
|
100
|
+
self.class.swagger_types.each_pair do |key, type|
|
101
|
+
if type =~ /\AArray<(.*)>/i
|
102
|
+
# check to ensure the input is an array given that the the attribute
|
103
|
+
# is documented as an array but the input is not
|
104
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
105
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
106
|
+
end
|
107
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
108
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
109
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
110
|
+
end
|
111
|
+
|
112
|
+
self
|
113
|
+
end
|
114
|
+
|
115
|
+
# Deserializes the data based on type
|
116
|
+
# @param string type Data type
|
117
|
+
# @param string value Value to be deserialized
|
118
|
+
# @return [Object] Deserialized data
|
119
|
+
def _deserialize(type, value)
|
120
|
+
case type.to_sym
|
121
|
+
when :DateTime
|
122
|
+
DateTime.parse(value)
|
123
|
+
when :Date
|
124
|
+
Date.parse(value)
|
125
|
+
when :String
|
126
|
+
value.to_s
|
127
|
+
when :Integer
|
128
|
+
value.to_i
|
129
|
+
when :Float
|
130
|
+
value.to_f
|
131
|
+
when :BOOLEAN
|
132
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
133
|
+
true
|
134
|
+
else
|
135
|
+
false
|
136
|
+
end
|
137
|
+
when :Object
|
138
|
+
# generic object (usually a Hash), return directly
|
139
|
+
value
|
140
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
141
|
+
inner_type = Regexp.last_match[:inner_type]
|
142
|
+
value.map { |v| _deserialize(inner_type, v) }
|
143
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
144
|
+
k_type = Regexp.last_match[:k_type]
|
145
|
+
v_type = Regexp.last_match[:v_type]
|
146
|
+
{}.tap do |hash|
|
147
|
+
value.each do |k, v|
|
148
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
else # model
|
152
|
+
temp_model = CloudmersiveConvertApiClient.const_get(type).new
|
153
|
+
temp_model.build_from_hash(value)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the string representation of the object
|
158
|
+
# @return [String] String presentation of the object
|
159
|
+
def to_s
|
160
|
+
to_hash.to_s
|
161
|
+
end
|
162
|
+
|
163
|
+
# to_body is an alias to to_hash (backward compatibility)
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
165
|
+
def to_body
|
166
|
+
to_hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Returns the object in the form of hash
|
170
|
+
# @return [Hash] Returns the object in the form of hash
|
171
|
+
def to_hash
|
172
|
+
hash = {}
|
173
|
+
self.class.attribute_map.each_pair do |attr, param|
|
174
|
+
value = self.send(attr)
|
175
|
+
next if value.nil?
|
176
|
+
hash[param] = _to_hash(value)
|
177
|
+
end
|
178
|
+
hash
|
179
|
+
end
|
180
|
+
|
181
|
+
# Outputs non-array value in the form of hash
|
182
|
+
# For object, use to_hash. Otherwise, just return the value
|
183
|
+
# @param [Object] value Any valid value
|
184
|
+
# @return [Hash] Returns the value in the form of hash
|
185
|
+
def _to_hash(value)
|
186
|
+
if value.is_a?(Array)
|
187
|
+
value.compact.map{ |v| _to_hash(v) }
|
188
|
+
elsif value.is_a?(Hash)
|
189
|
+
{}.tap do |hash|
|
190
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
191
|
+
end
|
192
|
+
elsif value.respond_to? :to_hash
|
193
|
+
value.to_hash
|
194
|
+
else
|
195
|
+
value
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
@@ -34,7 +34,7 @@ describe 'ConvertDocumentApi' do
|
|
34
34
|
|
35
35
|
# unit tests for convert_document_autodetect_get_info
|
36
36
|
# Get document type information
|
37
|
-
# Auto-detects a document's type information; does not require file extension. Analyzes file contents to confirm file type.
|
37
|
+
# Auto-detects a document's type information; does not require file extension. Analyzes file contents to confirm file type. Even if no file extension is present, the auto-detect system will reliably analyze the contents of the file and identify its file type. Supports over 100 image file formats, Office document file formats, PDF, and more.
|
38
38
|
# @param input_file Input file to perform the operation on.
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
40
|
# @return [AutodetectGetInfoResult]
|
@@ -46,7 +46,7 @@ describe 'ConvertDocumentApi' do
|
|
46
46
|
|
47
47
|
# unit tests for convert_document_autodetect_to_pdf
|
48
48
|
# Convert Document to PDF
|
49
|
-
# Automatically detect file type and convert it to PDF.
|
49
|
+
# Automatically detect file type and convert it to PDF. Supports all of the major Office document file formats, over 100 image formats, and even multi-page TIFF files.
|
50
50
|
# @param input_file Input file to perform the operation on.
|
51
51
|
# @param [Hash] opts the optional parameters
|
52
52
|
# @return [String]
|
@@ -56,6 +56,18 @@ describe 'ConvertDocumentApi' do
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
+
# unit tests for convert_document_autodetect_to_png_array
|
60
|
+
# Convert Document to PNG array
|
61
|
+
# Automatically detect file type and convert it to an array of PNG images. Supports all of the major Office document file formats, over 100 image formats, and even multi-page TIFF files.
|
62
|
+
# @param input_file Input file to perform the operation on.
|
63
|
+
# @param [Hash] opts the optional parameters
|
64
|
+
# @return [AutodetectToPngResult]
|
65
|
+
describe 'convert_document_autodetect_to_png_array test' do
|
66
|
+
it "should work" do
|
67
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
59
71
|
# unit tests for convert_document_csv_to_xlsx
|
60
72
|
# CSV to Excel XLSX
|
61
73
|
# Convert CSV file to Office Excel XLSX Workbooks file format.
|
@@ -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::AutodetectToPngResult
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'AutodetectToPngResult' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveConvertApiClient::AutodetectToPngResult.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of AutodetectToPngResult' do
|
31
|
+
it 'should create an instance of AutodetectToPngResult' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::AutodetectToPngResult)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "successful"' 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 "png_result_pages"' 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.3.
|
4
|
+
version: 1.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloudmersive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -204,6 +204,7 @@ files:
|
|
204
204
|
- "./cloudmersive-convert-api-client.gemspec"
|
205
205
|
- "./docs/AlternateFileFormatCandidate.md"
|
206
206
|
- "./docs/AutodetectGetInfoResult.md"
|
207
|
+
- "./docs/AutodetectToPngResult.md"
|
207
208
|
- "./docs/CompareDocumentApi.md"
|
208
209
|
- "./docs/ConvertDataApi.md"
|
209
210
|
- "./docs/ConvertDocumentApi.md"
|
@@ -305,6 +306,7 @@ files:
|
|
305
306
|
- "./lib/cloudmersive-convert-api-client/configuration.rb"
|
306
307
|
- "./lib/cloudmersive-convert-api-client/models/alternate_file_format_candidate.rb"
|
307
308
|
- "./lib/cloudmersive-convert-api-client/models/autodetect_get_info_result.rb"
|
309
|
+
- "./lib/cloudmersive-convert-api-client/models/autodetect_to_png_result.rb"
|
308
310
|
- "./lib/cloudmersive-convert-api-client/models/converted_png_page.rb"
|
309
311
|
- "./lib/cloudmersive-convert-api-client/models/document_validation_error.rb"
|
310
312
|
- "./lib/cloudmersive-convert-api-client/models/document_validation_result.rb"
|
@@ -394,6 +396,7 @@ files:
|
|
394
396
|
- "./spec/configuration_spec.rb"
|
395
397
|
- "./spec/models/alternate_file_format_candidate_spec.rb"
|
396
398
|
- "./spec/models/autodetect_get_info_result_spec.rb"
|
399
|
+
- "./spec/models/autodetect_to_png_result_spec.rb"
|
397
400
|
- "./spec/models/converted_png_page_spec.rb"
|
398
401
|
- "./spec/models/document_validation_error_spec.rb"
|
399
402
|
- "./spec/models/document_validation_result_spec.rb"
|