aspose_slides_cloud 20.4.0 → 20.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +61 -61
  3. data/TestData/ChartTest.pptx +0 -0
  4. data/TestData/Sections.pptx +0 -0
  5. data/TestData/TemplatingCVDataWithBase64.xml +22 -22
  6. data/lib/aspose_slides_cloud.rb +212 -205
  7. data/lib/aspose_slides_cloud/api/slides_api.rb +10979 -7974
  8. data/lib/aspose_slides_cloud/api/slides_api_requests.rb +4146 -3099
  9. data/lib/aspose_slides_cloud/api_client.rb +432 -429
  10. data/lib/aspose_slides_cloud/models/add_layout_slide.rb +244 -261
  11. data/lib/aspose_slides_cloud/models/add_master_slide.rb +259 -276
  12. data/lib/aspose_slides_cloud/models/add_shape.rb +239 -256
  13. data/lib/aspose_slides_cloud/models/add_slide.rb +269 -286
  14. data/lib/aspose_slides_cloud/models/api_info.rb +217 -205
  15. data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +285 -273
  16. data/lib/aspose_slides_cloud/models/audio_frame.rb +359 -573
  17. data/lib/aspose_slides_cloud/models/axes.rb +237 -225
  18. data/lib/aspose_slides_cloud/models/axis.rb +699 -687
  19. data/lib/aspose_slides_cloud/models/base64_input_file.rb +230 -256
  20. data/lib/aspose_slides_cloud/models/blur_effect.rb +227 -215
  21. data/lib/aspose_slides_cloud/models/box_and_whisker_series.rb +299 -0
  22. data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +212 -230
  23. data/lib/aspose_slides_cloud/models/bubble_series.rb +248 -428
  24. data/lib/aspose_slides_cloud/models/chart.rb +365 -553
  25. data/lib/aspose_slides_cloud/models/chart_category.rb +271 -0
  26. data/lib/aspose_slides_cloud/models/chart_title.rb +222 -210
  27. data/lib/aspose_slides_cloud/models/chart_wall.rb +281 -269
  28. data/lib/aspose_slides_cloud/models/color_scheme.rb +317 -327
  29. data/lib/aspose_slides_cloud/models/common_slide_view_properties.rb +217 -0
  30. data/lib/aspose_slides_cloud/models/connector.rb +275 -487
  31. data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +209 -197
  32. data/lib/aspose_slides_cloud/models/{resource_uri_element.rb → data_point.rb} +197 -195
  33. data/lib/aspose_slides_cloud/models/disc_usage.rb +227 -215
  34. data/lib/aspose_slides_cloud/models/document.rb +257 -267
  35. data/lib/aspose_slides_cloud/models/document_properties.rb +209 -219
  36. data/lib/aspose_slides_cloud/models/document_property.rb +232 -242
  37. data/lib/aspose_slides_cloud/models/document_replace_result.rb +218 -282
  38. data/lib/aspose_slides_cloud/models/effect.rb +424 -412
  39. data/lib/aspose_slides_cloud/models/effect_format.rb +277 -265
  40. data/lib/aspose_slides_cloud/models/entity_exists.rb +212 -0
  41. data/lib/aspose_slides_cloud/models/error.rb +237 -225
  42. data/lib/aspose_slides_cloud/models/error_details.rb +222 -210
  43. data/lib/aspose_slides_cloud/models/export_format.rb +60 -59
  44. data/lib/aspose_slides_cloud/models/export_options.rb +216 -194
  45. data/lib/aspose_slides_cloud/models/file_version.rb +225 -270
  46. data/lib/aspose_slides_cloud/models/file_versions.rb +209 -197
  47. data/lib/aspose_slides_cloud/models/files_list.rb +209 -197
  48. data/lib/aspose_slides_cloud/models/files_upload_result.rb +221 -209
  49. data/lib/aspose_slides_cloud/models/fill_format.rb +240 -228
  50. data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +246 -234
  51. data/lib/aspose_slides_cloud/models/font_scheme.rb +227 -237
  52. data/lib/aspose_slides_cloud/models/font_set.rb +227 -215
  53. data/lib/aspose_slides_cloud/models/format_scheme.rb +245 -255
  54. data/lib/aspose_slides_cloud/models/geometry_shape.rb +260 -439
  55. data/lib/aspose_slides_cloud/models/glow_effect.rb +222 -210
  56. data/lib/aspose_slides_cloud/models/gradient_fill.rb +342 -359
  57. data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +222 -210
  58. data/lib/aspose_slides_cloud/models/graphical_object.rb +234 -422
  59. data/lib/aspose_slides_cloud/models/group_shape.rb +234 -422
  60. data/lib/aspose_slides_cloud/models/header_footer.rb +247 -0
  61. data/lib/aspose_slides_cloud/models/html_export_options.rb +421 -420
  62. data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +197 -195
  63. data/lib/aspose_slides_cloud/models/image.rb +237 -247
  64. data/lib/aspose_slides_cloud/models/image_export_format.rb +43 -43
  65. data/lib/aspose_slides_cloud/models/image_export_options.rb +299 -298
  66. data/lib/aspose_slides_cloud/models/images.rb +209 -219
  67. data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +252 -240
  68. data/lib/aspose_slides_cloud/models/input.rb +227 -215
  69. data/lib/aspose_slides_cloud/models/input_file.rb +250 -238
  70. data/lib/aspose_slides_cloud/models/interactive_sequence.rb +224 -212
  71. data/lib/aspose_slides_cloud/models/layout_slide.rb +278 -288
  72. data/lib/aspose_slides_cloud/models/layout_slides.rb +209 -219
  73. data/lib/aspose_slides_cloud/models/legend.rb +321 -309
  74. data/lib/aspose_slides_cloud/models/line_format.rb +389 -377
  75. data/lib/aspose_slides_cloud/models/master_slide.rb +231 -241
  76. data/lib/aspose_slides_cloud/models/master_slides.rb +209 -219
  77. data/lib/aspose_slides_cloud/models/merge.rb +231 -248
  78. data/lib/aspose_slides_cloud/models/merging_source.rb +219 -207
  79. data/lib/aspose_slides_cloud/models/no_fill.rb +219 -236
  80. data/lib/aspose_slides_cloud/models/normal_view_restored_properties.rb +217 -0
  81. data/lib/aspose_slides_cloud/models/notes_slide.rb +217 -227
  82. data/lib/aspose_slides_cloud/models/notes_slide_export_format.rb +43 -43
  83. data/lib/aspose_slides_cloud/models/notes_slide_header_footer.rb +267 -0
  84. data/lib/aspose_slides_cloud/models/object_exist.rb +227 -215
  85. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +259 -447
  86. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +210 -200
  87. data/lib/aspose_slides_cloud/models/one_value_series.rb +248 -428
  88. data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +209 -197
  89. data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +252 -240
  90. data/lib/aspose_slides_cloud/models/output_file.rb +240 -228
  91. data/lib/aspose_slides_cloud/models/paragraph.rb +517 -527
  92. data/lib/aspose_slides_cloud/models/paragraphs.rb +209 -219
  93. data/lib/aspose_slides_cloud/models/path_input_file.rb +240 -266
  94. data/lib/aspose_slides_cloud/models/path_output_file.rb +239 -256
  95. data/lib/aspose_slides_cloud/models/pattern_fill.rb +266 -283
  96. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +547 -519
  97. data/lib/aspose_slides_cloud/models/picture_fill.rb +351 -368
  98. data/lib/aspose_slides_cloud/models/picture_frame.rb +245 -459
  99. data/lib/aspose_slides_cloud/models/pipeline.rb +219 -207
  100. data/lib/aspose_slides_cloud/models/placeholder.rb +325 -335
  101. data/lib/aspose_slides_cloud/models/placeholders.rb +209 -219
  102. data/lib/aspose_slides_cloud/models/plot_area.rb +311 -299
  103. data/lib/aspose_slides_cloud/models/portion.rb +589 -599
  104. data/lib/aspose_slides_cloud/models/portions.rb +209 -219
  105. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +247 -246
  106. data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +229 -217
  107. data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +221 -209
  108. data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +286 -274
  109. data/lib/aspose_slides_cloud/models/reflection_effect.rb +441 -429
  110. data/lib/aspose_slides_cloud/models/remove_shape.rb +229 -246
  111. data/lib/aspose_slides_cloud/models/remove_slide.rb +234 -251
  112. data/lib/aspose_slides_cloud/models/reorder_slide.rb +249 -266
  113. data/lib/aspose_slides_cloud/models/replace_text.rb +269 -286
  114. data/lib/aspose_slides_cloud/models/request_input_file.rb +235 -261
  115. data/lib/aspose_slides_cloud/models/reset_slide.rb +234 -251
  116. data/lib/aspose_slides_cloud/models/resource_base.rb +219 -207
  117. data/lib/aspose_slides_cloud/models/resource_uri.rb +237 -225
  118. data/lib/aspose_slides_cloud/models/response_output_file.rb +219 -236
  119. data/lib/aspose_slides_cloud/models/save.rb +266 -283
  120. data/lib/aspose_slides_cloud/models/save_shape.rb +276 -293
  121. data/lib/aspose_slides_cloud/models/save_slide.rb +301 -318
  122. data/lib/aspose_slides_cloud/models/scale_type.rb +41 -41
  123. data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +225 -215
  124. data/lib/aspose_slides_cloud/models/scatter_series.rb +248 -428
  125. data/lib/aspose_slides_cloud/models/section.rb +234 -0
  126. data/lib/aspose_slides_cloud/models/sections.rb +209 -0
  127. data/lib/aspose_slides_cloud/models/series.rb +422 -389
  128. data/lib/aspose_slides_cloud/models/series_marker.rb +281 -269
  129. data/lib/aspose_slides_cloud/models/shape.rb +255 -467
  130. data/lib/aspose_slides_cloud/models/shape_base.rb +375 -406
  131. data/lib/aspose_slides_cloud/models/shape_export_format.rb +44 -44
  132. data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +286 -274
  133. data/lib/aspose_slides_cloud/models/shape_thumbnail_bounds.rb +41 -41
  134. data/lib/aspose_slides_cloud/models/shapes.rb +209 -219
  135. data/lib/aspose_slides_cloud/models/size_type.rb +55 -55
  136. data/lib/aspose_slides_cloud/models/slide.rb +322 -332
  137. data/lib/aspose_slides_cloud/models/slide_animation.rb +221 -231
  138. data/lib/aspose_slides_cloud/models/slide_background.rb +266 -276
  139. data/lib/aspose_slides_cloud/models/slide_comment.rb +239 -227
  140. data/lib/aspose_slides_cloud/models/slide_comments.rb +209 -219
  141. data/lib/aspose_slides_cloud/models/slide_export_format.rb +59 -58
  142. data/lib/aspose_slides_cloud/models/slide_replace_result.rb +223 -347
  143. data/lib/aspose_slides_cloud/models/slides.rb +209 -219
  144. data/lib/aspose_slides_cloud/models/smart_art.rb +342 -530
  145. data/lib/aspose_slides_cloud/models/smart_art_node.rb +293 -281
  146. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +235 -422
  147. data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +212 -200
  148. data/lib/aspose_slides_cloud/models/solid_fill.rb +229 -246
  149. data/lib/aspose_slides_cloud/models/split_document_result.rb +209 -219
  150. data/lib/aspose_slides_cloud/models/storage_exist.rb +212 -200
  151. data/lib/aspose_slides_cloud/models/storage_file.rb +257 -245
  152. data/lib/aspose_slides_cloud/models/svg_export_options.rb +379 -378
  153. data/lib/aspose_slides_cloud/models/swf_export_options.rb +529 -528
  154. data/lib/aspose_slides_cloud/models/table.rb +350 -538
  155. data/lib/aspose_slides_cloud/models/table_cell.rb +403 -391
  156. data/lib/aspose_slides_cloud/models/table_column.rb +212 -200
  157. data/lib/aspose_slides_cloud/models/table_row.rb +239 -227
  158. data/lib/aspose_slides_cloud/models/task.rb +240 -228
  159. data/lib/aspose_slides_cloud/models/text_item.rb +217 -205
  160. data/lib/aspose_slides_cloud/models/text_items.rb +209 -219
  161. data/lib/aspose_slides_cloud/models/theme.rb +237 -247
  162. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +423 -422
  163. data/lib/aspose_slides_cloud/models/update_background.rb +241 -258
  164. data/lib/aspose_slides_cloud/models/update_shape.rb +239 -256
  165. data/lib/aspose_slides_cloud/models/video_frame.rb +329 -543
  166. data/lib/aspose_slides_cloud/models/view_properties.rb +357 -0
  167. data/lib/aspose_slides_cloud/models/waterfall_chart_data_point.rb +206 -0
  168. data/lib/aspose_slides_cloud/models/waterfall_series.rb +247 -0
  169. data/lib/aspose_slides_cloud/models/xps_export_options.rb +243 -242
  170. data/lib/aspose_slides_cloud/type_registry.rb +320 -0
  171. data/lib/aspose_slides_cloud/version.rb +25 -25
  172. data/spec/api/slides_api_spec.rb +35926 -24406
  173. data/spec/extra/extra_spec.rb +235 -101
  174. data/spec/spec_utils.rb +183 -176
  175. data/testConfig.json +7 -7
  176. data/testRules.json +472 -340
  177. metadata +18 -3
