aspose_cells_cloud 21.6 → 21.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,285 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2021 Aspose.Cells Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+
21
+ =end
22
+
23
+ require 'date'
24
+
25
+ module AsposeCellsCloud
26
+
27
+ class ImportPictureOption
28
+ attr_accessor :source
29
+
30
+ attr_accessor :import_data_type
31
+
32
+ attr_accessor :destination_worksheet
33
+
34
+ attr_accessor :is_insert
35
+
36
+ # Upper Left Row.
37
+ attr_accessor :upper_left_row
38
+
39
+ # Upper Left Column.
40
+ attr_accessor :upper_left_column
41
+
42
+ # Lower Right Row.
43
+ attr_accessor :lower_right_row
44
+
45
+ # Lower Right Column.
46
+ attr_accessor :lower_right_column
47
+
48
+ # Filename.
49
+ attr_accessor :filename
50
+
51
+ # data : base64 string.
52
+ attr_accessor :data
53
+
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'source' => :'Source',
59
+ :'import_data_type' => :'ImportDataType',
60
+ :'destination_worksheet' => :'DestinationWorksheet',
61
+ :'is_insert' => :'IsInsert',
62
+ :'upper_left_row' => :'UpperLeftRow',
63
+ :'upper_left_column' => :'UpperLeftColumn',
64
+ :'lower_right_row' => :'LowerRightRow',
65
+ :'lower_right_column' => :'LowerRightColumn',
66
+ :'filename' => :'Filename',
67
+ :'data' => :'Data'
68
+ }
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.swagger_types
73
+ {
74
+ :'source' => :'FileSource',
75
+ :'import_data_type' => :'String',
76
+ :'destination_worksheet' => :'String',
77
+ :'is_insert' => :'BOOLEAN',
78
+ :'upper_left_row' => :'Integer',
79
+ :'upper_left_column' => :'Integer',
80
+ :'lower_right_row' => :'Integer',
81
+ :'lower_right_column' => :'Integer',
82
+ :'filename' => :'String',
83
+ :'data' => :'String'
84
+ }
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ return unless attributes.is_a?(Hash)
91
+
92
+ # convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
94
+
95
+ if attributes.has_key?(:'Source')
96
+ self.source = attributes[:'Source']
97
+ end
98
+
99
+ if attributes.has_key?(:'ImportDataType')
100
+ self.import_data_type = attributes[:'ImportDataType']
101
+ end
102
+
103
+ if attributes.has_key?(:'DestinationWorksheet')
104
+ self.destination_worksheet = attributes[:'DestinationWorksheet']
105
+ end
106
+
107
+ if attributes.has_key?(:'IsInsert')
108
+ self.is_insert = attributes[:'IsInsert']
109
+ end
110
+
111
+ if attributes.has_key?(:'UpperLeftRow')
112
+ self.upper_left_row = attributes[:'UpperLeftRow']
113
+ end
114
+
115
+ if attributes.has_key?(:'UpperLeftColumn')
116
+ self.upper_left_column = attributes[:'UpperLeftColumn']
117
+ end
118
+
119
+ if attributes.has_key?(:'LowerRightRow')
120
+ self.lower_right_row = attributes[:'LowerRightRow']
121
+ end
122
+
123
+ if attributes.has_key?(:'LowerRightColumn')
124
+ self.lower_right_column = attributes[:'LowerRightColumn']
125
+ end
126
+
127
+ if attributes.has_key?(:'Filename')
128
+ self.filename = attributes[:'Filename']
129
+ end
130
+
131
+ if attributes.has_key?(:'Data')
132
+ self.data = attributes[:'Data']
133
+ end
134
+
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properies with the reasons
139
+ def list_invalid_properties
140
+ invalid_properties = Array.new
141
+ return invalid_properties
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ return true
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ source == o.source &&
156
+ import_data_type == o.import_data_type &&
157
+ destination_worksheet == o.destination_worksheet &&
158
+ is_insert == o.is_insert &&
159
+ upper_left_row == o.upper_left_row &&
160
+ upper_left_column == o.upper_left_column &&
161
+ lower_right_row == o.lower_right_row &&
162
+ lower_right_column == o.lower_right_column &&
163
+ filename == o.filename &&
164
+ data == o.data
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Fixnum] Hash code
175
+ def hash
176
+ [source, import_data_type, destination_worksheet, is_insert, upper_left_row, upper_left_column, lower_right_row, lower_right_column, filename, data].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ self.class.swagger_types.each_pair do |key, type|
185
+ if type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
189
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
190
+ end
191
+ elsif !attributes[self.class.attribute_map[key]].nil?
192
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
193
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
194
+ end
195
+
196
+ self
197
+ end
198
+
199
+ # Deserializes the data based on type
200
+ # @param string type Data type
201
+ # @param string value Value to be deserialized
202
+ # @return [Object] Deserialized data
203
+ def _deserialize(type, value)
204
+ case type.to_sym
205
+ when :DateTime
206
+ DateTime.parse(value)
207
+ when :Date
208
+ Date.parse(value)
209
+ when :String
210
+ value.to_s
211
+ when :Integer
212
+ value.to_i
213
+ when :Float
214
+ value.to_f
215
+ when :BOOLEAN
216
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
217
+ true
218
+ else
219
+ false
220
+ end
221
+ when :Object
222
+ # generic object (usually a Hash), return directly
223
+ value
224
+ when /\AArray<(?<inner_type>.+)>\z/
225
+ inner_type = Regexp.last_match[:inner_type]
226
+ value.map { |v| _deserialize(inner_type, v) }
227
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
228
+ k_type = Regexp.last_match[:k_type]
229
+ v_type = Regexp.last_match[:v_type]
230
+ {}.tap do |hash|
231
+ value.each do |k, v|
232
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
233
+ end
234
+ end
235
+ else # model
236
+ temp_model = AsposeCellsCloud.const_get(type).new
237
+ temp_model.build_from_hash(value)
238
+ end
239
+ end
240
+
241
+ # Returns the string representation of the object
242
+ # @return [String] String presentation of the object
243
+ def to_s
244
+ to_hash.to_s
245
+ end
246
+
247
+ # to_body is an alias to to_hash (backward compatibility)
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {}
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ next if value.nil?
260
+ hash[param] = _to_hash(value)
261
+ end
262
+ hash
263
+ end
264
+
265
+ # Outputs non-array value in the form of hash
266
+ # For object, use to_hash. Otherwise, just return the value
267
+ # @param [Object] value Any valid value
268
+ # @return [Hash] Returns the value in the form of hash
269
+ def _to_hash(value)
270
+ if value.is_a?(Array)
271
+ value.compact.map{ |v| _to_hash(v) }
272
+ elsif value.is_a?(Hash)
273
+ {}.tap do |hash|
274
+ value.each { |k, v| hash[k] = _to_hash(v) }
275
+ end
276
+ elsif value.respond_to? :to_hash
277
+ value.to_hash
278
+ else
279
+ value
280
+ end
281
+ end
282
+
283
+ end
284
+
285
+ end
@@ -0,0 +1,209 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2021 Aspose.Cells Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+
21
+ =end
22
+
23
+ require 'date'
24
+
25
+ module AsposeCellsCloud
26
+
27
+ class MatchConditionRequest
28
+ attr_accessor :regex_pattern
29
+
30
+ attr_accessor :full_match_conditions
31
+
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'regex_pattern' => :'RegexPattern',
37
+ :'full_match_conditions' => :'FullMatchConditions'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'regex_pattern' => :'String',
45
+ :'full_match_conditions' => :'Array<String>'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
56
+
57
+ if attributes.has_key?(:'RegexPattern')
58
+ self.regex_pattern = attributes[:'RegexPattern']
59
+ end
60
+
61
+ if attributes.has_key?(:'FullMatchConditions')
62
+ if (value = attributes[:'FullMatchConditions']).is_a?(Array)
63
+ self.full_match_conditions = value
64
+ end
65
+ end
66
+
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properies with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ return invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ regex_pattern == o.regex_pattern &&
88
+ full_match_conditions == o.full_match_conditions
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
+ [regex_pattern, full_match_conditions].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 = AsposeCellsCloud.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
@@ -21,5 +21,5 @@ SOFTWARE.
21
21
  =end
