cloudmersive-convert-api-client 1.6.0 → 1.6.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/CreateSpreadsheetFromDataRequest.md +9 -0
- data/docs/CreateSpreadsheetFromDataResponse.md +9 -0
- data/docs/EditDocumentApi.md +55 -0
- data/lib/cloudmersive-convert-api-client.rb +2 -0
- data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +55 -0
- data/lib/cloudmersive-convert-api-client/models/create_spreadsheet_from_data_request.rb +201 -0
- data/lib/cloudmersive-convert-api-client/models/create_spreadsheet_from_data_response.rb +199 -0
- data/lib/cloudmersive-convert-api-client/version.rb +1 -1
- data/spec/api/edit_document_api_spec.rb +12 -0
- data/spec/models/create_spreadsheet_from_data_request_spec.rb +48 -0
- data/spec/models/create_spreadsheet_from_data_response_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: 6df52bbc6ee4997168e1d878f87585ce521423c676e1cffe8884a58357230db8
|
4
|
+
data.tar.gz: '039cbb039e9a565d3f172c9700e2d39a8a4d6fa1be0c52b71233bbd09d2b8e5f'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fff288045314be9ffde4b796f7521589f5838eef7586dc539a29827df999497dc4e27f4620f433e6c6968daf5f533d0224f49f6080f2dc59040898e055a2fb62
|
7
|
+
data.tar.gz: 57a07834e9ab99bf8e0cadc7f4f5aaa0c92660ca823159ad116b1714f29abf5ff5fd18e05b548490dd801f15be94163e95b9c0d39f3c813df299e872951977e4
|
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.6.
|
10
|
+
- Package version: 1.6.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.6.
|
26
|
+
gem install ./cloudmersive-convert-api-client-1.6.1.gem
|
27
27
|
```
|
28
|
-
(for development, run `gem install --dev ./cloudmersive-convert-api-client-1.6.
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-convert-api-client-1.6.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.6.
|
34
|
+
gem 'cloudmersive-convert-api-client', '~> 1.6.1'
|
35
35
|
|
36
36
|
### Install from Git
|
37
37
|
|
@@ -173,6 +173,7 @@ Class | Method | HTTP request | Description
|
|
173
173
|
*CloudmersiveConvertApiClient::EditDocumentApi* | [**edit_document_pptx_delete_slides**](docs/EditDocumentApi.md#edit_document_pptx_delete_slides) | **POST** /convert/edit/pptx/delete-slides | Delete, remove slides from a PowerPoint PPTX presentation document
|
174
174
|
*CloudmersiveConvertApiClient::EditDocumentApi* | [**edit_document_pptx_replace**](docs/EditDocumentApi.md#edit_document_pptx_replace) | **POST** /convert/edit/pptx/replace-all | Replace string in PowerPoint PPTX presentation
|
175
175
|
*CloudmersiveConvertApiClient::EditDocumentApi* | [**edit_document_xlsx_create_blank_spreadsheet**](docs/EditDocumentApi.md#edit_document_xlsx_create_blank_spreadsheet) | **POST** /convert/edit/xlsx/create/blank | Create a blank Excel XLSX spreadsheet
|
176
|
+
*CloudmersiveConvertApiClient::EditDocumentApi* | [**edit_document_xlsx_create_spreadsheet_from_data**](docs/EditDocumentApi.md#edit_document_xlsx_create_spreadsheet_from_data) | **POST** /convert/edit/xlsx/create/from/data | Create a new Excel XLSX spreadsheet from column and row data
|
176
177
|
*CloudmersiveConvertApiClient::EditDocumentApi* | [**edit_document_xlsx_get_cell_by_index**](docs/EditDocumentApi.md#edit_document_xlsx_get_cell_by_index) | **POST** /convert/edit/xlsx/get-cell/by-index | Get cell from an Excel XLSX spreadsheet, worksheet by index
|
177
178
|
*CloudmersiveConvertApiClient::EditDocumentApi* | [**edit_document_xlsx_get_columns**](docs/EditDocumentApi.md#edit_document_xlsx_get_columns) | **POST** /convert/edit/xlsx/get-columns | Get rows and cells from a Excel XLSX spreadsheet, worksheet
|
178
179
|
*CloudmersiveConvertApiClient::EditDocumentApi* | [**edit_document_xlsx_get_images**](docs/EditDocumentApi.md#edit_document_xlsx_get_images) | **POST** /convert/edit/xlsx/get-images | Get images from a Excel XLSX spreadsheet, worksheet
|
@@ -234,6 +235,8 @@ Class | Method | HTTP request | Description
|
|
234
235
|
- [CloudmersiveConvertApiClient::CreateBlankDocxResponse](docs/CreateBlankDocxResponse.md)
|
235
236
|
- [CloudmersiveConvertApiClient::CreateBlankSpreadsheetRequest](docs/CreateBlankSpreadsheetRequest.md)
|
236
237
|
- [CloudmersiveConvertApiClient::CreateBlankSpreadsheetResponse](docs/CreateBlankSpreadsheetResponse.md)
|
238
|
+
- [CloudmersiveConvertApiClient::CreateSpreadsheetFromDataRequest](docs/CreateSpreadsheetFromDataRequest.md)
|
239
|
+
- [CloudmersiveConvertApiClient::CreateSpreadsheetFromDataResponse](docs/CreateSpreadsheetFromDataResponse.md)
|
237
240
|
- [CloudmersiveConvertApiClient::DeleteDocxTableRowRequest](docs/DeleteDocxTableRowRequest.md)
|
238
241
|
- [CloudmersiveConvertApiClient::DeleteDocxTableRowResponse](docs/DeleteDocxTableRowResponse.md)
|
239
242
|
- [CloudmersiveConvertApiClient::DocumentValidationError](docs/DocumentValidationError.md)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CloudmersiveConvertApiClient::CreateSpreadsheetFromDataRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**worksheet_name** | **String** | Optional; The new Spreadsheet will have a default Worksheet in it; supply a name, or if left empty, will default to Worksheet1 | [optional]
|
7
|
+
**rows** | [**Array<XlsxSpreadsheetRow>**](XlsxSpreadsheetRow.md) | Required; Rows and cells to populate the spreadsheet with | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CloudmersiveConvertApiClient::CreateSpreadsheetFromDataResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**successful** | **BOOLEAN** | True if successful, false otherwise | [optional]
|
7
|
+
**edited_document_url** | **String** | URL to the edited XLSX file; file is stored in an in-memory cache and will be deleted. Call Finish-Editing to get the result document contents. | [optional]
|
8
|
+
|
9
|
+
|
data/docs/EditDocumentApi.md
CHANGED
@@ -33,6 +33,7 @@ Method | HTTP request | Description
|
|
33
33
|
[**edit_document_pptx_delete_slides**](EditDocumentApi.md#edit_document_pptx_delete_slides) | **POST** /convert/edit/pptx/delete-slides | Delete, remove slides from a PowerPoint PPTX presentation document
|
34
34
|
[**edit_document_pptx_replace**](EditDocumentApi.md#edit_document_pptx_replace) | **POST** /convert/edit/pptx/replace-all | Replace string in PowerPoint PPTX presentation
|
35
35
|
[**edit_document_xlsx_create_blank_spreadsheet**](EditDocumentApi.md#edit_document_xlsx_create_blank_spreadsheet) | **POST** /convert/edit/xlsx/create/blank | Create a blank Excel XLSX spreadsheet
|
36
|
+
[**edit_document_xlsx_create_spreadsheet_from_data**](EditDocumentApi.md#edit_document_xlsx_create_spreadsheet_from_data) | **POST** /convert/edit/xlsx/create/from/data | Create a new Excel XLSX spreadsheet from column and row data
|
36
37
|
[**edit_document_xlsx_get_cell_by_index**](EditDocumentApi.md#edit_document_xlsx_get_cell_by_index) | **POST** /convert/edit/xlsx/get-cell/by-index | Get cell from an Excel XLSX spreadsheet, worksheet by index
|
37
38
|
[**edit_document_xlsx_get_columns**](EditDocumentApi.md#edit_document_xlsx_get_columns) | **POST** /convert/edit/xlsx/get-columns | Get rows and cells from a Excel XLSX spreadsheet, worksheet
|
38
39
|
[**edit_document_xlsx_get_images**](EditDocumentApi.md#edit_document_xlsx_get_images) | **POST** /convert/edit/xlsx/get-images | Get images from a Excel XLSX spreadsheet, worksheet
|
@@ -1608,6 +1609,60 @@ Name | Type | Description | Notes
|
|
1608
1609
|
|
1609
1610
|
|
1610
1611
|
|
1612
|
+
# **edit_document_xlsx_create_spreadsheet_from_data**
|
1613
|
+
> CreateSpreadsheetFromDataResponse edit_document_xlsx_create_spreadsheet_from_data(input)
|
1614
|
+
|
1615
|
+
Create a new Excel XLSX spreadsheet from column and row data
|
1616
|
+
|
1617
|
+
Returns a new Excel XLSX Spreadsheet (XLSX) format file populated with column and row data specified as input
|
1618
|
+
|
1619
|
+
### Example
|
1620
|
+
```ruby
|
1621
|
+
# load the gem
|
1622
|
+
require 'cloudmersive-convert-api-client'
|
1623
|
+
# setup authorization
|
1624
|
+
CloudmersiveConvertApiClient.configure do |config|
|
1625
|
+
# Configure API key authorization: Apikey
|
1626
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
1627
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1628
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
1629
|
+
end
|
1630
|
+
|
1631
|
+
api_instance = CloudmersiveConvertApiClient::EditDocumentApi.new
|
1632
|
+
|
1633
|
+
input = CloudmersiveConvertApiClient::CreateSpreadsheetFromDataRequest.new # CreateSpreadsheetFromDataRequest | Document input request
|
1634
|
+
|
1635
|
+
|
1636
|
+
begin
|
1637
|
+
#Create a new Excel XLSX spreadsheet from column and row data
|
1638
|
+
result = api_instance.edit_document_xlsx_create_spreadsheet_from_data(input)
|
1639
|
+
p result
|
1640
|
+
rescue CloudmersiveConvertApiClient::ApiError => e
|
1641
|
+
puts "Exception when calling EditDocumentApi->edit_document_xlsx_create_spreadsheet_from_data: #{e}"
|
1642
|
+
end
|
1643
|
+
```
|
1644
|
+
|
1645
|
+
### Parameters
|
1646
|
+
|
1647
|
+
Name | Type | Description | Notes
|
1648
|
+
------------- | ------------- | ------------- | -------------
|
1649
|
+
**input** | [**CreateSpreadsheetFromDataRequest**](CreateSpreadsheetFromDataRequest.md)| Document input request |
|
1650
|
+
|
1651
|
+
### Return type
|
1652
|
+
|
1653
|
+
[**CreateSpreadsheetFromDataResponse**](CreateSpreadsheetFromDataResponse.md)
|
1654
|
+
|
1655
|
+
### Authorization
|
1656
|
+
|
1657
|
+
[Apikey](../README.md#Apikey)
|
1658
|
+
|
1659
|
+
### HTTP request headers
|
1660
|
+
|
1661
|
+
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
1662
|
+
- **Accept**: application/json, text/json, application/xml, text/xml
|
1663
|
+
|
1664
|
+
|
1665
|
+
|
1611
1666
|
# **edit_document_xlsx_get_cell_by_index**
|
1612
1667
|
> GetXlsxCellResponse edit_document_xlsx_get_cell_by_index(input)
|
1613
1668
|
|
@@ -27,6 +27,8 @@ require 'cloudmersive-convert-api-client/models/create_blank_docx_request'
|
|
27
27
|
require 'cloudmersive-convert-api-client/models/create_blank_docx_response'
|
28
28
|
require 'cloudmersive-convert-api-client/models/create_blank_spreadsheet_request'
|
29
29
|
require 'cloudmersive-convert-api-client/models/create_blank_spreadsheet_response'
|
30
|
+
require 'cloudmersive-convert-api-client/models/create_spreadsheet_from_data_request'
|
31
|
+
require 'cloudmersive-convert-api-client/models/create_spreadsheet_from_data_response'
|
30
32
|
require 'cloudmersive-convert-api-client/models/delete_docx_table_row_request'
|
31
33
|
require 'cloudmersive-convert-api-client/models/delete_docx_table_row_response'
|
32
34
|
require 'cloudmersive-convert-api-client/models/document_validation_error'
|
@@ -1616,6 +1616,61 @@ module CloudmersiveConvertApiClient
|
|
1616
1616
|
return data, status_code, headers
|
1617
1617
|
end
|
1618
1618
|
|
1619
|
+
# Create a new Excel XLSX spreadsheet from column and row data
|
1620
|
+
# Returns a new Excel XLSX Spreadsheet (XLSX) format file populated with column and row data specified as input
|
1621
|
+
# @param input Document input request
|
1622
|
+
# @param [Hash] opts the optional parameters
|
1623
|
+
# @return [CreateSpreadsheetFromDataResponse]
|
1624
|
+
def edit_document_xlsx_create_spreadsheet_from_data(input, opts = {})
|
1625
|
+
data, _status_code, _headers = edit_document_xlsx_create_spreadsheet_from_data_with_http_info(input, opts)
|
1626
|
+
return data
|
1627
|
+
end
|
1628
|
+
|
1629
|
+
# Create a new Excel XLSX spreadsheet from column and row data
|
1630
|
+
# Returns a new Excel XLSX Spreadsheet (XLSX) format file populated with column and row data specified as input
|
1631
|
+
# @param input Document input request
|
1632
|
+
# @param [Hash] opts the optional parameters
|
1633
|
+
# @return [Array<(CreateSpreadsheetFromDataResponse, Fixnum, Hash)>] CreateSpreadsheetFromDataResponse data, response status code and response headers
|
1634
|
+
def edit_document_xlsx_create_spreadsheet_from_data_with_http_info(input, opts = {})
|
1635
|
+
if @api_client.config.debugging
|
1636
|
+
@api_client.config.logger.debug "Calling API: EditDocumentApi.edit_document_xlsx_create_spreadsheet_from_data ..."
|
1637
|
+
end
|
1638
|
+
# verify the required parameter 'input' is set
|
1639
|
+
if @api_client.config.client_side_validation && input.nil?
|
1640
|
+
fail ArgumentError, "Missing the required parameter 'input' when calling EditDocumentApi.edit_document_xlsx_create_spreadsheet_from_data"
|
1641
|
+
end
|
1642
|
+
# resource path
|
1643
|
+
local_var_path = "/convert/edit/xlsx/create/from/data"
|
1644
|
+
|
1645
|
+
# query parameters
|
1646
|
+
query_params = {}
|
1647
|
+
|
1648
|
+
# header parameters
|
1649
|
+
header_params = {}
|
1650
|
+
# HTTP header 'Accept' (if needed)
|
1651
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
1652
|
+
# HTTP header 'Content-Type'
|
1653
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
1654
|
+
|
1655
|
+
# form parameters
|
1656
|
+
form_params = {}
|
1657
|
+
|
1658
|
+
# http body (model)
|
1659
|
+
post_body = @api_client.object_to_http_body(input)
|
1660
|
+
auth_names = ['Apikey']
|
1661
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
1662
|
+
:header_params => header_params,
|
1663
|
+
:query_params => query_params,
|
1664
|
+
:form_params => form_params,
|
1665
|
+
:body => post_body,
|
1666
|
+
:auth_names => auth_names,
|
1667
|
+
:return_type => 'CreateSpreadsheetFromDataResponse')
|
1668
|
+
if @api_client.config.debugging
|
1669
|
+
@api_client.config.logger.debug "API called: EditDocumentApi#edit_document_xlsx_create_spreadsheet_from_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1670
|
+
end
|
1671
|
+
return data, status_code, headers
|
1672
|
+
end
|
1673
|
+
|
1619
1674
|
# Get cell from an Excel XLSX spreadsheet, worksheet by index
|
1620
1675
|
# Returns the rows and cells defined in the Excel Spreadsheet worksheet
|
1621
1676
|
# @param input Document input request
|
@@ -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: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CloudmersiveConvertApiClient
|
16
|
+
# Input to Create a new Spreadsheet request
|
17
|
+
class CreateSpreadsheetFromDataRequest
|
18
|
+
# Optional; The new Spreadsheet will have a default Worksheet in it; supply a name, or if left empty, will default to Worksheet1
|
19
|
+
attr_accessor :worksheet_name
|
20
|
+
|
21
|
+
# Required; Rows and cells to populate the spreadsheet with
|
22
|
+
attr_accessor :rows
|
23
|
+
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'worksheet_name' => :'WorksheetName',
|
29
|
+
:'rows' => :'Rows'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.swagger_types
|
35
|
+
{
|
36
|
+
:'worksheet_name' => :'String',
|
37
|
+
:'rows' => :'Array<XlsxSpreadsheetRow>'
|
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?(:'WorksheetName')
|
50
|
+
self.worksheet_name = attributes[:'WorksheetName']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.has_key?(:'Rows')
|
54
|
+
if (value = attributes[:'Rows']).is_a?(Array)
|
55
|
+
self.rows = 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
|
+
worksheet_name == o.worksheet_name &&
|
80
|
+
rows == o.rows
|
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
|
+
[worksheet_name, rows].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
|
@@ -0,0 +1,199 @@
|
|
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
|
+
# Result of creating a new worksheet from rows and cells
|
17
|
+
class CreateSpreadsheetFromDataResponse
|
18
|
+
# True if successful, false otherwise
|
19
|
+
attr_accessor :successful
|
20
|
+
|
21
|
+
# URL to the edited XLSX file; file is stored in an in-memory cache and will be deleted. Call Finish-Editing to get the result document contents.
|
22
|
+
attr_accessor :edited_document_url
|
23
|
+
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'successful' => :'Successful',
|
29
|
+
:'edited_document_url' => :'EditedDocumentURL'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.swagger_types
|
35
|
+
{
|
36
|
+
:'successful' => :'BOOLEAN',
|
37
|
+
:'edited_document_url' => :'String'
|
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?(:'EditedDocumentURL')
|
54
|
+
self.edited_document_url = attributes[:'EditedDocumentURL']
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
60
|
+
# @return Array for valid properties with the reasons
|
61
|
+
def list_invalid_properties
|
62
|
+
invalid_properties = Array.new
|
63
|
+
return invalid_properties
|
64
|
+
end
|
65
|
+
|
66
|
+
# Check to see if the all the properties in the model are valid
|
67
|
+
# @return true if the model is valid
|
68
|
+
def valid?
|
69
|
+
return true
|
70
|
+
end
|
71
|
+
|
72
|
+
# Checks equality by comparing each attribute.
|
73
|
+
# @param [Object] Object to be compared
|
74
|
+
def ==(o)
|
75
|
+
return true if self.equal?(o)
|
76
|
+
self.class == o.class &&
|
77
|
+
successful == o.successful &&
|
78
|
+
edited_document_url == o.edited_document_url
|
79
|
+
end
|
80
|
+
|
81
|
+
# @see the `==` method
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def eql?(o)
|
84
|
+
self == o
|
85
|
+
end
|
86
|
+
|
87
|
+
# Calculates hash code according to all attributes.
|
88
|
+
# @return [Fixnum] Hash code
|
89
|
+
def hash
|
90
|
+
[successful, edited_document_url].hash
|
91
|
+
end
|
92
|
+
|
93
|
+
# Builds the object from hash
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
# @return [Object] Returns the model itself
|
96
|
+
def build_from_hash(attributes)
|
97
|
+
return nil unless attributes.is_a?(Hash)
|
98
|
+
self.class.swagger_types.each_pair do |key, type|
|
99
|
+
if type =~ /\AArray<(.*)>/i
|
100
|
+
# check to ensure the input is an array given that the the attribute
|
101
|
+
# is documented as an array but the input is not
|
102
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
103
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
104
|
+
end
|
105
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
106
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
107
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
108
|
+
end
|
109
|
+
|
110
|
+
self
|
111
|
+
end
|
112
|
+
|
113
|
+
# Deserializes the data based on type
|
114
|
+
# @param string type Data type
|
115
|
+
# @param string value Value to be deserialized
|
116
|
+
# @return [Object] Deserialized data
|
117
|
+
def _deserialize(type, value)
|
118
|
+
case type.to_sym
|
119
|
+
when :DateTime
|
120
|
+
DateTime.parse(value)
|
121
|
+
when :Date
|
122
|
+
Date.parse(value)
|
123
|
+
when :String
|
124
|
+
value.to_s
|
125
|
+
when :Integer
|
126
|
+
value.to_i
|
127
|
+
when :Float
|
128
|
+
value.to_f
|
129
|
+
when :BOOLEAN
|
130
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
131
|
+
true
|
132
|
+
else
|
133
|
+
false
|
134
|
+
end
|
135
|
+
when :Object
|
136
|
+
# generic object (usually a Hash), return directly
|
137
|
+
value
|
138
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
139
|
+
inner_type = Regexp.last_match[:inner_type]
|
140
|
+
value.map { |v| _deserialize(inner_type, v) }
|
141
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
142
|
+
k_type = Regexp.last_match[:k_type]
|
143
|
+
v_type = Regexp.last_match[:v_type]
|
144
|
+
{}.tap do |hash|
|
145
|
+
value.each do |k, v|
|
146
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
else # model
|
150
|
+
temp_model = CloudmersiveConvertApiClient.const_get(type).new
|
151
|
+
temp_model.build_from_hash(value)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns the string representation of the object
|
156
|
+
# @return [String] String presentation of the object
|
157
|
+
def to_s
|
158
|
+
to_hash.to_s
|
159
|
+
end
|
160
|
+
|
161
|
+
# to_body is an alias to to_hash (backward compatibility)
|
162
|
+
# @return [Hash] Returns the object in the form of hash
|
163
|
+
def to_body
|
164
|
+
to_hash
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the object in the form of hash
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
169
|
+
def to_hash
|
170
|
+
hash = {}
|
171
|
+
self.class.attribute_map.each_pair do |attr, param|
|
172
|
+
value = self.send(attr)
|
173
|
+
next if value.nil?
|
174
|
+
hash[param] = _to_hash(value)
|
175
|
+
end
|
176
|
+
hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Outputs non-array value in the form of hash
|
180
|
+
# For object, use to_hash. Otherwise, just return the value
|
181
|
+
# @param [Object] value Any valid value
|
182
|
+
# @return [Hash] Returns the value in the form of hash
|
183
|
+
def _to_hash(value)
|
184
|
+
if value.is_a?(Array)
|
185
|
+
value.compact.map{ |v| _to_hash(v) }
|
186
|
+
elsif value.is_a?(Hash)
|
187
|
+
{}.tap do |hash|
|
188
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
189
|
+
end
|
190
|
+
elsif value.respond_to? :to_hash
|
191
|
+
value.to_hash
|
192
|
+
else
|
193
|
+
value
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
end
|
198
|
+
|
199
|
+
end
|
@@ -380,6 +380,18 @@ describe 'EditDocumentApi' do
|
|
380
380
|
end
|
381
381
|
end
|
382
382
|
|
383
|
+
# unit tests for edit_document_xlsx_create_spreadsheet_from_data
|
384
|
+
# Create a new Excel XLSX spreadsheet from column and row data
|
385
|
+
# Returns a new Excel XLSX Spreadsheet (XLSX) format file populated with column and row data specified as input
|
386
|
+
# @param input Document input request
|
387
|
+
# @param [Hash] opts the optional parameters
|
388
|
+
# @return [CreateSpreadsheetFromDataResponse]
|
389
|
+
describe 'edit_document_xlsx_create_spreadsheet_from_data test' do
|
390
|
+
it "should work" do
|
391
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
392
|
+
end
|
393
|
+
end
|
394
|
+
|
383
395
|
# unit tests for edit_document_xlsx_get_cell_by_index
|
384
396
|
# Get cell from an Excel XLSX spreadsheet, worksheet by index
|
385
397
|
# Returns the rows and cells defined in the Excel Spreadsheet worksheet
|
@@ -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::CreateSpreadsheetFromDataRequest
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'CreateSpreadsheetFromDataRequest' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveConvertApiClient::CreateSpreadsheetFromDataRequest.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of CreateSpreadsheetFromDataRequest' do
|
31
|
+
it 'should create an instance of CreateSpreadsheetFromDataRequest' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::CreateSpreadsheetFromDataRequest)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "worksheet_name"' 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 "rows"' 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,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::CreateSpreadsheetFromDataResponse
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'CreateSpreadsheetFromDataResponse' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveConvertApiClient::CreateSpreadsheetFromDataResponse.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of CreateSpreadsheetFromDataResponse' do
|
31
|
+
it 'should create an instance of CreateSpreadsheetFromDataResponse' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::CreateSpreadsheetFromDataResponse)
|
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 "edited_document_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
|
+
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.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloudmersive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -218,6 +218,8 @@ files:
|
|
218
218
|
- "./docs/CreateBlankDocxResponse.md"
|
219
219
|
- "./docs/CreateBlankSpreadsheetRequest.md"
|
220
220
|
- "./docs/CreateBlankSpreadsheetResponse.md"
|
221
|
+
- "./docs/CreateSpreadsheetFromDataRequest.md"
|
222
|
+
- "./docs/CreateSpreadsheetFromDataResponse.md"
|
221
223
|
- "./docs/DeleteDocxTableRowRequest.md"
|
222
224
|
- "./docs/DeleteDocxTableRowResponse.md"
|
223
225
|
- "./docs/DocumentValidationError.md"
|
@@ -379,6 +381,8 @@ files:
|
|
379
381
|
- "./lib/cloudmersive-convert-api-client/models/create_blank_docx_response.rb"
|
380
382
|
- "./lib/cloudmersive-convert-api-client/models/create_blank_spreadsheet_request.rb"
|
381
383
|
- "./lib/cloudmersive-convert-api-client/models/create_blank_spreadsheet_response.rb"
|
384
|
+
- "./lib/cloudmersive-convert-api-client/models/create_spreadsheet_from_data_request.rb"
|
385
|
+
- "./lib/cloudmersive-convert-api-client/models/create_spreadsheet_from_data_response.rb"
|
382
386
|
- "./lib/cloudmersive-convert-api-client/models/delete_docx_table_row_request.rb"
|
383
387
|
- "./lib/cloudmersive-convert-api-client/models/delete_docx_table_row_response.rb"
|
384
388
|
- "./lib/cloudmersive-convert-api-client/models/document_validation_error.rb"
|
@@ -532,6 +536,8 @@ files:
|
|
532
536
|
- "./spec/models/create_blank_docx_response_spec.rb"
|
533
537
|
- "./spec/models/create_blank_spreadsheet_request_spec.rb"
|
534
538
|
- "./spec/models/create_blank_spreadsheet_response_spec.rb"
|
539
|
+
- "./spec/models/create_spreadsheet_from_data_request_spec.rb"
|
540
|
+
- "./spec/models/create_spreadsheet_from_data_response_spec.rb"
|
535
541
|
- "./spec/models/delete_docx_table_row_request_spec.rb"
|
536
542
|
- "./spec/models/delete_docx_table_row_response_spec.rb"
|
537
543
|
- "./spec/models/document_validation_error_spec.rb"
|