AsposeDiagramCloud 18.10 → 20.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +5 -5
  2. data/AsposeDiagramCloud.gemspec +46 -0
  3. data/Gemfile +7 -0
  4. data/README.md +74 -0
  5. data/Rakefile +8 -0
  6. data/git_push.sh +55 -0
  7. data/lib/AsposeDiagramCloud.rb +85 -0
  8. data/lib/AsposeDiagramCloud/api/diagram_api.rb +768 -0
  9. data/lib/AsposeDiagramCloud/api/o_auth_api.rb +93 -0
  10. data/lib/AsposeDiagramCloud/api/storage_api.rb +905 -0
  11. data/lib/AsposeDiagramCloud/api_client.rb +391 -0
  12. data/lib/AsposeDiagramCloud/api_error.rb +38 -0
  13. data/lib/AsposeDiagramCloud/configuration.rb +209 -0
  14. data/lib/AsposeDiagramCloud/models/access_token_response.rb +251 -0
  15. data/lib/AsposeDiagramCloud/models/api_response_of_list_of_page_data.rb +190 -0
  16. data/lib/AsposeDiagramCloud/models/create_new_response.rb +188 -0
  17. data/lib/AsposeDiagramCloud/models/diagram_save_options.rb +244 -0
  18. data/lib/AsposeDiagramCloud/models/disc_usage.rb +209 -0
  19. data/lib/AsposeDiagramCloud/models/draw_shape_data.rb +262 -0
  20. data/lib/AsposeDiagramCloud/models/ellipse_data.rb +262 -0
  21. data/lib/AsposeDiagramCloud/models/error.rb +219 -0
  22. data/lib/AsposeDiagramCloud/models/error_details.rb +204 -0
  23. data/lib/AsposeDiagramCloud/models/file_version.rb +264 -0
  24. data/lib/AsposeDiagramCloud/models/file_versions.rb +191 -0
  25. data/lib/AsposeDiagramCloud/models/files_list.rb +191 -0
  26. data/lib/AsposeDiagramCloud/models/files_upload_result.rb +203 -0
  27. data/lib/AsposeDiagramCloud/models/html_save_options.rb +330 -0
  28. data/lib/AsposeDiagramCloud/models/image_save_options.rb +492 -0
  29. data/lib/AsposeDiagramCloud/models/line_data.rb +273 -0
  30. data/lib/AsposeDiagramCloud/models/modify_response.rb +202 -0
  31. data/lib/AsposeDiagramCloud/models/object_exist.rb +209 -0
  32. data/lib/AsposeDiagramCloud/models/page_data.rb +216 -0
  33. data/lib/AsposeDiagramCloud/models/page_setting.rb +219 -0
  34. data/lib/AsposeDiagramCloud/models/page_size.rb +221 -0
  35. data/lib/AsposeDiagramCloud/models/pdf_digital_signature_details.rb +248 -0
  36. data/lib/AsposeDiagramCloud/models/pdf_encryption_details.rb +260 -0
  37. data/lib/AsposeDiagramCloud/models/pdf_save_options.rb +408 -0
  38. data/lib/AsposeDiagramCloud/models/point_f.rb +221 -0
  39. data/lib/AsposeDiagramCloud/models/polyline_data.rb +273 -0
  40. data/lib/AsposeDiagramCloud/models/rectangle_f.rb +333 -0
  41. data/lib/AsposeDiagramCloud/models/rendering_save_options.rb +276 -0
  42. data/lib/AsposeDiagramCloud/models/saa_spose_response.rb +179 -0
  43. data/lib/AsposeDiagramCloud/models/save_as_response.rb +208 -0
  44. data/lib/AsposeDiagramCloud/models/save_options_model.rb +235 -0
  45. data/lib/AsposeDiagramCloud/models/save_options_request.rb +206 -0
  46. data/lib/AsposeDiagramCloud/models/shape_data.rb +221 -0
  47. data/lib/AsposeDiagramCloud/models/shape_style_data.rb +189 -0
  48. data/lib/AsposeDiagramCloud/models/storage_exist.rb +194 -0
  49. data/lib/AsposeDiagramCloud/models/storage_file.rb +239 -0
  50. data/lib/AsposeDiagramCloud/models/svg_save_options.rb +321 -0
  51. data/lib/AsposeDiagramCloud/models/swf_save_options.rb +271 -0
  52. data/lib/AsposeDiagramCloud/models/text_style_data.rb +253 -0
  53. data/lib/AsposeDiagramCloud/models/upload_response.rb +188 -0
  54. data/lib/AsposeDiagramCloud/models/xaml_save_options.rb +262 -0
  55. data/lib/AsposeDiagramCloud/models/xps_save_options.rb +271 -0
  56. data/lib/AsposeDiagramCloud/version.rb +15 -0
  57. data/spec/_spec.rb +308 -0
  58. data/spec/api/test_convert_spec.rb +308 -0
  59. data/spec/api/test_drawing_spec.rb +136 -0
  60. data/spec/api/test_page_spec.rb +92 -0
  61. data/spec/api_client_spec.rb +226 -0
  62. data/spec/configuration_spec.rb +42 -0
  63. data/spec/spec_helper.rb +120 -0
  64. data/testData/FileUpload.vdx +437 -0
  65. metadata +118 -49