@@ -1,102 +1,236 @@
1
- =begin
2
- Copyright (c) 2019 Aspose Pty Ltd
3
-
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
-
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- SOFTWARE.
21
- =end
22
-
23
- require 'spec_helper'
24
-
25
- describe 'SlidesApiExtra' do
26
- describe 'specific cases' do
27
- it 'multipart request' do
28
- requestParam = AsposeSlidesCloud::PostSlidesPipelineRequest.new
29
- requestParam.pipeline = AsposeSlidesCloud::Pipeline.new
30
- requestParam.pipeline.input = AsposeSlidesCloud::Input.new
31
- requestParam.pipeline.input.template_data = AsposeSlidesCloud::RequestInputFile.new
32
- requestParam.pipeline.input.template_data.type = "Request"
33
- requestParam.pipeline.input.template_data.index = 0
34
- requestParam.pipeline.input.template = AsposeSlidesCloud::RequestInputFile.new
35
- requestParam.pipeline.input.template.type = "Request"
36
- requestParam.pipeline.input.template.index = 1
37
- requestParam.pipeline.tasks = []
38
- requestParam.pipeline.tasks.push(AsposeSlidesCloud::Save.new)
39
- requestParam.pipeline.tasks[0].type = "Save"
40
- requestParam.pipeline.tasks[0].format = "pptx"
41
- requestParam.pipeline.tasks[0].output = AsposeSlidesCloud::OutputFile.new
42
- requestParam.pipeline.tasks[0].output.type = "Response"
43
- requestParam.files = []
44
- requestParam.files.push(File.binread(File.join(AsposeSlidesCloud::SpecUtils::TEST_DATA_PATH, "TemplatingCVDataWithBase64.xml")))
45
- requestParam.files.push(File.binread(File.join(AsposeSlidesCloud::SpecUtils::TEST_DATA_PATH, "TemplateCV.pptx")))
46
- o, c, _h = AsposeSlidesCloud::SpecUtils.api.post_slides_pipeline_with_http_info(requestParam)
47
- expect(c).to eq(200)
48
- expect(o).not_to be(nil)
49
- end
50
-
51
- it 'unauthorized' do
52
- config = JSON.parse(File.read('testConfig.json'))
53
- configuration = AsposeSlidesCloud::Configuration.new
54
- configuration.base_url = config["BaseUrl"]
55
- configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
56
- configuration.app_sid = "invalid"
57
- configuration.app_key = "invalid"
58
- configuration.debugging = config["Debug"]
59
- api = AsposeSlidesCloud::SlidesApi.new(configuration)
60
- begin
61
- o, c, _h = api.get_slides_api_info_with_http_info
62
- fail "An exception expected"
63
- rescue AsposeSlidesCloud::ApiError => e
64
- expect(e.code).to eq(401)
65
- expect(e.response_body).to include("invalid_client")
66
- end
67
- end
68
-
69
- it 'expired token' do
70
- config = JSON.parse(File.read('testConfig.json'))
71
- configuration = AsposeSlidesCloud::Configuration.new
72
- configuration.base_url = config["BaseUrl"]
73
- configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
74
- configuration.app_sid = config["AppSid"]
75
- configuration.app_key = config["AppKey"]
76
- configuration.access_token = "expired.token"
77
- configuration.debugging = config["Debug"]
78
- api = AsposeSlidesCloud::SlidesApi.new(configuration)
79
- o, c, _h = api.get_slides_api_info_with_http_info
80
- expect(c).to eq(200)
81
- expect(o).not_to be(nil)
82
- end
83
-
84
- it 'base shape' do
85
- #requestParam = AsposeSlidesCloud::GetSlideShapeRequest.new
86
- #requestParam.name = "test.ppt"
87
- #requestParam.slide_index = 1
88
- #requestParam.shape_index = 1
89
- #requestParam.password = "password"
90
- #requestParam.folder = "TempSlidesSDK"
91
- #AsposeSlidesCloud::SpecUtils.initialize('GetSlideShape', nil, nil)
92
- #o = AsposeSlidesCloud::SpecUtils.api.get_slide_shape(requestParam)
93
- #expect(o.text).to eq("1")
94
- end
95
-
96
- it 'chart' do
97
- chart = AsposeSlidesCloud::Chart.new
98
- expect(chart.type).to eq("Chart")
99
- expect(chart.shape_type).to eq("Chart")
100
- end
101
- end
1
+ =begin
2
+ Copyright (c) 2019 Aspose Pty Ltd
3
+
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
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
21
+ =end
22
+
23
+ require 'spec_helper'
24
+
25
+ describe 'SlidesApiExtra' do
26
+ describe 'specific cases' do
27
+ it 'multipart request' do
28
+ requestParam = AsposeSlidesCloud::PostSlidesPipelineRequest.new
29
+ requestParam.pipeline = AsposeSlidesCloud::Pipeline.new
30
+ requestParam.pipeline.input = AsposeSlidesCloud::Input.new
31
+ requestParam.pipeline.input.template_data = AsposeSlidesCloud::RequestInputFile.new
32
+ requestParam.pipeline.input.template_data.type = "Request"
33
+ requestParam.pipeline.input.template_data.index = 0
34
+ requestParam.pipeline.input.template = AsposeSlidesCloud::RequestInputFile.new
35
+ requestParam.pipeline.input.template.type = "Request"
36
+ requestParam.pipeline.input.template.index = 1
37
+ requestParam.pipeline.tasks = []
38
+ requestParam.pipeline.tasks.push(AsposeSlidesCloud::Save.new)
39
+ requestParam.pipeline.tasks[0].type = "Save"
40
+ requestParam.pipeline.tasks[0].format = "pptx"
41
+ requestParam.pipeline.tasks[0].output = AsposeSlidesCloud::OutputFile.new
42
+ requestParam.pipeline.tasks[0].output.type = "Response"
43
+ requestParam.files = []
44
+ requestParam.files.push(File.binread(File.join(AsposeSlidesCloud::SpecUtils::TEST_DATA_PATH, "TemplatingCVDataWithBase64.xml")))
45
+ requestParam.files.push(File.binread(File.join(AsposeSlidesCloud::SpecUtils::TEST_DATA_PATH, "TemplateCV.pptx")))
46
+ o, c, _h = AsposeSlidesCloud::SpecUtils.api.post_slides_pipeline_with_http_info(requestParam)
47
+ expect(c).to eq(200)
48
+ expect(o).not_to be(nil)
49
+ end
50
+
51
+ it 'base shape' do
52
+ AsposeSlidesCloud::SpecUtils.initialize('GetSlideShape', nil, nil)
53
+ requestParam = AsposeSlidesCloud::GetSlideShapeRequest.new
54
+ requestParam.name = "test.ppt"
55
+ requestParam.slide_index = 1
56
+ requestParam.shape_index = 1
57
+ requestParam.password = "password"
58
+ requestParam.folder = "TempSlidesSDK"
59
+ o = AsposeSlidesCloud::SpecUtils.api.get_slide_shape(requestParam)
60
+ expect(o.text).to eq("1")
61
+ end
62
+
63
+ it 'chart' do
64
+ chart = AsposeSlidesCloud::Chart.new
65
+ expect(chart.type).to eq("Chart")
66
+ end
67
+
68
+ it 'timeout' do
69
+ #unstable test
70
+ #AsposeSlidesCloud::SpecUtils.initialize('post_slide_save_as', nil, nil)
71
+
72
+ #config = JSON.parse(File.read('testConfig.json'))
73
+ #configuration = AsposeSlidesCloud::Configuration.new
74
+ #configuration.base_url = config["BaseUrl"]
75
+ #configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
76
+ #configuration.app_sid = config["AppSid"]
77
+ #configuration.app_key = config["AppKey"]
78
+ #configuration.debugging = config["Debug"]
79
+ #configuration.timeout = 1
80
+ #api = AsposeSlidesCloud::SlidesApi.new(configuration)
81
+
82
+ #requestParam = AsposeSlidesCloud::PostSlideSaveAsRequest.new
83
+ #requestParam.name = "test.ppt"
84
+ #requestParam.slide_index = 1
85
+ #requestParam.password = "password"
86
+ #requestParam.folder = "TempSlidesSDK"
87
+ #requestParam.format = "svg"
88
+ #api.post_slide_save_as(requestParam)
89
+ end
90
+
91
+ it 'nullable properties' do
92
+ folderName = "TempSlidesSDK"
93
+ fileName = "placeholders.pptx"
94
+ password = "password"
95
+ min1 = 44.3
96
+ min2 = 12
97
+ max1 = 104.3
98
+ max2 = 87
99
+ AsposeSlidesCloud::SpecUtils.initialize("no_method", "no_property", nil)
100
+ requestParam = AsposeSlidesCloud::CopyFileRequest.new
101
+ requestParam.src_path = "TempTests/" + fileName
102
+ requestParam.dest_path = folderName + "/" + fileName
103
+ AsposeSlidesCloud::SpecUtils.api.copy_file(requestParam)
104
+
105
+ postRequest = AsposeSlidesCloud::PostAddNewShapeRequest.new
106
+ postRequest.name = fileName
107
+ postRequest.folder = folderName
108
+ postRequest.password = password
109
+ postRequest.slide_index = 1
110
+ postRequest.dto = AsposeSlidesCloud::Chart.new
111
+ postRequest.dto.chart_type = "Line"
112
+ postRequest.dto.width = 400.0
113
+ postRequest.dto.height = 300.0
114
+ postRequest.dto.title = AsposeSlidesCloud::ChartTitle.new
115
+ postRequest.dto.title.has_title = true
116
+ postRequest.dto.title.text = "MyTitle"
117
+ postRequest.dto.series = []
118
+ postRequest.dto.series.push(AsposeSlidesCloud::OneValueSeries.new)
119
+ postRequest.dto.series[0].type = "ClusteredColumn"
120
+ postRequest.dto.series[0].data_point_type = "OneValue"
121
+ postRequest.dto.series[0].name = "Series1"
122
+ postRequest.dto.series[0].data_points = []
123
+ postRequest.dto.series[0].data_points.push(AsposeSlidesCloud::OneValueChartDataPoint.new)
124
+ postRequest.dto.series[0].data_points[0].value = 40.0
125
+ postRequest.dto.series[0].data_points.push(AsposeSlidesCloud::OneValueChartDataPoint.new)
126
+ postRequest.dto.series[0].data_points[1].value = 50.0
127
+ postRequest.dto.axes = AsposeSlidesCloud::Axes.new
128
+ postRequest.dto.axes.horizontal_axis = AsposeSlidesCloud::Axis.new
129
+ postRequest.dto.axes.horizontal_axis.is_automatic_min_value = false
130
+ postRequest.dto.axes.horizontal_axis.min_value = min1
131
+ postRequest.dto.axes.horizontal_axis.is_automatic_max_value = false
132
+ postRequest.dto.axes.horizontal_axis.max_value = max1
133
+ AsposeSlidesCloud::SpecUtils.api.post_add_new_shape(postRequest)
134
+
135
+ getRequest = AsposeSlidesCloud::GetSlideShapeRequest.new
136
+ getRequest.name = fileName
137
+ getRequest.folder = folderName
138
+ getRequest.password = password
139
+ getRequest.slide_index = 1
140
+ getRequest.shape_index = 4
141
+ result = AsposeSlidesCloud::SpecUtils.api.get_slide_shape(getRequest)
142
+ expect(result.axes.horizontal_axis.min_value).to eq(min1)
143
+ expect(result.axes.horizontal_axis.max_value).to eq(max1)
144
+
145
+ putRequest = AsposeSlidesCloud::PutSlideShapeInfoRequest.new
146
+ putRequest.name = fileName
147
+ putRequest.folder = folderName
148
+ putRequest.password = password
149
+ putRequest.slide_index = 1
150
+ putRequest.shape_index = 4
151
+ putRequest.dto = AsposeSlidesCloud::Chart.new
152
+ putRequest.dto.axes = AsposeSlidesCloud::Axes.new
153
+ putRequest.dto.axes.horizontal_axis = AsposeSlidesCloud::Axis.new
154
+ putRequest.dto.axes.horizontal_axis.min_value = min2
155
+ AsposeSlidesCloud::SpecUtils.api.put_slide_shape_info(putRequest)
156
+
157
+ result = AsposeSlidesCloud::SpecUtils.api.get_slide_shape(getRequest)
158
+ expect(result.axes.horizontal_axis.min_value).to eq(min2)
159
+ expect(result.axes.horizontal_axis.max_value).to eq(max1)
160
+
161
+ putRequest.dto.axes.horizontal_axis = AsposeSlidesCloud::Axis.new
162
+ putRequest.dto.axes.horizontal_axis.max_value = max2
163
+ AsposeSlidesCloud::SpecUtils.api.put_slide_shape_info(putRequest)
164
+
165
+ result = AsposeSlidesCloud::SpecUtils.api.get_slide_shape(getRequest)
166
+ expect(result.axes.horizontal_axis.min_value).to eq(min2)
167
+ expect(result.axes.horizontal_axis.max_value).to eq(max2)
168
+ end
169
+ end
170
+
171
+ describe 'authentication' do
172
+ it 'good auth' do
173
+ config = JSON.parse(File.read('testConfig.json'))
174
+ configuration = AsposeSlidesCloud::Configuration.new
175
+ configuration.base_url = config["BaseUrl"]
176
+ configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
177
+ configuration.app_sid = config["AppSid"]
178
+ configuration.app_key = config["AppKey"]
179
+ configuration.debugging = config["Debug"]
180
+ api = AsposeSlidesCloud::SlidesApi.new(configuration)
181
+ o, c, _h = api.get_slides_api_info_with_http_info
182
+ expect(c).to eq(200)
183
+ expect(o).not_to be(nil)
184
+ end
185
+
186
+ it 'bad auth' do
187
+ config = JSON.parse(File.read('testConfig.json'))
188
+ configuration = AsposeSlidesCloud::Configuration.new
189
+ configuration.base_url = config["BaseUrl"]
190
+ configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
191
+ configuration.app_sid = "invalid"
192
+ configuration.app_key = config["AppKey"]
193
+ configuration.debugging = config["Debug"]
194
+ api = AsposeSlidesCloud::SlidesApi.new(configuration)
195
+ begin
196
+ o, c, _h = api.get_slides_api_info_with_http_info
197
+ fail "An exception expected"
198
+ rescue AsposeSlidesCloud::ApiError => e
199
+ expect(e.code).to eq(401)
200
+ expect(e.response_body).to include("invalid_client")
201
+ end
202
+ end
203
+
204
+ it 'good token' do
205
+ config = JSON.parse(File.read('testConfig.json'))
206
+ configuration = AsposeSlidesCloud::Configuration.new
207
+ configuration.base_url = config["BaseUrl"]
208
+ configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
209
+ configuration.app_sid = config["AppSid"]
210
+ configuration.app_key = config["AppKey"]
211
+ configuration.debugging = config["Debug"]
212
+ api = AsposeSlidesCloud::SlidesApi.new(configuration)
213
+ api.get_slides_api_info_with_http_info
214
+ configuration.app_sid = "invalid"
215
+ api = AsposeSlidesCloud::SlidesApi.new(configuration)
216
+ o, c, _h = api.get_slides_api_info_with_http_info
217
+ expect(c).to eq(200)
218
+ expect(o).not_to be(nil)
219
+ end
220
+
221
+ it 'bad token' do
222
+ config = JSON.parse(File.read('testConfig.json'))
223
+ configuration = AsposeSlidesCloud::Configuration.new
224
+ configuration.base_url = config["BaseUrl"]
225
+ configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
226
+ configuration.app_sid = config["AppSid"]
227
+ configuration.app_key = config["AppKey"]
228
+ configuration.access_token = "expired.token"
229
+ configuration.debugging = config["Debug"]
230
+ api = AsposeSlidesCloud::SlidesApi.new(configuration)
231
+ o, c, _h = api.get_slides_api_info_with_http_info
232
+ expect(c).to eq(200)
233
+ expect(o).not_to be(nil)
234
+ end
235
+ end
102
236
  end
