aspose_cells_cloud 24.9 → 24.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -11
- data/lib/aspose_cells_cloud/api/cells_api.rb +14 -0
- data/lib/aspose_cells_cloud/models/convert_text_options.rb +294 -0
- data/lib/aspose_cells_cloud/models/remove_characters_by_character.rb +234 -0
- data/lib/aspose_cells_cloud/models/remove_characters_by_position.rb +246 -0
- data/lib/aspose_cells_cloud/models/remove_characters_options.rb +282 -0
- data/lib/aspose_cells_cloud/requests/post_convert_text_request.rb +103 -0
- data/lib/aspose_cells_cloud/requests/post_remove_characters_request.rb +103 -0
- data/lib/aspose_cells_cloud/version.rb +1 -1
- data/lib/aspose_cells_cloud.rb +6 -0
- metadata +8 -2
@@ -0,0 +1,246 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
<copyright company="Aspose" file="RemoveCharactersByPositionrb.cs">
|
4
|
+
Copyright (c) 2024 Aspose.Cells Cloud
|
5
|
+
</copyright>
|
6
|
+
<summary>
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
9
|
+
in the Software without restriction, including without limitation the rights
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
12
|
+
furnished to do so, subject to the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
15
|
+
copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
SOFTWARE.
|
24
|
+
</summary>
|
25
|
+
--------------------------------------------------------------------------------------------------------------------
|
26
|
+
=end
|
27
|
+
|
28
|
+
|
29
|
+
require 'date'
|
30
|
+
|
31
|
+
module AsposeCellsCloud
|
32
|
+
|
33
|
+
class RemoveCharactersByPosition
|
34
|
+
#
|
35
|
+
attr_accessor :the_first_n_characters
|
36
|
+
#
|
37
|
+
attr_accessor :the_last_n_characters
|
38
|
+
#
|
39
|
+
attr_accessor :all_characters_before_text
|
40
|
+
#
|
41
|
+
attr_accessor :all_characters_after_text
|
42
|
+
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
44
|
+
def self.attribute_map
|
45
|
+
{
|
46
|
+
:'the_first_n_characters' => :'TheFirstNCharacters',
|
47
|
+
:'the_last_n_characters' => :'TheLastNCharacters',
|
48
|
+
:'all_characters_before_text' => :'AllCharactersBeforeText',
|
49
|
+
:'all_characters_after_text' => :'AllCharactersAfterText'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# Attribute type mapping.
|
54
|
+
def self.swagger_types
|
55
|
+
{
|
56
|
+
:'the_first_n_characters' => :'Integer',
|
57
|
+
:'the_last_n_characters' => :'Integer',
|
58
|
+
:'all_characters_before_text' => :'String',
|
59
|
+
:'all_characters_after_text' => :'String'
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# Initializes the object
|
64
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
65
|
+
def initialize(attributes = {})
|
66
|
+
return unless attributes.is_a?(Hash)
|
67
|
+
|
68
|
+
# convert string to symbol for hash key
|
69
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
70
|
+
|
71
|
+
if attributes.has_key?(:'TheFirstNCharacters')
|
72
|
+
self.the_first_n_characters = attributes[:'TheFirstNCharacters']
|
73
|
+
end
|
74
|
+
if attributes.has_key?(:'TheLastNCharacters')
|
75
|
+
self.the_last_n_characters = attributes[:'TheLastNCharacters']
|
76
|
+
end
|
77
|
+
if attributes.has_key?(:'AllCharactersBeforeText')
|
78
|
+
self.all_characters_before_text = attributes[:'AllCharactersBeforeText']
|
79
|
+
end
|
80
|
+
if attributes.has_key?(:'AllCharactersAfterText')
|
81
|
+
self.all_characters_after_text = attributes[:'AllCharactersAfterText']
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
87
|
+
# @return Array for valid properies with the reasons
|
88
|
+
def list_invalid_properties
|
89
|
+
invalid_properties = Array.new
|
90
|
+
if @the_first_n_characters.nil?
|
91
|
+
invalid_properties.push("invalid value for 'the_first_n_characters', the_first_n_characters cannot be nil.")
|
92
|
+
end
|
93
|
+
if @the_last_n_characters.nil?
|
94
|
+
invalid_properties.push("invalid value for 'the_last_n_characters', the_last_n_characters cannot be nil.")
|
95
|
+
end
|
96
|
+
if @all_characters_before_text.nil?
|
97
|
+
invalid_properties.push("invalid value for 'all_characters_before_text', all_characters_before_text cannot be nil.")
|
98
|
+
end
|
99
|
+
if @all_characters_after_text.nil?
|
100
|
+
invalid_properties.push("invalid value for 'all_characters_after_text', all_characters_after_text cannot be nil.")
|
101
|
+
end
|
102
|
+
|
103
|
+
return invalid_properties
|
104
|
+
end
|
105
|
+
|
106
|
+
# Check to see if the all the properties in the model are valid
|
107
|
+
# @return true if the model is valid
|
108
|
+
def valid?
|
109
|
+
return false if @the_first_n_characters.nil?
|
110
|
+
return false if @the_last_n_characters.nil?
|
111
|
+
return false if @all_characters_before_text.nil?
|
112
|
+
return false if @all_characters_after_text.nil?
|
113
|
+
return true
|
114
|
+
end
|
115
|
+
|
116
|
+
# Checks equality by comparing each attribute.
|
117
|
+
# @param [Object] Object to be compared
|
118
|
+
def ==(o)
|
119
|
+
return true if self.equal?(o)
|
120
|
+
self.class == o.class &&
|
121
|
+
the_first_n_characters == o.the_first_n_characters &&
|
122
|
+
the_last_n_characters == o.the_last_n_characters &&
|
123
|
+
all_characters_before_text == o.all_characters_before_text &&
|
124
|
+
all_characters_after_text == o.all_characters_after_text
|
125
|
+
std_dev == o.std_dev
|
126
|
+
end
|
127
|
+
|
128
|
+
# @see the `==` method
|
129
|
+
# @param [Object] Object to be compared
|
130
|
+
def eql?(o)
|
131
|
+
self == o
|
132
|
+
end
|
133
|
+
|
134
|
+
# Calculates hash code according to all attributes.
|
135
|
+
# @return [Fixnum] Hash code
|
136
|
+
def hash
|
137
|
+
[ the_first_n_characters , the_last_n_characters , all_characters_before_text , all_characters_after_text ].hash
|
138
|
+
end
|
139
|
+
|
140
|
+
# Builds the object from hash
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
+
# @return [Object] Returns the model itself
|
143
|
+
def build_from_hash(attributes)
|
144
|
+
return nil unless attributes.is_a?(Hash)
|
145
|
+
self.class.swagger_types.each_pair do |key, type|
|
146
|
+
if type =~ /\AArray<(.*)>/i
|
147
|
+
# check to ensure the input is an array given that the the attribute
|
148
|
+
# is documented as an array but the input is not
|
149
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
150
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
151
|
+
end
|
152
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
153
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
154
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
155
|
+
end
|
156
|
+
|
157
|
+
self
|
158
|
+
end
|
159
|
+
|
160
|
+
# Deserializes the data based on type
|
161
|
+
# @param string type Data type
|
162
|
+
# @param string value Value to be deserialized
|
163
|
+
# @return [Object] Deserialized data
|
164
|
+
def _deserialize(type, value)
|
165
|
+
case type.to_sym
|
166
|
+
when :DateTime
|
167
|
+
DateTime.parse(value)
|
168
|
+
when :Date
|
169
|
+
Date.parse(value)
|
170
|
+
when :String
|
171
|
+
value.to_s
|
172
|
+
when :Integer
|
173
|
+
value.to_i
|
174
|
+
when :Float
|
175
|
+
value.to_f
|
176
|
+
when :BOOLEAN
|
177
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
178
|
+
true
|
179
|
+
else
|
180
|
+
false
|
181
|
+
end
|
182
|
+
when :Object
|
183
|
+
# generic object (usually a Hash), return directly
|
184
|
+
value
|
185
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
186
|
+
inner_type = Regexp.last_match[:inner_type]
|
187
|
+
value.map { |v| _deserialize(inner_type, v) }
|
188
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
189
|
+
k_type = Regexp.last_match[:k_type]
|
190
|
+
v_type = Regexp.last_match[:v_type]
|
191
|
+
{}.tap do |hash|
|
192
|
+
value.each do |k, v|
|
193
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
else # model
|
197
|
+
temp_model = AsposeCellsCloud.const_get(type).new
|
198
|
+
temp_model.build_from_hash(value)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the string representation of the object
|
203
|
+
# @return [String] String presentation of the object
|
204
|
+
def to_s
|
205
|
+
to_hash.to_s
|
206
|
+
end
|
207
|
+
|
208
|
+
# to_body is an alias to to_hash (backward compatibility)
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_body
|
211
|
+
to_hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Returns the object in the form of hash
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
216
|
+
def to_hash
|
217
|
+
hash = {}
|
218
|
+
self.class.attribute_map.each_pair do |attr, param|
|
219
|
+
value = self.send(attr)
|
220
|
+
next if value.nil?
|
221
|
+
hash[param] = _to_hash(value)
|
222
|
+
end
|
223
|
+
hash
|
224
|
+
end
|
225
|
+
|
226
|
+
# Outputs non-array value in the form of hash
|
227
|
+
# For object, use to_hash. Otherwise, just return the value
|
228
|
+
# @param [Object] value Any valid value
|
229
|
+
# @return [Hash] Returns the value in the form of hash
|
230
|
+
def _to_hash(value)
|
231
|
+
if value.is_a?(Array)
|
232
|
+
value.compact.map{ |v| _to_hash(v) }
|
233
|
+
elsif value.is_a?(Hash)
|
234
|
+
{}.tap do |hash|
|
235
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
236
|
+
end
|
237
|
+
elsif value.respond_to? :to_hash
|
238
|
+
value.to_hash
|
239
|
+
else
|
240
|
+
value
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
end
|
245
|
+
|
246
|
+
end
|
@@ -0,0 +1,282 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
<copyright company="Aspose" file="RemoveCharactersOptionsrb.cs">
|
4
|
+
Copyright (c) 2024 Aspose.Cells Cloud
|
5
|
+
</copyright>
|
6
|
+
<summary>
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
9
|
+
in the Software without restriction, including without limitation the rights
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
12
|
+
furnished to do so, subject to the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
15
|
+
copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
SOFTWARE.
|
24
|
+
</summary>
|
25
|
+
--------------------------------------------------------------------------------------------------------------------
|
26
|
+
=end
|
27
|
+
|
28
|
+
|
29
|
+
require 'date'
|
30
|
+
|
31
|
+
module AsposeCellsCloud
|
32
|
+
|
33
|
+
class RemoveCharactersOptions
|
34
|
+
#
|
35
|
+
attr_accessor :name
|
36
|
+
#
|
37
|
+
attr_accessor :data_source
|
38
|
+
#
|
39
|
+
attr_accessor :file_info
|
40
|
+
#
|
41
|
+
attr_accessor :worksheet
|
42
|
+
#
|
43
|
+
attr_accessor :range
|
44
|
+
#
|
45
|
+
attr_accessor :remove_characters_by_character
|
46
|
+
#
|
47
|
+
attr_accessor :remove_characters_by_position
|
48
|
+
|
49
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
50
|
+
def self.attribute_map
|
51
|
+
{
|
52
|
+
:'name' => :'Name',
|
53
|
+
:'data_source' => :'DataSource',
|
54
|
+
:'file_info' => :'FileInfo',
|
55
|
+
:'worksheet' => :'Worksheet',
|
56
|
+
:'range' => :'Range',
|
57
|
+
:'remove_characters_by_character' => :'RemoveCharactersByCharacter',
|
58
|
+
:'remove_characters_by_position' => :'RemoveCharactersByPosition'
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Attribute type mapping.
|
63
|
+
def self.swagger_types
|
64
|
+
{
|
65
|
+
:'name' => :'String',
|
66
|
+
:'data_source' => :'DataSource',
|
67
|
+
:'file_info' => :'FileInfo',
|
68
|
+
:'worksheet' => :'String',
|
69
|
+
:'range' => :'String',
|
70
|
+
:'remove_characters_by_character' => :'RemoveCharactersByCharacter',
|
71
|
+
:'remove_characters_by_position' => :'RemoveCharactersByPosition'
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# Initializes the object
|
76
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
77
|
+
def initialize(attributes = {})
|
78
|
+
return unless attributes.is_a?(Hash)
|
79
|
+
|
80
|
+
# convert string to symbol for hash key
|
81
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
82
|
+
|
83
|
+
if attributes.has_key?(:'Name')
|
84
|
+
self.name = attributes[:'Name']
|
85
|
+
end
|
86
|
+
if attributes.has_key?(:'DataSource')
|
87
|
+
self.data_source = attributes[:'DataSource']
|
88
|
+
end
|
89
|
+
if attributes.has_key?(:'FileInfo')
|
90
|
+
self.file_info = attributes[:'FileInfo']
|
91
|
+
end
|
92
|
+
if attributes.has_key?(:'Worksheet')
|
93
|
+
self.worksheet = attributes[:'Worksheet']
|
94
|
+
end
|
95
|
+
if attributes.has_key?(:'Range')
|
96
|
+
self.range = attributes[:'Range']
|
97
|
+
end
|
98
|
+
if attributes.has_key?(:'RemoveCharactersByCharacter')
|
99
|
+
self.remove_characters_by_character = attributes[:'RemoveCharactersByCharacter']
|
100
|
+
end
|
101
|
+
if attributes.has_key?(:'RemoveCharactersByPosition')
|
102
|
+
self.remove_characters_by_position = attributes[:'RemoveCharactersByPosition']
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
108
|
+
# @return Array for valid properies with the reasons
|
109
|
+
def list_invalid_properties
|
110
|
+
invalid_properties = Array.new
|
111
|
+
if @name.nil?
|
112
|
+
invalid_properties.push("invalid value for 'name', name cannot be nil.")
|
113
|
+
end
|
114
|
+
if @data_source.nil?
|
115
|
+
invalid_properties.push("invalid value for 'data_source', data_source cannot be nil.")
|
116
|
+
end
|
117
|
+
if @file_info.nil?
|
118
|
+
invalid_properties.push("invalid value for 'file_info', file_info cannot be nil.")
|
119
|
+
end
|
120
|
+
if @worksheet.nil?
|
121
|
+
invalid_properties.push("invalid value for 'worksheet', worksheet cannot be nil.")
|
122
|
+
end
|
123
|
+
if @range.nil?
|
124
|
+
invalid_properties.push("invalid value for 'range', range cannot be nil.")
|
125
|
+
end
|
126
|
+
if @remove_characters_by_character.nil?
|
127
|
+
invalid_properties.push("invalid value for 'remove_characters_by_character', remove_characters_by_character cannot be nil.")
|
128
|
+
end
|
129
|
+
if @remove_characters_by_position.nil?
|
130
|
+
invalid_properties.push("invalid value for 'remove_characters_by_position', remove_characters_by_position cannot be nil.")
|
131
|
+
end
|
132
|
+
|
133
|
+
return invalid_properties
|
134
|
+
end
|
135
|
+
|
136
|
+
# Check to see if the all the properties in the model are valid
|
137
|
+
# @return true if the model is valid
|
138
|
+
def valid?
|
139
|
+
return false if @name.nil?
|
140
|
+
return false if @data_source.nil?
|
141
|
+
return false if @file_info.nil?
|
142
|
+
return false if @worksheet.nil?
|
143
|
+
return false if @range.nil?
|
144
|
+
return false if @remove_characters_by_character.nil?
|
145
|
+
return false if @remove_characters_by_position.nil?
|
146
|
+
return true
|
147
|
+
end
|
148
|
+
|
149
|
+
# Checks equality by comparing each attribute.
|
150
|
+
# @param [Object] Object to be compared
|
151
|
+
def ==(o)
|
152
|
+
return true if self.equal?(o)
|
153
|
+
self.class == o.class &&
|
154
|
+
name == o.name &&
|
155
|
+
data_source == o.data_source &&
|
156
|
+
file_info == o.file_info &&
|
157
|
+
worksheet == o.worksheet &&
|
158
|
+
range == o.range &&
|
159
|
+
remove_characters_by_character == o.remove_characters_by_character &&
|
160
|
+
remove_characters_by_position == o.remove_characters_by_position
|
161
|
+
std_dev == o.std_dev
|
162
|
+
end
|
163
|
+
|
164
|
+
# @see the `==` method
|
165
|
+
# @param [Object] Object to be compared
|
166
|
+
def eql?(o)
|
167
|
+
self == o
|
168
|
+
end
|
169
|
+
|
170
|
+
# Calculates hash code according to all attributes.
|
171
|
+
# @return [Fixnum] Hash code
|
172
|
+
def hash
|
173
|
+
[ name , data_source , file_info , worksheet , range , remove_characters_by_character , remove_characters_by_position ].hash
|
174
|
+
end
|
175
|
+
|
176
|
+
# Builds the object from hash
|
177
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
178
|
+
# @return [Object] Returns the model itself
|
179
|
+
def build_from_hash(attributes)
|
180
|
+
return nil unless attributes.is_a?(Hash)
|
181
|
+
self.class.swagger_types.each_pair do |key, type|
|
182
|
+
if type =~ /\AArray<(.*)>/i
|
183
|
+
# check to ensure the input is an array given that the the attribute
|
184
|
+
# is documented as an array but the input is not
|
185
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
186
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
187
|
+
end
|
188
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
189
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
190
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
191
|
+
end
|
192
|
+
|
193
|
+
self
|
194
|
+
end
|
195
|
+
|
196
|
+
# Deserializes the data based on type
|
197
|
+
# @param string type Data type
|
198
|
+
# @param string value Value to be deserialized
|
199
|
+
# @return [Object] Deserialized data
|
200
|
+
def _deserialize(type, value)
|
201
|
+
case type.to_sym
|
202
|
+
when :DateTime
|
203
|
+
DateTime.parse(value)
|
204
|
+
when :Date
|
205
|
+
Date.parse(value)
|
206
|
+
when :String
|
207
|
+
value.to_s
|
208
|
+
when :Integer
|
209
|
+
value.to_i
|
210
|
+
when :Float
|
211
|
+
value.to_f
|
212
|
+
when :BOOLEAN
|
213
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
214
|
+
true
|
215
|
+
else
|
216
|
+
false
|
217
|
+
end
|
218
|
+
when :Object
|
219
|
+
# generic object (usually a Hash), return directly
|
220
|
+
value
|
221
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
222
|
+
inner_type = Regexp.last_match[:inner_type]
|
223
|
+
value.map { |v| _deserialize(inner_type, v) }
|
224
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
225
|
+
k_type = Regexp.last_match[:k_type]
|
226
|
+
v_type = Regexp.last_match[:v_type]
|
227
|
+
{}.tap do |hash|
|
228
|
+
value.each do |k, v|
|
229
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
else # model
|
233
|
+
temp_model = AsposeCellsCloud.const_get(type).new
|
234
|
+
temp_model.build_from_hash(value)
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
# Returns the string representation of the object
|
239
|
+
# @return [String] String presentation of the object
|
240
|
+
def to_s
|
241
|
+
to_hash.to_s
|
242
|
+
end
|
243
|
+
|
244
|
+
# to_body is an alias to to_hash (backward compatibility)
|
245
|
+
# @return [Hash] Returns the object in the form of hash
|
246
|
+
def to_body
|
247
|
+
to_hash
|
248
|
+
end
|
249
|
+
|
250
|
+
# Returns the object in the form of hash
|
251
|
+
# @return [Hash] Returns the object in the form of hash
|
252
|
+
def to_hash
|
253
|
+
hash = {}
|
254
|
+
self.class.attribute_map.each_pair do |attr, param|
|
255
|
+
value = self.send(attr)
|
256
|
+
next if value.nil?
|
257
|
+
hash[param] = _to_hash(value)
|
258
|
+
end
|
259
|
+
hash
|
260
|
+
end
|
261
|
+
|
262
|
+
# Outputs non-array value in the form of hash
|
263
|
+
# For object, use to_hash. Otherwise, just return the value
|
264
|
+
# @param [Object] value Any valid value
|
265
|
+
# @return [Hash] Returns the value in the form of hash
|
266
|
+
def _to_hash(value)
|
267
|
+
if value.is_a?(Array)
|
268
|
+
value.compact.map{ |v| _to_hash(v) }
|
269
|
+
elsif value.is_a?(Hash)
|
270
|
+
{}.tap do |hash|
|
271
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
272
|
+
end
|
273
|
+
elsif value.respond_to? :to_hash
|
274
|
+
value.to_hash
|
275
|
+
else
|
276
|
+
value
|
277
|
+
end
|
278
|
+
end
|
279
|
+
|
280
|
+
end
|
281
|
+
|
282
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
<copyright company="Aspose" file="PostConvertText_request.rb.cs">
|
4
|
+
Copyright (c) 2024 Aspose.Cells Cloud
|
5
|
+
</copyright>
|
6
|
+
<summary>
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
9
|
+
in the Software without restriction, including without limitation the rights
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
12
|
+
furnished to do so, subject to the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
15
|
+
copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
SOFTWARE.
|
24
|
+
</summary>
|
25
|
+
--------------------------------------------------------------------------------------------------------------------
|
26
|
+
=end
|
27
|
+
|
28
|
+
|
29
|
+
require "uri"
|
30
|
+
|
31
|
+
module AsposeCellsCloud
|
32
|
+
class PostConvertTextRequest
|
33
|
+
|
34
|
+
attr_accessor :convert_text_options
|
35
|
+
|
36
|
+
def initialize(attributes = {})
|
37
|
+
return unless attributes.is_a?(Hash)
|
38
|
+
|
39
|
+
# convert string to symbol for hash key
|
40
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
41
|
+
|
42
|
+
if attributes.has_key?(:'convertTextOptions')
|
43
|
+
self.convert_text_options = attributes[:'convertTextOptions']
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
48
|
+
def self.attribute_map
|
49
|
+
{
|
50
|
+
:'convert_text_options' => :'convertTextOptions'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Attribute type mapping.
|
55
|
+
def self.swagger_types
|
56
|
+
{
|
57
|
+
:'convert_text_options' => :'ConvertTextOptions'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
def create_http_request(api_client,opts = {})
|
62
|
+
if api_client.config.debugging
|
63
|
+
api_client.config.logger.debug "Calling API: CellsApi.post_convert_text ..."
|
64
|
+
end
|
65
|
+
api_client.request_token_if_needed
|
66
|
+
# verify the required parameter 'convert_text_options' is set
|
67
|
+
if api_client.config.client_side_validation && convert_text_options.nil?
|
68
|
+
fail ArgumentError, "Missing the required parameter 'convert_text_options' when calling CellsApi.post_convert_text "
|
69
|
+
end
|
70
|
+
|
71
|
+
# resource path
|
72
|
+
local_var_path = "/cells/converttext"
|
73
|
+
# query parameters
|
74
|
+
query_params = {}
|
75
|
+
# header parameters
|
76
|
+
header_params = {}
|
77
|
+
# HTTP header 'Accept' (if needed)
|
78
|
+
header_params['Accept'] = api_client.select_header_accept(['application/json'])
|
79
|
+
# HTTP header 'Content-Type'
|
80
|
+
header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
|
81
|
+
|
82
|
+
# form parameters
|
83
|
+
form_params = {}
|
84
|
+
post_body = nil
|
85
|
+
post_body = api_client.object_to_http_body(convert_text_options)
|
86
|
+
|
87
|
+
|
88
|
+
#auth_names = []
|
89
|
+
auth_names = ['JWT']
|
90
|
+
data, status_code, headers = api_client.call_api(:POST, local_var_path,
|
91
|
+
:header_params => header_params,
|
92
|
+
:query_params => query_params,
|
93
|
+
:form_params => form_params,
|
94
|
+
:body => post_body,
|
95
|
+
:auth_names => auth_names,
|
96
|
+
:return_type => 'FileInfo')
|
97
|
+
if api_client.config.debugging
|
98
|
+
api_client.config.logger.debug "API called: Specification.Name>Api.post_convert_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
99
|
+
end
|
100
|
+
return data, status_code, headers
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|