22
22
 
23
23
  module AsposeCellsCloud
24
- VERSION = "21.6"
24
+ VERSION = "21.11"
25
25
  end
@@ -31,6 +31,7 @@ require 'aspose_cells_cloud/models/above_average'
31
31
  require 'aspose_cells_cloud/models/access_token_response'
32
32
  require 'aspose_cells_cloud/models/area'
33
33
  require 'aspose_cells_cloud/models/auto_fitter_options'
34
+ require 'aspose_cells_cloud/models/batch_convert_request'
34
35
  require 'aspose_cells_cloud/models/border'
35
36
  require 'aspose_cells_cloud/models/calculation_options'
36
37
  require 'aspose_cells_cloud/models/cell_area'
@@ -75,6 +76,7 @@ require 'aspose_cells_cloud/models/line'
75
76
  require 'aspose_cells_cloud/models/link'
76
77
  require 'aspose_cells_cloud/models/link_element'
77
78
  require 'aspose_cells_cloud/models/list_column'
79
+ require 'aspose_cells_cloud/models/match_condition_request'
78
80
  require 'aspose_cells_cloud/models/multiple_filter'
79
81
  require 'aspose_cells_cloud/models/multiple_filters'
80
82
  require 'aspose_cells_cloud/models/negative_bar_format'