@@ -1,176 +1,183 @@
1
- =begin
2
- Copyright (c) 2019 Aspose Pty Ltd
3
-
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
-
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- SOFTWARE.
21
- =end
22
-
23
- module AsposeSlidesCloud
24
- class SpecUtils
25
- def self.initialize(method, name, value)
26
- if !@@is_initialized
27
- download_request = AsposeSlidesCloud::DownloadFileRequest.new
28
- download_request.path = "TempTests/version.txt"
29
- version = SpecUtils.api.download_file(download_request)
30
- if version != EXPECTED_TEST_DATA_VERSION
31
- Dir.entries(TEST_DATA_PATH).each { |f|
32
- if !File.directory? File.join(TEST_DATA_PATH, f)
33
- fd = File.binread(File.join(TEST_DATA_PATH, f))
34
- upload_request = AsposeSlidesCloud::UploadFileRequest.new
35
- upload_request.file = fd
36
- upload_request.path = "TempTests/" + f
37
- SpecUtils.api.upload_file(upload_request)
38
- end
39
- }
40
- upload_request = AsposeSlidesCloud::UploadFileRequest.new
41
- upload_request.file = EXPECTED_TEST_DATA_VERSION
42
- upload_request.path = "TempTests/version.txt"
43
- SpecUtils.api.upload_file(upload_request)
44
- end
45
- @@is_initialized = true
46
- end
47
- files = Hash.new
48
- SpecUtils.test_rules["Files"].each do |rule|
49
- if SpecUtils.good_rule?(rule, name, method)
50
- actual_name = SpecUtils.untemplatize(rule["File"], value)
51
- path = "TempSlidesSDK"
52
- if rule.key?("Folder")
53
- path = SpecUtils.untemplatize(rule["Folder"], value)
54
- end
55
- path = path + "/" + actual_name
56
- files[path] = rule
57
- rule["ActualName"] = actual_name
58
- end
59
- end
60
- files.each do |path, rule|
61
- if rule["Action"] == "Put"
62
- copy_request = AsposeSlidesCloud::CopyFileRequest.new
63
- copy_request.src_path = "TempTests/" + rule['ActualName']
64
- copy_request.dest_path = path
65
- SpecUtils.api.copy_file(copy_request)
66
- elsif rule["Action"] == "Delete"
67
- delete_request = AsposeSlidesCloud::DeleteFileRequest.new
68
- delete_request.path = path
69
- SpecUtils.api.delete_file(delete_request)
70
- end
71
- end
72
- end
73
-
74
- def self.get_param_value(name, method, type)
75
- if type == 'File'
76
- return File.binread(File.join(TEST_DATA_PATH, "test.ppt"))
77
- end
78
- value = "test" + name
79
- SpecUtils.test_rules["Values"].each do |rule|
80
- if SpecUtils.good_rule?(rule, name, method) and rule.key?("Value")
81
- value = rule["Value"]
82
- end
83
- end
84
- value
85
- end
86
-
87
- def self.invalidize_param_value(name, method, value, type)
88
- if type == 'File'
89
- return nil
90
- end
91
- invalid_value = nil
92
- SpecUtils.test_rules["Values"].each do |rule|
93
- if SpecUtils.good_rule?(rule, name, method) and rule.key?("InvalidValue")
94
- invalid_value = rule["InvalidValue"]
95
- end
96
- end
97
- SpecUtils.untemplatize(invalid_value, value)
98
- end
99
-
100
- def self.get_expected_error(method, name, value)
101
- code = 0
102
- message = "Unexpeceted message"
103
- SpecUtils.test_rules["Results"].each do |rule|
104
- if SpecUtils.good_rule?(rule, name, method)
105
- if rule.key?("Code")
106
- code = rule["Code"]
107
- end
108
- if rule.key?("Message")
109
- message = SpecUtils.untemplatize(rule["Message"], value)
110
- end
111
- end
112
- end
113
- return code, message
114
- end
115
-
116
- def self.no_exception?(method, name)
117
- SpecUtils.test_rules["OKToNotFail"].each do |rule|
118
- return true
119
- end
120
- return false
121
- end
122
-
123
- def self.good_rule?(rule, name, method)
124
- (not rule.key?("Language") or rule["Language"].casecmp("Ruby") == 0) \
125
- and (not rule.key?("Invalid") or ((name != nil) == rule["Invalid"])) \
126
- and (not rule.key?("Parameter") or rule["Parameter"].casecmp(name) == 0) \
127
- and (not rule.key?("Method") or rule["Method"].casecmp(method) == 0)
128
- end
129
-
130
- def self.untemplatize(template, value)
131
- if template == nil
132
- value
133
- else
134
- result = template
135
- if template.is_a? String and template.match?("%v")
136
- result = "" + template
137
- if value != nil
138
- result["%v"] = value.to_s
139
- else
140
- result["%v"] = ""
141
- end
142
- end
143
- result
144
- end
145
- end
146
-
147
- def self.test_rules
148
- unless @@test_rules
149
- @@test_rules = JSON.parse(File.read('testRules.json'))
150
- end
151
- @@test_rules
152
- end
153
-
154
- @@test_rules = nil
155
-
156
- def self.api
157
- unless @@api
158
- config = JSON.parse(File.read('testConfig.json'))
159
- configuration = AsposeSlidesCloud::Configuration.new
160
- configuration.base_url = config["BaseUrl"]
161
- configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
162
- configuration.app_sid = config["AppSid"]
163
- configuration.app_key = config["AppKey"]
164
- configuration.debugging = config["Debug"]
165
- @@api = AsposeSlidesCloud::SlidesApi.new(configuration)
166
- end
167
- @@api
168
- end
169
-
170
- @@api = nil
171
- @@is_initialized = false
172
-
173
- TEST_DATA_PATH = "TestData"
174
- EXPECTED_TEST_DATA_VERSION = "1"
175
- end
176
- end
1
+ =begin
2
+ Copyright (c) 2019 Aspose Pty Ltd
3
+
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
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
21
+ =end
22
+
23
+ module AsposeSlidesCloud
24
+ class SpecUtils
25
+ def self.initialize(method, name, value)
26
+ if !@@is_initialized
27
+ download_request = AsposeSlidesCloud::DownloadFileRequest.new
28
+ download_request.path = "TempTests/version.txt"
29
+ version = ""
30
+ begin
31
+ version = SpecUtils.api.download_file(download_request)
32
+ rescue AsposeSlidesCloud::ApiError => e
33
+ if e.code != 404
34
+ fail "Could not read from storage"
35
+ end
36
+ end
37
+ if version != EXPECTED_TEST_DATA_VERSION
38
+ Dir.entries(TEST_DATA_PATH).each { |f|
39
+ if !File.directory? File.join(TEST_DATA_PATH, f)
40
+ fd = File.binread(File.join(TEST_DATA_PATH, f))
41
+ upload_request = AsposeSlidesCloud::UploadFileRequest.new
42
+ upload_request.file = fd
43
+ upload_request.path = "TempTests/" + f
44
+ SpecUtils.api.upload_file(upload_request)
45
+ end
46
+ }
47
+ upload_request = AsposeSlidesCloud::UploadFileRequest.new
48
+ upload_request.file = EXPECTED_TEST_DATA_VERSION
49
+ upload_request.path = "TempTests/version.txt"
50
+ SpecUtils.api.upload_file(upload_request)
51
+ end
52
+ @@is_initialized = true
53
+ end
54
+ files = Hash.new
55
+ SpecUtils.test_rules["Files"].each do |rule|
56
+ if SpecUtils.good_rule?(rule, name, method)
57
+ actual_name = SpecUtils.untemplatize(rule["File"], value)
58
+ path = "TempSlidesSDK"
59
+ if rule.key?("Folder")
60
+ path = SpecUtils.untemplatize(rule["Folder"], value)
61
+ end
62
+ path = path + "/" + actual_name
63
+ files[path] = rule
64
+ rule["ActualName"] = actual_name
65
+ end
66
+ end
67
+ files.each do |path, rule|
68
+ if rule["Action"] == "Put"
69
+ copy_request = AsposeSlidesCloud::CopyFileRequest.new
70
+ copy_request.src_path = "TempTests/" + rule['ActualName']
71
+ copy_request.dest_path = path
72
+ SpecUtils.api.copy_file(copy_request)
73
+ elsif rule["Action"] == "Delete"
74
+ delete_request = AsposeSlidesCloud::DeleteFileRequest.new
75
+ delete_request.path = path
76
+ SpecUtils.api.delete_file(delete_request)
77
+ end
78
+ end
79
+ end
80
+
81
+ def self.get_param_value(name, method, type)
82
+ if type == 'File'
83
+ return File.binread(File.join(TEST_DATA_PATH, "test.ppt"))
84
+ end
85
+ value = "test" + name
86
+ SpecUtils.test_rules["Values"].each do |rule|
87
+ if SpecUtils.good_rule?(rule, name, method) and rule.key?("Value")
88
+ value = rule["Value"]
89
+ end
90
+ end
91
+ value
92
+ end
93
+
94
+ def self.invalidize_param_value(name, method, value, type)
95
+ if type == 'File'
96
+ return nil
97
+ end
98
+ invalid_value = nil
99
+ SpecUtils.test_rules["Values"].each do |rule|
100
+ if SpecUtils.good_rule?(rule, name, method) and rule.key?("InvalidValue")
101
+ invalid_value = rule["InvalidValue"]
102
+ end
103
+ end
104
+ SpecUtils.untemplatize(invalid_value, value)
105
+ end
106
+
107
+ def self.get_expected_error(method, name, value)
108
+ code = 0
109
+ message = "Unexpeceted message"
110
+ SpecUtils.test_rules["Results"].each do |rule|
111
+ if SpecUtils.good_rule?(rule, name, method)
112
+ if rule.key?("Code")
113
+ code = rule["Code"]
114
+ end
115
+ if rule.key?("Message")
116
+ message = SpecUtils.untemplatize(rule["Message"], value)
117
+ end
118
+ end
119
+ end
120
+ return code, message
121
+ end
122
+
123
+ def self.no_exception?(method, name)
124
+ SpecUtils.test_rules["OKToNotFail"].each do |rule|
125
+ return true
126
+ end
127
+ return false
128
+ end
129
+
130
+ def self.good_rule?(rule, name, method)
131
+ (not rule.key?("Language") or rule["Language"].casecmp("Ruby") == 0) \
132
+ and (not rule.key?("Invalid") or ((name != nil) == rule["Invalid"])) \
133
+ and (not rule.key?("Parameter") or rule["Parameter"].casecmp(name) == 0) \
134
+ and (not rule.key?("Method") or rule["Method"].casecmp(method) == 0)
135
+ end
136
+
137
+ def self.untemplatize(template, value)
138
+ if template == nil
139
+ value
140
+ else
141
+ result = template
142
+ if template.is_a? String and template.match?("%v")
143
+ result = "" + template
144
+ if value != nil
145
+ result["%v"] = value.to_s
146
+ else
147
+ result["%v"] = ""
148
+ end
149
+ end
150
+ result
151
+ end
152
+ end
153
+
154
+ def self.test_rules
155
+ unless @@test_rules
156
+ @@test_rules = JSON.parse(File.read('testRules.json'))
157
+ end
158
+ @@test_rules
159
+ end
160
+
161
+ @@test_rules = nil
162
+
163
+ def self.api
164
+ unless @@api
165
+ config = JSON.parse(File.read('testConfig.json'))
166
+ configuration = AsposeSlidesCloud::Configuration.new
167
+ configuration.base_url = config["BaseUrl"]
168
+ configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
169
+ configuration.app_sid = config["AppSid"]
170
+ configuration.app_key = config["AppKey"]
171
+ configuration.debugging = config["Debug"]
172
+ @@api = AsposeSlidesCloud::SlidesApi.new(configuration)
173
+ end
174
+ @@api
175
+ end
176
+
177
+ @@api = nil
178
+ @@is_initialized = false
179
+
180
+ TEST_DATA_PATH = "TestData"
181
+ EXPECTED_TEST_DATA_VERSION = "1"
182
+ end
183
+ end