@@ -0,0 +1,15 @@
1
+ =begin
2
+ #Aspose.Diagram Cloud API Reference
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 3.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
+ module AsposeDiagramCloud
14
+ VERSION = "20.3"
15
+ end
@@ -0,0 +1,308 @@
1
+ =begin
2
+ #Aspose.Diagram Cloud API Reference
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 3.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
+ #rspec spec/api/test_convert_spec.rb
13
+
14
+ require 'spec_helper'
15
+ require 'json'
16
+
17
+ # Unit tests for AsposeDiagramCloud::DiagramApi
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'DiagramApi' do
21
+ before do
22
+ # run before each test
23
+ #@instance = AsposeDiagramCloud::DiagramApi.new($grant_type,$client_id,$client_secret)
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of DiagramApi' do
31
+ it 'should create an instance of DiagramApi' do
32
+ expect($diagramApi).to be_instance_of(AsposeDiagramCloud::DiagramApi)
33
+ end
34
+ end
35
+
36
+ describe 'test upload file' do
37
+ it 'should upload file' do
38
+ file=::File.open(File.expand_path($localtestFile),"r") {|io| io.read(io.size) }
39
+ result=$storageApi.upload_file($storageTestFOLDER+"/FileUpload.vdx",file)
40
+ expect(result.uploaded).not_to be_empty
41
+ end
42
+ end
43
+
44
+ # unit tests for convert_document
45
+ # Converts document from the request's content to the specified format.
46
+ #
47
+ # @param name Download document name.
48
+ # @param file File to upload
49
+ # @param [Hash] opts the optional parameters
50
+ # @option opts [String] :source_filename Source document name.
51
+ # @return [File]
52
+ describe 'convert_document test' do
53
+ it "should work" do
54
+ file=::File.open(File.expand_path($localtestFile),"r") {|io| io.read(io.size) }
55
+ result=$diagramApi.convert_document("Convert.pdf",file,{:source_filename=>"FileUpload.vdx"})
56
+ #print(result.size)
57
+ expect(result.size).to be > 0
58
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
+ end
60
+ end
61
+
62
+ # unit tests for create_new
63
+ # Create Empty file into the specified format.
64
+ #
65
+ # @param name The document name.
66
+ # @param [Hash] opts the optional parameters
67
+ # @option opts [String] :folder The document folder.
68
+ # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false
69
+ # @return [CreateNewResponse]
70
+ describe 'create_new test' do
71
+ it "should work" do
72
+ name = 'file_create_ruby.vdx'
73
+ folder = $storageTestFOLDER
74
+ is_overwrite=true
75
+ result=$diagramApi.create_new(name, {:name=>name, :is_overwrite=>is_overwrite, :folder=>folder})
76
+ print(result)
77
+ expect(result.created).not_to be_empty
78
+ #assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
+ end
80
+ end
81
+
82
+ # unit tests for download_file_with_format
83
+ # Exports the document into the specified format.
84
+ #
85
+ # @param name The document name.
86
+ # @param format The destination format.
87
+ # @param [Hash] opts the optional parameters
88
+ # @option opts [String] :folder Original document folder.
89
+ # @return [File]
90
+ describe 'download_file_with_format test' do
91
+ it "should work" do
92
+ folder = $storageTestFOLDER
93
+ result=$diagramApi.download_file_with_format("FileUpload.vdx","png", {:folder=>folder})
94
+ expect(result.size).to be > 0
95
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
96
+ end
97
+ end
98
+
99
+ # unit tests for save_as
100
+ # Converts document to destination format with detailed settings and saves result to storage.
101
+ #
102
+ # @param name Original document name.
103
+ # @param save_options_request Save options.
104
+ # @param [Hash] opts the optional parameters
105
+ # @option opts [String] :folder Original document folder.
106
+ # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false
107
+ # @return [SaveAsResponse]
108
+ describe 'save_as test' do
109
+ it "should work" do
110
+ folder =$storageTestFOLDER
111
+ is_overwrite = true
112
+
113
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
114
+ save_as_request.file_name="FileSaveAs.pdf"
115
+ save_as_request.folder=folder
116
+
117
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
118
+ expect(result.saved_file).not_to be_empty
119
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
120
+ end
121
+ end
122
+
123
+ describe 'save_as pdf test' do
124
+ it "should work" do
125
+ folder =$storageTestFOLDER
126
+ is_overwrite = true
127
+
128
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
129
+ save_as_request.file_name="FileSaveAs.pdf"
130
+ save_as_request.folder=folder
131
+
132
+ save_options=AsposeDiagramCloud::PdfSaveOptions.new
133
+ save_options.is_export_comments=true
134
+ save_options.jpeg_quality=100
135
+
136
+ save_as_request.save_options=save_options
137
+
138
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
139
+ expect(result.saved_file).not_to be_empty
140
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
141
+ end
142
+ end
143
+
144
+ describe 'save_as png test' do
145
+ it "should work" do
146
+ folder =$storageTestFOLDER
147
+ is_overwrite = true
148
+
149
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
150
+ save_as_request.file_name="FileSaveAs.png"
151
+ save_as_request.folder=folder
152
+
153
+ save_options=AsposeDiagramCloud::ImageSaveOptions.new
154
+ save_options.is_export_comments=true
155
+ save_options.jpeg_quality=100
156
+
157
+ save_as_request.save_options=save_options
158
+
159
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
160
+ expect(result.saved_file).not_to be_empty
161
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
162
+ end
163
+ end
164
+
165
+ describe 'save_as bmp test' do
166
+ it "should work" do
167
+ folder =$storageTestFOLDER
168
+ is_overwrite = true
169
+
170
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
171
+ save_as_request.file_name="FileSaveAs.bmp"
172
+ save_as_request.folder=folder
173
+
174
+ save_options=AsposeDiagramCloud::ImageSaveOptions.new
175
+ save_options.is_export_comments=true
176
+ save_options.jpeg_quality=100
177
+
178
+ save_as_request.save_options=save_options
179
+
180
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
181
+ expect(result.saved_file).not_to be_empty
182
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
183
+ end
184
+ end
185
+
186
+ describe 'save_as vssx test' do
187
+ it "should work" do
188
+ folder =$storageTestFOLDER
189
+ is_overwrite = true
190
+
191
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
192
+ save_as_request.file_name="FileSaveAs.vssx"
193
+ save_as_request.folder=folder
194
+
195
+ save_options=AsposeDiagramCloud::DiagramSaveOptions.new
196
+ save_options.default_font="Times New Roman"
197
+
198
+ save_as_request.save_options=save_options
199
+
200
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
201
+ expect(result.saved_file).not_to be_empty
202
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
203
+ end
204
+ end
205
+
206
+ describe 'save_as vstm test' do
207
+ it "should work" do
208
+ folder =$storageTestFOLDER
209
+ is_overwrite = true
210
+
211
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
212
+ save_as_request.file_name="FileSaveAs.vstm"
213
+ save_as_request.folder=folder
214
+
215
+ save_options=AsposeDiagramCloud::DiagramSaveOptions.new
216
+ save_options.default_font="Times New Roman"
217
+
218
+ save_as_request.save_options=save_options
219
+
220
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
221
+ expect(result.saved_file).not_to be_empty
222
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
223
+ end
224
+ end
225
+
226
+ describe 'save_as svg test' do
227
+ it "should work" do
228
+ folder =$storageTestFOLDER
229
+ is_overwrite = true
230
+
231
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
232
+ save_as_request.file_name="FileSaveAs.svg"
233
+ save_as_request.folder=folder
234
+
235
+ save_options=AsposeDiagramCloud::SVGSaveOptions.new
236
+ save_options.quality=100
237
+
238
+ save_as_request.save_options=save_options
239
+
240
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
241
+ expect(result.saved_file).not_to be_empty
242
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
243
+ end
244
+ end
245
+
246
+ describe 'save_as swf test' do
247
+ it "should work" do
248
+ folder =$storageTestFOLDER
249
+ is_overwrite = true
250
+
251
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
252
+ save_as_request.file_name="FileSaveAs.swf"
253
+ save_as_request.folder=folder
254
+
255
+ save_options=AsposeDiagramCloud::SWFSaveOptions.new
256
+ save_options.save_foreground_pages_only=true
257
+
258
+ save_as_request.save_options=save_options
259
+
260
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
261
+ expect(result.saved_file).not_to be_empty
262
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
263
+ end
264
+ end
265
+
266
+ describe 'save_as html test' do
267
+ it "should work" do
268
+ folder =$storageTestFOLDER
269
+ is_overwrite = true
270
+
271
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
272
+ save_as_request.file_name="FileSaveAs.html"
273
+ save_as_request.folder=folder
274
+
275
+ save_options=AsposeDiagramCloud::HTMLSaveOptions.new
276
+ save_options.title="Save as HTML Test"
277
+
278
+ save_as_request.save_options=save_options
279
+
280
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
281
+
282
+ expect(result.saved_file).not_to be_empty
283
+ expect(result.additionals).not_to be_empty
284
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
285
+ end
286
+ end
287
+
288
+ describe 'save_as xps test' do
289
+ it "should work" do
290
+ folder =$storageTestFOLDER
291
+ is_overwrite = true
292
+
293
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
294
+ save_as_request.file_name="FileSaveAs.xps"
295
+ save_as_request.folder=folder
296
+
297
+ save_options=AsposeDiagramCloud::XPSSaveOptions.new
298
+ save_options.save_foreground_pages_only=true
299
+
300
+ save_as_request.save_options=save_options
301
+
302
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
303
+ expect(result.saved_file).not_to be_empty
304
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
305
+ end
306
+ end
307
+
308
+ end
@@ -0,0 +1,308 @@
1
+ =begin
2
+ #Aspose.Diagram Cloud API Reference
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 3.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
+ #rspec spec/api/test_convert_spec.rb
13
+
14
+ require 'spec_helper'
15
+ require 'json'
16
+
17
+ # Unit tests for AsposeDiagramCloud::DiagramApi
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'DiagramApi' do
21
+ before do
22
+ # run before each test
23
+ #@instance = AsposeDiagramCloud::DiagramApi.new($grant_type,$client_id,$client_secret)
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of DiagramApi' do
31
+ it 'should create an instance of DiagramApi' do
32
+ expect($diagramApi).to be_instance_of(AsposeDiagramCloud::DiagramApi)
33
+ end
34
+ end
35
+
36
+ describe 'test upload file' do
37
+ it 'should upload file' do
38
+ file=::File.open(File.expand_path($localtestFile),"r") {|io| io.read(io.size) }
39
+ result=$storageApi.upload_file($storageTestFOLDER+"/FileUpload.vdx",file)
40
+ expect(result.uploaded).not_to be_empty
41
+ end
42
+ end
43
+
44
+ # unit tests for convert_document
45
+ # Converts document from the request's content to the specified format.
46
+ #
47
+ # @param name Download document name.
48
+ # @param file File to upload
49
+ # @param [Hash] opts the optional parameters
50
+ # @option opts [String] :source_filename Source document name.
51
+ # @return [File]
52
+ describe 'convert_document test' do
53
+ it "should work" do
54
+ file=::File.open(File.expand_path($localtestFile),"r") {|io| io.read(io.size) }
55
+ result=$diagramApi.convert_document("Convert.pdf",file,{:source_filename=>"FileUpload.vdx"})
56
+ #print(result.size)
57
+ expect(result.size).to be > 0
58
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
+ end
60
+ end
61
+
62
+ # unit tests for create_new
63
+ # Create Empty file into the specified format.
64
+ #
65
+ # @param name The document name.
66
+ # @param [Hash] opts the optional parameters
67
+ # @option opts [String] :folder The document folder.
68
+ # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false
69
+ # @return [CreateNewResponse]
70
+ describe 'create_new test' do
71
+ it "should work" do
72
+ name = 'file_create_ruby.vdx'
73
+ folder = $storageTestFOLDER
74
+ is_overwrite=true
75
+ result=$diagramApi.create_new(name, {:name=>name, :is_overwrite=>is_overwrite, :folder=>folder})
76
+ print(result)
77
+ expect(result.created).not_to be_empty
78
+ #assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
+ end
80
+ end
81
+
82
+ # unit tests for download_file_with_format
83
+ # Exports the document into the specified format.
84
+ #
85
+ # @param name The document name.
86
+ # @param format The destination format.
87
+ # @param [Hash] opts the optional parameters
88
+ # @option opts [String] :folder Original document folder.
89
+ # @return [File]
90
+ describe 'download_file_with_format test' do
91
+ it "should work" do
92
+ folder = $storageTestFOLDER
93
+ result=$diagramApi.download_file_with_format("FileUpload.vdx","png", {:folder=>folder})
94
+ expect(result.size).to be > 0
95
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
96
+ end
97
+ end
98
+
99
+ # unit tests for save_as
100
+ # Converts document to destination format with detailed settings and saves result to storage.
101
+ #
102
+ # @param name Original document name.
103
+ # @param save_options_request Save options.
104
+ # @param [Hash] opts the optional parameters
105
+ # @option opts [String] :folder Original document folder.
106
+ # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false
107
+ # @return [SaveAsResponse]
108
+ describe 'save_as test' do
109
+ it "should work" do
110
+ folder =$storageTestFOLDER
111
+ is_overwrite = true
112
+
113
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
114
+ save_as_request.file_name="FileSaveAs.pdf"
115
+ save_as_request.folder=folder
116
+
117
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
118
+ expect(result.saved_file).not_to be_empty
119
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
120
+ end
121
+ end
122
+
123
+ describe 'save_as pdf test' do
124
+ it "should work" do
125
+ folder =$storageTestFOLDER
126
+ is_overwrite = true
127
+
128
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
129
+ save_as_request.file_name="FileSaveAs.pdf"
130
+ save_as_request.folder=folder
131
+
132
+ save_options=AsposeDiagramCloud::PdfSaveOptions.new
133
+ save_options.is_export_comments=true
134
+ save_options.jpeg_quality=100
135
+
136
+ save_as_request.save_options=save_options
137
+
138
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
139
+ expect(result.saved_file).not_to be_empty
140
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
141
+ end
142
+ end
143
+
144
+ describe 'save_as png test' do
145
+ it "should work" do
146
+ folder =$storageTestFOLDER
147
+ is_overwrite = true
148
+
149
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
150
+ save_as_request.file_name="FileSaveAs.png"
151
+ save_as_request.folder=folder
152
+
153
+ save_options=AsposeDiagramCloud::ImageSaveOptions.new
154
+ save_options.is_export_comments=true
155
+ save_options.jpeg_quality=100
156
+
157
+ save_as_request.save_options=save_options
158
+
159
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
160
+ expect(result.saved_file).not_to be_empty
161
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
162
+ end
163
+ end
164
+
165
+ describe 'save_as bmp test' do
166
+ it "should work" do
167
+ folder =$storageTestFOLDER
168
+ is_overwrite = true
169
+
170
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
171
+ save_as_request.file_name="FileSaveAs.bmp"
172
+ save_as_request.folder=folder
173
+
174
+ save_options=AsposeDiagramCloud::ImageSaveOptions.new
175
+ save_options.is_export_comments=true
176
+ save_options.jpeg_quality=100
177
+
178
+ save_as_request.save_options=save_options
179
+
180
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
181
+ expect(result.saved_file).not_to be_empty
182
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
183
+ end
184
+ end
185
+
186
+ describe 'save_as vssx test' do
187
+ it "should work" do
188
+ folder =$storageTestFOLDER
189
+ is_overwrite = true
190
+
191
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
192
+ save_as_request.file_name="FileSaveAs.vssx"
193
+ save_as_request.folder=folder
194
+
195
+ save_options=AsposeDiagramCloud::DiagramSaveOptions.new
196
+ save_options.default_font="Times New Roman"
197
+
198
+ save_as_request.save_options=save_options
199
+
200
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
201
+ expect(result.saved_file).not_to be_empty
202
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
203
+ end
204
+ end
205
+
206
+ describe 'save_as vstm test' do
207
+ it "should work" do
208
+ folder =$storageTestFOLDER
209
+ is_overwrite = true
210
+
211
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
212
+ save_as_request.file_name="FileSaveAs.vstm"
213
+ save_as_request.folder=folder
214
+
215
+ save_options=AsposeDiagramCloud::DiagramSaveOptions.new
216
+ save_options.default_font="Times New Roman"
217
+
218
+ save_as_request.save_options=save_options
219
+
220
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
221
+ expect(result.saved_file).not_to be_empty
222
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
223
+ end
224
+ end
225
+
226
+ describe 'save_as svg test' do
227
+ it "should work" do
228
+ folder =$storageTestFOLDER
229
+ is_overwrite = true
230
+
231
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
232
+ save_as_request.file_name="FileSaveAs.svg"
233
+ save_as_request.folder=folder
234
+
235
+ save_options=AsposeDiagramCloud::SVGSaveOptions.new
236
+ save_options.quality=100
237
+
238
+ save_as_request.save_options=save_options
239
+
240
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
241
+ expect(result.saved_file).not_to be_empty
242
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
243
+ end
244
+ end
245
+
246
+ describe 'save_as swf test' do
247
+ it "should work" do
248
+ folder =$storageTestFOLDER
249
+ is_overwrite = true
250
+
251
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
252
+ save_as_request.file_name="FileSaveAs.swf"
253
+ save_as_request.folder=folder
254
+
255
+ save_options=AsposeDiagramCloud::SWFSaveOptions.new
256
+ save_options.save_foreground_pages_only=true
257
+
258
+ save_as_request.save_options=save_options
259
+
260
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
261
+ expect(result.saved_file).not_to be_empty
262
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
263
+ end
264
+ end
265
+
266
+ describe 'save_as html test' do
267
+ it "should work" do
268
+ folder =$storageTestFOLDER
269
+ is_overwrite = true
270
+
271
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
272
+ save_as_request.file_name="FileSaveAs.html"
273
+ save_as_request.folder=folder
274
+
275
+ save_options=AsposeDiagramCloud::HTMLSaveOptions.new
276
+ save_options.title="Save as HTML Test"
277
+
278
+ save_as_request.save_options=save_options
279
+
280
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
281
+
282
+ expect(result.saved_file).not_to be_empty
283
+ expect(result.additionals).not_to be_empty
284
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
285
+ end
286
+ end
287
+
288
+ describe 'save_as xps test' do
289
+ it "should work" do
290
+ folder =$storageTestFOLDER
291
+ is_overwrite = true
292
+
293
+ save_as_request=AsposeDiagramCloud::SaveOptionsRequest.new
294
+ save_as_request.file_name="FileSaveAs.xps"
295
+ save_as_request.folder=folder
296
+
297
+ save_options=AsposeDiagramCloud::XPSSaveOptions.new
298
+ save_options.save_foreground_pages_only=true
299
+
300
+ save_as_request.save_options=save_options
301
+
302
+ result=$diagramApi.save_as("FileUpload.vdx",save_as_request,{:is_overwrite=>is_overwrite, :folder=>folder})
303
+ expect(result.saved_file).not_to be_empty
304
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
305
+ end
306
+ end
307
+
308
+ end