@@ -180,6 +182,7 @@ require 'aspose_cells_cloud/models/import_csv_data_option'
180
182
  require 'aspose_cells_cloud/models/import_data_task_parameter'
181
183
  require 'aspose_cells_cloud/models/import_double_array_option'
182
184
  require 'aspose_cells_cloud/models/import_int_array_option'
185
+ require 'aspose_cells_cloud/models/import_picture_option'
183
186
  require 'aspose_cells_cloud/models/import_string_array_option'
184
187
  require 'aspose_cells_cloud/models/legend_response'
185
188
  require 'aspose_cells_cloud/models/line_format'
@@ -0,0 +1,45 @@
1
+ =begin
2
+ #Web API Swagger specification
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for AsposeCellsCloud::CellsApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'CellsBatchApi' do
20
+ before do
21
+ @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
22
+ $VERBOSE = nil
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'cells_unit test' do
30
+ it "should work" do
31
+ folder = $TEMPFOLDER
32
+ result = @instance.upload_file( folder+"/"+ $BOOK1, ::File.open(File.expand_path("data/"+ $BOOK1),"r") {|io| io.read(io.size) })
33
+ expect(result.uploaded.size).to be > 0
34
+ result = @instance.upload_file( folder+"/"+$MYDOC, ::File.open(File.expand_path("data/"+$MYDOC),"r") {|io| io.read(io.size) })
35
+ expect(result.uploaded.size).to be > 0
36
+ match_condition = AsposeCellsCloud::MatchConditionRequest.new({:FullMatchConditions=>[ $BOOK1,$MYDOC]})
37
+ batch_convert_request = AsposeCellsCloud::BatchConvertRequest.new({:Format=>'pdf',:SourceFolder=>folder,:MatchCondition=>batch_convert_request})
38
+
39
+ result = @instance.post_batch_convert(batch_convert_request)
40
+ # expect(result.code).to eql(200)
41
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
42
+ end
43
+ end
44
+ end
45
+
@@ -0,0 +1,44 @@
1
+ =begin
2
+ #Web API Swagger specification
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for AsposeCellsCloud::CellsApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'LiteCellsApi' do
20
+ before do
21
+ @instance = AsposeCellsCloud::LiteCellsApi.new($client_id,$client_secret,$api_version,$baseurl)
22
+ $VERBOSE = nil
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'lite_cells_unit compress test' do
30
+ it "should work" do
31
+ files = {}
32
+
33
+ name = $DataSourceXlsx
34
+ files[name] = ::File.open(File.expand_path("data/"+name),"r")
35
+ name =$AssemblyTestXlsx
36
+ files[name] = ::File.open(File.expand_path("data/"+name),"r") #{|io| io.read(io.size) }
37
+
38
+ result = @instance.post_compress(files ,88)
39
+
40
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
41
+ end
42
+ end
43
+ end
44
+