aspose_cells_cloud 23.7 → 23.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/lib/aspose_cells_cloud/models/digital_signature.rb +294 -0
- data/lib/aspose_cells_cloud/models/html_save_options.rb +61 -1
- data/lib/aspose_cells_cloud/models/image_or_print_options.rb +498 -0
- data/lib/aspose_cells_cloud/models/ooxml_save_options.rb +49 -1
- data/lib/aspose_cells_cloud/models/pdf_save_options.rb +109 -1
- data/lib/aspose_cells_cloud/models/protect_workbook_requst.rb +270 -0
- data/lib/aspose_cells_cloud/models/protection.rb +402 -0
- data/lib/aspose_cells_cloud/models/rendering_font.rb +258 -0
- data/lib/aspose_cells_cloud/models/rendering_watermark.rb +330 -0
- data/lib/aspose_cells_cloud/requests/post_lock_request.rb +120 -0
- data/lib/aspose_cells_cloud/requests/post_protect_request.rb +13 -8
- data/lib/aspose_cells_cloud/version.rb +1 -1
- data/lib/aspose_cells_cloud.rb +7 -0
- data/spec/document/light_cells_spec.rb +2 -1
- data/spec/onecase_spec.rb +28 -0
- metadata +14 -6
@@ -0,0 +1,330 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
<copyright company="Aspose" file="RenderingWatermarkrb.cs">
|
4
|
+
Copyright (c) 2023 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 RenderingWatermark
|
34
|
+
#
|
35
|
+
attr_accessor :rotation
|
36
|
+
#
|
37
|
+
attr_accessor :scale_to_page_percent
|
38
|
+
#
|
39
|
+
attr_accessor :opacity
|
40
|
+
#
|
41
|
+
attr_accessor :is_background
|
42
|
+
#
|
43
|
+
attr_accessor :text
|
44
|
+
#
|
45
|
+
attr_accessor :font
|
46
|
+
#
|
47
|
+
attr_accessor :image
|
48
|
+
#
|
49
|
+
attr_accessor :h_alignment
|
50
|
+
#
|
51
|
+
attr_accessor :v_alignment
|
52
|
+
#
|
53
|
+
attr_accessor :offset_x
|
54
|
+
#
|
55
|
+
attr_accessor :offset_y
|
56
|
+
|
57
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
58
|
+
def self.attribute_map
|
59
|
+
{
|
60
|
+
:'rotation' => :'Rotation',
|
61
|
+
:'scale_to_page_percent' => :'ScaleToPagePercent',
|
62
|
+
:'opacity' => :'Opacity',
|
63
|
+
:'is_background' => :'IsBackground',
|
64
|
+
:'text' => :'Text',
|
65
|
+
:'font' => :'Font',
|
66
|
+
:'image' => :'Image',
|
67
|
+
:'h_alignment' => :'HAlignment',
|
68
|
+
:'v_alignment' => :'VAlignment',
|
69
|
+
:'offset_x' => :'OffsetX',
|
70
|
+
:'offset_y' => :'OffsetY'
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
# Attribute type mapping.
|
75
|
+
def self.swagger_types
|
76
|
+
{
|
77
|
+
:'rotation' => :'Float',
|
78
|
+
:'scale_to_page_percent' => :'Integer',
|
79
|
+
:'opacity' => :'Float',
|
80
|
+
:'is_background' => :'BOOLEAN',
|
81
|
+
:'text' => :'String',
|
82
|
+
:'font' => :'RenderingFont',
|
83
|
+
:'image' => :'Array<Integer>',
|
84
|
+
:'h_alignment' => :'String',
|
85
|
+
:'v_alignment' => :'String',
|
86
|
+
:'offset_x' => :'Float',
|
87
|
+
:'offset_y' => :'Float'
|
88
|
+
}
|
89
|
+
end
|
90
|
+
|
91
|
+
# Initializes the object
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
def initialize(attributes = {})
|
94
|
+
return unless attributes.is_a?(Hash)
|
95
|
+
|
96
|
+
# convert string to symbol for hash key
|
97
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
98
|
+
|
99
|
+
if attributes.has_key?(:'Rotation')
|
100
|
+
self.rotation = attributes[:'Rotation']
|
101
|
+
end
|
102
|
+
if attributes.has_key?(:'ScaleToPagePercent')
|
103
|
+
self.scale_to_page_percent = attributes[:'ScaleToPagePercent']
|
104
|
+
end
|
105
|
+
if attributes.has_key?(:'Opacity')
|
106
|
+
self.opacity = attributes[:'Opacity']
|
107
|
+
end
|
108
|
+
if attributes.has_key?(:'IsBackground')
|
109
|
+
self.is_background = attributes[:'IsBackground']
|
110
|
+
end
|
111
|
+
if attributes.has_key?(:'Text')
|
112
|
+
self.text = attributes[:'Text']
|
113
|
+
end
|
114
|
+
if attributes.has_key?(:'Font')
|
115
|
+
self.font = attributes[:'Font']
|
116
|
+
end
|
117
|
+
if attributes.has_key?(:'Image')
|
118
|
+
self.image = attributes[:'Image']
|
119
|
+
end
|
120
|
+
if attributes.has_key?(:'HAlignment')
|
121
|
+
self.h_alignment = attributes[:'HAlignment']
|
122
|
+
end
|
123
|
+
if attributes.has_key?(:'VAlignment')
|
124
|
+
self.v_alignment = attributes[:'VAlignment']
|
125
|
+
end
|
126
|
+
if attributes.has_key?(:'OffsetX')
|
127
|
+
self.offset_x = attributes[:'OffsetX']
|
128
|
+
end
|
129
|
+
if attributes.has_key?(:'OffsetY')
|
130
|
+
self.offset_y = attributes[:'OffsetY']
|
131
|
+
end
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
136
|
+
# @return Array for valid properies with the reasons
|
137
|
+
def list_invalid_properties
|
138
|
+
invalid_properties = Array.new
|
139
|
+
if @rotation.nil?
|
140
|
+
invalid_properties.push("invalid value for 'rotation', rotation cannot be nil.")
|
141
|
+
end
|
142
|
+
if @scale_to_page_percent.nil?
|
143
|
+
invalid_properties.push("invalid value for 'scale_to_page_percent', scale_to_page_percent cannot be nil.")
|
144
|
+
end
|
145
|
+
if @opacity.nil?
|
146
|
+
invalid_properties.push("invalid value for 'opacity', opacity cannot be nil.")
|
147
|
+
end
|
148
|
+
if @is_background.nil?
|
149
|
+
invalid_properties.push("invalid value for 'is_background', is_background cannot be nil.")
|
150
|
+
end
|
151
|
+
if @text.nil?
|
152
|
+
invalid_properties.push("invalid value for 'text', text cannot be nil.")
|
153
|
+
end
|
154
|
+
if @font.nil?
|
155
|
+
invalid_properties.push("invalid value for 'font', font cannot be nil.")
|
156
|
+
end
|
157
|
+
if @image.nil?
|
158
|
+
invalid_properties.push("invalid value for 'image', image cannot be nil.")
|
159
|
+
end
|
160
|
+
if @h_alignment.nil?
|
161
|
+
invalid_properties.push("invalid value for 'h_alignment', h_alignment cannot be nil.")
|
162
|
+
end
|
163
|
+
if @v_alignment.nil?
|
164
|
+
invalid_properties.push("invalid value for 'v_alignment', v_alignment cannot be nil.")
|
165
|
+
end
|
166
|
+
if @offset_x.nil?
|
167
|
+
invalid_properties.push("invalid value for 'offset_x', offset_x cannot be nil.")
|
168
|
+
end
|
169
|
+
if @offset_y.nil?
|
170
|
+
invalid_properties.push("invalid value for 'offset_y', offset_y cannot be nil.")
|
171
|
+
end
|
172
|
+
|
173
|
+
return invalid_properties
|
174
|
+
end
|
175
|
+
|
176
|
+
# Check to see if the all the properties in the model are valid
|
177
|
+
# @return true if the model is valid
|
178
|
+
def valid?
|
179
|
+
return false if @rotation.nil?
|
180
|
+
return false if @scale_to_page_percent.nil?
|
181
|
+
return false if @opacity.nil?
|
182
|
+
return false if @is_background.nil?
|
183
|
+
return false if @text.nil?
|
184
|
+
return false if @font.nil?
|
185
|
+
return false if @image.nil?
|
186
|
+
return false if @h_alignment.nil?
|
187
|
+
return false if @v_alignment.nil?
|
188
|
+
return false if @offset_x.nil?
|
189
|
+
return false if @offset_y.nil?
|
190
|
+
return true
|
191
|
+
end
|
192
|
+
|
193
|
+
# Checks equality by comparing each attribute.
|
194
|
+
# @param [Object] Object to be compared
|
195
|
+
def ==(o)
|
196
|
+
return true if self.equal?(o)
|
197
|
+
self.class == o.class &&
|
198
|
+
rotation == o.rotation &&
|
199
|
+
scale_to_page_percent == o.scale_to_page_percent &&
|
200
|
+
opacity == o.opacity &&
|
201
|
+
is_background == o.is_background &&
|
202
|
+
text == o.text &&
|
203
|
+
font == o.font &&
|
204
|
+
image == o.image &&
|
205
|
+
h_alignment == o.h_alignment &&
|
206
|
+
v_alignment == o.v_alignment &&
|
207
|
+
offset_x == o.offset_x &&
|
208
|
+
offset_y == o.offset_y
|
209
|
+
std_dev == o.std_dev
|
210
|
+
end
|
211
|
+
|
212
|
+
# @see the `==` method
|
213
|
+
# @param [Object] Object to be compared
|
214
|
+
def eql?(o)
|
215
|
+
self == o
|
216
|
+
end
|
217
|
+
|
218
|
+
# Calculates hash code according to all attributes.
|
219
|
+
# @return [Fixnum] Hash code
|
220
|
+
def hash
|
221
|
+
[ rotation , scale_to_page_percent , opacity , is_background , text , font , image , h_alignment , v_alignment , offset_x , offset_y ].hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Builds the object from hash
|
225
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
226
|
+
# @return [Object] Returns the model itself
|
227
|
+
def build_from_hash(attributes)
|
228
|
+
return nil unless attributes.is_a?(Hash)
|
229
|
+
self.class.swagger_types.each_pair do |key, type|
|
230
|
+
if type =~ /\AArray<(.*)>/i
|
231
|
+
# check to ensure the input is an array given that the the attribute
|
232
|
+
# is documented as an array but the input is not
|
233
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
234
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
235
|
+
end
|
236
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
237
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
238
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
239
|
+
end
|
240
|
+
|
241
|
+
self
|
242
|
+
end
|
243
|
+
|
244
|
+
# Deserializes the data based on type
|
245
|
+
# @param string type Data type
|
246
|
+
# @param string value Value to be deserialized
|
247
|
+
# @return [Object] Deserialized data
|
248
|
+
def _deserialize(type, value)
|
249
|
+
case type.to_sym
|
250
|
+
when :DateTime
|
251
|
+
DateTime.parse(value)
|
252
|
+
when :Date
|
253
|
+
Date.parse(value)
|
254
|
+
when :String
|
255
|
+
value.to_s
|
256
|
+
when :Integer
|
257
|
+
value.to_i
|
258
|
+
when :Float
|
259
|
+
value.to_f
|
260
|
+
when :BOOLEAN
|
261
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
262
|
+
true
|
263
|
+
else
|
264
|
+
false
|
265
|
+
end
|
266
|
+
when :Object
|
267
|
+
# generic object (usually a Hash), return directly
|
268
|
+
value
|
269
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
270
|
+
inner_type = Regexp.last_match[:inner_type]
|
271
|
+
value.map { |v| _deserialize(inner_type, v) }
|
272
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
273
|
+
k_type = Regexp.last_match[:k_type]
|
274
|
+
v_type = Regexp.last_match[:v_type]
|
275
|
+
{}.tap do |hash|
|
276
|
+
value.each do |k, v|
|
277
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
278
|
+
end
|
279
|
+
end
|
280
|
+
else # model
|
281
|
+
temp_model = AsposeCellsCloud.const_get(type).new
|
282
|
+
temp_model.build_from_hash(value)
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
# Returns the string representation of the object
|
287
|
+
# @return [String] String presentation of the object
|
288
|
+
def to_s
|
289
|
+
to_hash.to_s
|
290
|
+
end
|
291
|
+
|
292
|
+
# to_body is an alias to to_hash (backward compatibility)
|
293
|
+
# @return [Hash] Returns the object in the form of hash
|
294
|
+
def to_body
|
295
|
+
to_hash
|
296
|
+
end
|
297
|
+
|
298
|
+
# Returns the object in the form of hash
|
299
|
+
# @return [Hash] Returns the object in the form of hash
|
300
|
+
def to_hash
|
301
|
+
hash = {}
|
302
|
+
self.class.attribute_map.each_pair do |attr, param|
|
303
|
+
value = self.send(attr)
|
304
|
+
next if value.nil?
|
305
|
+
hash[param] = _to_hash(value)
|
306
|
+
end
|
307
|
+
hash
|
308
|
+
end
|
309
|
+
|
310
|
+
# Outputs non-array value in the form of hash
|
311
|
+
# For object, use to_hash. Otherwise, just return the value
|
312
|
+
# @param [Object] value Any valid value
|
313
|
+
# @return [Hash] Returns the value in the form of hash
|
314
|
+
def _to_hash(value)
|
315
|
+
if value.is_a?(Array)
|
316
|
+
value.compact.map{ |v| _to_hash(v) }
|
317
|
+
elsif value.is_a?(Hash)
|
318
|
+
{}.tap do |hash|
|
319
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
320
|
+
end
|
321
|
+
elsif value.respond_to? :to_hash
|
322
|
+
value.to_hash
|
323
|
+
else
|
324
|
+
value
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
end
|
329
|
+
|
330
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
<copyright company="Aspose" file="PostLock_request.rb.cs">
|
4
|
+
Copyright (c) 2023 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 PostLockRequest
|
33
|
+
|
34
|
+
attr_accessor :file
|
35
|
+
attr_accessor :password
|
36
|
+
|
37
|
+
def initialize(attributes = {})
|
38
|
+
return unless attributes.is_a?(Hash)
|
39
|
+
|
40
|
+
# convert string to symbol for hash key
|
41
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
42
|
+
|
43
|
+
if attributes.has_key?(:'File')
|
44
|
+
self.file = attributes[:'File']
|
45
|
+
end
|
46
|
+
if attributes.has_key?(:'password')
|
47
|
+
self.password = attributes[:'password']
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
52
|
+
def self.attribute_map
|
53
|
+
{
|
54
|
+
:'file' => :'File',
|
55
|
+
:'password' => :'password'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# Attribute type mapping.
|
60
|
+
def self.swagger_types
|
61
|
+
{
|
62
|
+
:'file' => :'Hash',
|
63
|
+
:'password' => :'String'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
def create_http_request(api_client,opts = {})
|
68
|
+
if api_client.config.debugging
|
69
|
+
api_client.config.logger.debug "Calling API: CellsApi.post_lock ..."
|
70
|
+
end
|
71
|
+
api_client.request_token_if_needed
|
72
|
+
# verify the required parameter 'file' is set
|
73
|
+
if api_client.config.client_side_validation && file.nil?
|
74
|
+
fail ArgumentError, "Missing the required parameter 'file' when calling CellsApi.post_lock "
|
75
|
+
end
|
76
|
+
# verify the required parameter 'password' is set
|
77
|
+
if api_client.config.client_side_validation && password.nil?
|
78
|
+
fail ArgumentError, "Missing the required parameter 'password' when calling CellsApi.post_lock "
|
79
|
+
end
|
80
|
+
|
81
|
+
# resource path
|
82
|
+
local_var_path = "/cells/lock"
|
83
|
+
# query parameters
|
84
|
+
query_params = {}
|
85
|
+
query_params[:'password'] = self.password if !self.password.nil?
|
86
|
+
|
87
|
+
# header parameters
|
88
|
+
header_params = {}
|
89
|
+
# HTTP header 'Accept' (if needed)
|
90
|
+
header_params['Accept'] = api_client.select_header_accept(['application/json'])
|
91
|
+
# HTTP header 'Content-Type'
|
92
|
+
header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
|
93
|
+
|
94
|
+
# form parameters
|
95
|
+
form_params = {}
|
96
|
+
post_body = nil
|
97
|
+
if(!file.nil?)
|
98
|
+
file.each do |filename , context|
|
99
|
+
form_params[filename] = context
|
100
|
+
end
|
101
|
+
end
|
102
|
+
header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
|
103
|
+
|
104
|
+
|
105
|
+
#auth_names = []
|
106
|
+
auth_names = ['JWT']
|
107
|
+
data, status_code, headers = api_client.call_api(:POST, local_var_path,
|
108
|
+
:header_params => header_params,
|
109
|
+
:query_params => query_params,
|
110
|
+
:form_params => form_params,
|
111
|
+
:body => post_body,
|
112
|
+
:auth_names => auth_names,
|
113
|
+
:return_type => 'FilesResult')
|
114
|
+
if api_client.config.debugging
|
115
|
+
api_client.config.logger.debug "API called: Specification.Name>Api.post_lock\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
116
|
+
end
|
117
|
+
return data, status_code, headers
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -32,6 +32,7 @@ module AsposeCellsCloud
|
|
32
32
|
class PostProtectRequest
|
33
33
|
|
34
34
|
attr_accessor :file
|
35
|
+
attr_accessor :protect_workbook_requst
|
35
36
|
attr_accessor :password
|
36
37
|
|
37
38
|
def initialize(attributes = {})
|
@@ -43,6 +44,9 @@ module AsposeCellsCloud
|
|
43
44
|
if attributes.has_key?(:'File')
|
44
45
|
self.file = attributes[:'File']
|
45
46
|
end
|
47
|
+
if attributes.has_key?(:'protectWorkbookRequst')
|
48
|
+
self.protect_workbook_requst = attributes[:'protectWorkbookRequst']
|
49
|
+
end
|
46
50
|
if attributes.has_key?(:'password')
|
47
51
|
self.password = attributes[:'password']
|
48
52
|
end
|
@@ -52,6 +56,7 @@ module AsposeCellsCloud
|
|
52
56
|
def self.attribute_map
|
53
57
|
{
|
54
58
|
:'file' => :'File',
|
59
|
+
:'protect_workbook_requst' => :'protectWorkbookRequst',
|
55
60
|
:'password' => :'password'
|
56
61
|
}
|
57
62
|
end
|
@@ -60,6 +65,7 @@ module AsposeCellsCloud
|
|
60
65
|
def self.swagger_types
|
61
66
|
{
|
62
67
|
:'file' => :'Hash',
|
68
|
+
:'protect_workbook_requst' => :'ProtectWorkbookRequst',
|
63
69
|
:'password' => :'String'
|
64
70
|
}
|
65
71
|
end
|
@@ -73,9 +79,9 @@ module AsposeCellsCloud
|
|
73
79
|
if api_client.config.client_side_validation && file.nil?
|
74
80
|
fail ArgumentError, "Missing the required parameter 'file' when calling CellsApi.post_protect "
|
75
81
|
end
|
76
|
-
# verify the required parameter '
|
77
|
-
if api_client.config.client_side_validation &&
|
78
|
-
fail ArgumentError, "Missing the required parameter '
|
82
|
+
# verify the required parameter 'protect_workbook_requst' is set
|
83
|
+
if api_client.config.client_side_validation && protect_workbook_requst.nil?
|
84
|
+
fail ArgumentError, "Missing the required parameter 'protect_workbook_requst' when calling CellsApi.post_protect "
|
79
85
|
end
|
80
86
|
|
81
87
|
# resource path
|
@@ -94,11 +100,10 @@ module AsposeCellsCloud
|
|
94
100
|
# form parameters
|
95
101
|
form_params = {}
|
96
102
|
post_body = nil
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
end
|
103
|
+
file.each do |filename , context|
|
104
|
+
form_params[filename] = context
|
105
|
+
end
|
106
|
+
form_params['protect_workbook_requst'] = post_body.to_json
|
102
107
|
header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
|
103
108
|
|
104
109
|
|
data/lib/aspose_cells_cloud.rb
CHANGED
@@ -100,6 +100,7 @@ require 'aspose_cells_cloud/models/page_section'
|
|
100
100
|
require 'aspose_cells_cloud/models/page_setup'
|
101
101
|
require 'aspose_cells_cloud/models/paste_options'
|
102
102
|
require 'aspose_cells_cloud/models/pdf_security_options'
|
103
|
+
require 'aspose_cells_cloud/models/protection'
|
103
104
|
require 'aspose_cells_cloud/models/protect_sheet_parameter'
|
104
105
|
require 'aspose_cells_cloud/models/range'
|
105
106
|
require 'aspose_cells_cloud/models/ranges'
|
@@ -301,6 +302,7 @@ require 'aspose_cells_cloud/models/import_xml_request'
|
|
301
302
|
require 'aspose_cells_cloud/models/match_condition_request'
|
302
303
|
require 'aspose_cells_cloud/models/password_request'
|
303
304
|
require 'aspose_cells_cloud/models/pivot_table_field_request'
|
305
|
+
require 'aspose_cells_cloud/models/protect_workbook_requst'
|
304
306
|
require 'aspose_cells_cloud/models/range_copy_request'
|
305
307
|
require 'aspose_cells_cloud/models/range_set_outline_border_request'
|
306
308
|
require 'aspose_cells_cloud/models/range_set_style_request'
|
@@ -310,6 +312,9 @@ require 'aspose_cells_cloud/models/total_request'
|
|
310
312
|
require 'aspose_cells_cloud/models/workbook_encryption_request'
|
311
313
|
require 'aspose_cells_cloud/models/workbook_protection_request'
|
312
314
|
require 'aspose_cells_cloud/models/worksheet_moving_request'
|
315
|
+
require 'aspose_cells_cloud/models/image_or_print_options'
|
316
|
+
require 'aspose_cells_cloud/models/rendering_font'
|
317
|
+
require 'aspose_cells_cloud/models/rendering_watermark'
|
313
318
|
require 'aspose_cells_cloud/models/pivot_field'
|
314
319
|
require 'aspose_cells_cloud/models/pivot_filter'
|
315
320
|
require 'aspose_cells_cloud/models/pivot_item'
|
@@ -367,6 +372,7 @@ require 'aspose_cells_cloud/models/spinner'
|
|
367
372
|
require 'aspose_cells_cloud/models/text_box'
|
368
373
|
require 'aspose_cells_cloud/models/texture_fill'
|
369
374
|
require 'aspose_cells_cloud/models/tile_pic_option'
|
375
|
+
require 'aspose_cells_cloud/models/digital_signature'
|
370
376
|
require 'aspose_cells_cloud/models/axis'
|
371
377
|
require 'aspose_cells_cloud/models/chart'
|
372
378
|
require 'aspose_cells_cloud/models/chart_area'
|
@@ -521,6 +527,7 @@ require 'aspose_cells_cloud/requests/post_compress_request'
|
|
521
527
|
require 'aspose_cells_cloud/requests/post_export_request'
|
522
528
|
require 'aspose_cells_cloud/requests/post_merge_request'
|
523
529
|
require 'aspose_cells_cloud/requests/post_unlock_request'
|
530
|
+
require 'aspose_cells_cloud/requests/post_lock_request'
|
524
531
|
require 'aspose_cells_cloud/requests/post_protect_request'
|
525
532
|
require 'aspose_cells_cloud/requests/post_split_request'
|
526
533
|
require 'aspose_cells_cloud/requests/post_search_request'
|
@@ -3153,7 +3153,8 @@ describe 'CellsApi' do
|
|
3153
3153
|
mapFiles = { }
|
3154
3154
|
mapFiles[assembly_test_xlsx]= ::File.open(File.expand_path("TestData/"+assembly_test_xlsx),"r")
|
3155
3155
|
mapFiles[data_source_xlsx]= ::File.open(File.expand_path("TestData/"+data_source_xlsx),"r")
|
3156
|
-
|
3156
|
+
protectWorkbookRequst = AsposeCellsCloud::ProtectWorkbookRequst.new();
|
3157
|
+
request = AsposeCellsCloud::PostProtectRequest.new(:File=>mapFiles,:password=>'123456',:protectWorkbookRequst =>protectWorkbookRequst);
|
3157
3158
|
@instance.post_protect(request);
|
3158
3159
|
end
|
3159
3160
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
describe 'CellsApi' do
|
5
|
+
before do
|
6
|
+
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
|
7
|
+
$VERBOSE = nil
|
8
|
+
end
|
9
|
+
|
10
|
+
after do
|
11
|
+
# run after each test
|
12
|
+
end
|
13
|
+
|
14
|
+
describe 'post_protect test' do
|
15
|
+
it "should work" do
|
16
|
+
assembly_test_xlsx = 'assemblytest.xlsx'
|
17
|
+
data_source_xlsx = 'datasource.xlsx'
|
18
|
+
|
19
|
+
|
20
|
+
mapFiles = { }
|
21
|
+
mapFiles[assembly_test_xlsx]= ::File.open(File.expand_path("TestData/"+assembly_test_xlsx),"r")
|
22
|
+
mapFiles[data_source_xlsx]= ::File.open(File.expand_path("TestData/"+data_source_xlsx),"r")
|
23
|
+
protectWorkbookRequst = AsposeCellsCloud::ProtectWorkbookRequst.new();
|
24
|
+
request = AsposeCellsCloud::PostProtectRequest.new(:File=>mapFiles,:password=>'123456',:protectWorkbookRequst =>protectWorkbookRequst);
|
25
|
+
@instance.post_protect(request);
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspose_cells_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '23.
|
4
|
+
version: '23.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aspose Cells Cloud
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -334,6 +334,7 @@ files:
|
|
334
334
|
- lib/aspose_cells_cloud/models/data_sorter.rb
|
335
335
|
- lib/aspose_cells_cloud/models/date_time_group_item.rb
|
336
336
|
- lib/aspose_cells_cloud/models/dif_save_options.rb
|
337
|
+
- lib/aspose_cells_cloud/models/digital_signature.rb
|
337
338
|
- lib/aspose_cells_cloud/models/disc_usage.rb
|
338
339
|
- lib/aspose_cells_cloud/models/display_unit_label.rb
|
339
340
|
- lib/aspose_cells_cloud/models/display_unit_label_response.rb
|
@@ -383,6 +384,7 @@ files:
|
|
383
384
|
- lib/aspose_cells_cloud/models/hyperlinks_response.rb
|
384
385
|
- lib/aspose_cells_cloud/models/icon_filter.rb
|
385
386
|
- lib/aspose_cells_cloud/models/icon_set.rb
|
387
|
+
- lib/aspose_cells_cloud/models/image_or_print_options.rb
|
386
388
|
- lib/aspose_cells_cloud/models/image_save_options.rb
|
387
389
|
- lib/aspose_cells_cloud/models/import2_dimension_double_array_option.rb
|
388
390
|
- lib/aspose_cells_cloud/models/import2_dimension_int_array_option.rb
|
@@ -482,6 +484,8 @@ files:
|
|
482
484
|
- lib/aspose_cells_cloud/models/plot_area_response.rb
|
483
485
|
- lib/aspose_cells_cloud/models/pptx_save_options.rb
|
484
486
|
- lib/aspose_cells_cloud/models/protect_sheet_parameter.rb
|
487
|
+
- lib/aspose_cells_cloud/models/protect_workbook_requst.rb
|
488
|
+
- lib/aspose_cells_cloud/models/protection.rb
|
485
489
|
- lib/aspose_cells_cloud/models/radio_button.rb
|
486
490
|
- lib/aspose_cells_cloud/models/radio_button_response.rb
|
487
491
|
- lib/aspose_cells_cloud/models/range.rb
|
@@ -494,6 +498,8 @@ files:
|
|
494
498
|
- lib/aspose_cells_cloud/models/ranges_response.rb
|
495
499
|
- lib/aspose_cells_cloud/models/rectangle_shape.rb
|
496
500
|
- lib/aspose_cells_cloud/models/rectangle_shape_response.rb
|
501
|
+
- lib/aspose_cells_cloud/models/rendering_font.rb
|
502
|
+
- lib/aspose_cells_cloud/models/rendering_watermark.rb
|
497
503
|
- lib/aspose_cells_cloud/models/result_destination.rb
|
498
504
|
- lib/aspose_cells_cloud/models/row.rb
|
499
505
|
- lib/aspose_cells_cloud/models/row_response.rb
|
@@ -794,6 +800,7 @@ files:
|
|
794
800
|
- lib/aspose_cells_cloud/requests/post_hide_worksheet_rows_request.rb
|
795
801
|
- lib/aspose_cells_cloud/requests/post_import_data_request.rb
|
796
802
|
- lib/aspose_cells_cloud/requests/post_import_request.rb
|
803
|
+
- lib/aspose_cells_cloud/requests/post_lock_request.rb
|
797
804
|
- lib/aspose_cells_cloud/requests/post_merge_request.rb
|
798
805
|
- lib/aspose_cells_cloud/requests/post_metadata_request.rb
|
799
806
|
- lib/aspose_cells_cloud/requests/post_move_worksheet_request.rb
|
@@ -956,12 +963,13 @@ files:
|
|
956
963
|
- spec/conversion/conversion_png_spec.rb
|
957
964
|
- spec/conversion/conversion_spec.rb
|
958
965
|
- spec/document/light_cells_spec.rb
|
966
|
+
- spec/onecase_spec.rb
|
959
967
|
- spec/spec_helper.rb
|
960
968
|
homepage: https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
|
961
969
|
licenses:
|
962
970
|
- MIT
|
963
971
|
metadata: {}
|
964
|
-
post_install_message:
|
972
|
+
post_install_message:
|
965
973
|
rdoc_options: []
|
966
974
|
require_paths:
|
967
975
|
- lib
|
@@ -976,8 +984,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
976
984
|
- !ruby/object:Gem::Version
|
977
985
|
version: '0'
|
978
986
|
requirements: []
|
979
|
-
rubygems_version: 3.
|
980
|
-
signing_key:
|
987
|
+
rubygems_version: 3.4.15
|
988
|
+
signing_key:
|
981
989
|
specification_version: 4
|
982
990
|
summary: This Cloud SDK enhances your Ruby cloud-based apps to [process & manipulate
|
983
991
|
Microsoft Excel spreadsheets](https://products.aspose.cloud/cells/ruby) in the cloud,
|