aspose_words_cloud 20.6.0 → 20.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (600) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose_words_cloud.rb +443 -290
  3. data/lib/aspose_words_cloud/api/words_api.rb +11506 -19429
  4. data/lib/aspose_words_cloud/api_client.rb +411 -412
  5. data/lib/aspose_words_cloud/api_error.rb +58 -58
  6. data/lib/aspose_words_cloud/configuration.rb +153 -157
  7. data/lib/aspose_words_cloud/models/available_fonts_response.rb +237 -243
  8. data/lib/aspose_words_cloud/models/bmp_save_options_data.rb +543 -532
  9. data/lib/aspose_words_cloud/models/bookmark.rb +221 -226
  10. data/lib/aspose_words_cloud/models/bookmark_data.rb +211 -217
  11. data/lib/aspose_words_cloud/models/bookmark_response.rb +211 -216
  12. data/lib/aspose_words_cloud/models/bookmarks.rb +213 -218
  13. data/lib/aspose_words_cloud/models/bookmarks_outline_level_data.rb +211 -217
  14. data/lib/aspose_words_cloud/models/bookmarks_response.rb +211 -216
  15. data/lib/aspose_words_cloud/models/border.rb +318 -318
  16. data/lib/aspose_words_cloud/models/border_response.rb +211 -216
  17. data/lib/aspose_words_cloud/models/borders_collection.rb +213 -218
  18. data/lib/aspose_words_cloud/models/borders_response.rb +211 -216
  19. data/lib/aspose_words_cloud/models/classification_response.rb +233 -239
  20. data/lib/aspose_words_cloud/models/classification_result.rb +211 -217
  21. data/lib/aspose_words_cloud/models/comment.rb +271 -273
  22. data/lib/aspose_words_cloud/models/comment_base.rb +54 -58
  23. data/lib/aspose_words_cloud/models/comment_insert.rb +54 -58
  24. data/lib/aspose_words_cloud/models/comment_link.rb +201 -206
  25. data/lib/aspose_words_cloud/models/comment_response.rb +211 -216
  26. data/lib/aspose_words_cloud/models/comment_update.rb +54 -58
  27. data/lib/aspose_words_cloud/models/comments_collection.rb +213 -218
  28. data/lib/aspose_words_cloud/models/comments_response.rb +211 -216
  29. data/lib/aspose_words_cloud/models/compare_data.rb +231 -236
  30. data/lib/aspose_words_cloud/models/compare_options.rb +62 -64
  31. data/lib/aspose_words_cloud/models/csv_data_load_options.rb +45 -51
  32. data/lib/aspose_words_cloud/models/doc_save_options_data.rb +376 -374
  33. data/lib/aspose_words_cloud/models/document.rb +294 -295
  34. data/lib/aspose_words_cloud/models/document_entry.rb +211 -217
  35. data/lib/aspose_words_cloud/models/document_entry_list.rb +213 -209
  36. data/lib/aspose_words_cloud/models/document_position.rb +211 -216
  37. data/lib/aspose_words_cloud/models/document_properties.rb +213 -218
  38. data/lib/aspose_words_cloud/models/document_properties_response.rb +211 -216
  39. data/lib/aspose_words_cloud/models/document_property.rb +232 -236
  40. data/lib/aspose_words_cloud/models/document_property_base.rb +25 -31
  41. data/lib/aspose_words_cloud/models/document_property_create_or_update.rb +25 -31
  42. data/lib/aspose_words_cloud/models/document_property_response.rb +211 -216
  43. data/lib/aspose_words_cloud/models/document_response.rb +211 -216
  44. data/lib/aspose_words_cloud/models/document_stat_data.rb +243 -248
  45. data/lib/aspose_words_cloud/models/downsample_options_data.rb +221 -227
  46. data/lib/aspose_words_cloud/models/drawing_object.rb +386 -385
  47. data/lib/aspose_words_cloud/models/drawing_object_collection.rb +213 -218
  48. data/lib/aspose_words_cloud/models/drawing_object_insert.rb +53 -54
  49. data/lib/aspose_words_cloud/models/drawing_object_link.rb +211 -216
  50. data/lib/aspose_words_cloud/models/drawing_object_response.rb +211 -216
  51. data/lib/aspose_words_cloud/models/drawing_object_update.rb +49 -51
  52. data/lib/aspose_words_cloud/models/drawing_objects_response.rb +211 -216
  53. data/lib/aspose_words_cloud/models/emf_save_options_data.rb +543 -532
  54. data/lib/aspose_words_cloud/models/epub_save_options_data.rb +793 -782
  55. data/lib/aspose_words_cloud/models/error.rb +231 -236
  56. data/lib/aspose_words_cloud/models/error_details.rb +211 -217
  57. data/lib/aspose_words_cloud/models/field.rb +241 -246
  58. data/lib/aspose_words_cloud/models/field_base.rb +26 -32
  59. data/lib/aspose_words_cloud/models/field_collection.rb +213 -218
  60. data/lib/aspose_words_cloud/models/field_insert.rb +26 -32
  61. data/lib/aspose_words_cloud/models/field_link.rb +221 -226
  62. data/lib/aspose_words_cloud/models/field_names.rb +213 -218
  63. data/lib/aspose_words_cloud/models/field_names_response.rb +211 -216
  64. data/lib/aspose_words_cloud/models/field_response.rb +211 -216
  65. data/lib/aspose_words_cloud/models/field_update.rb +26 -32
  66. data/lib/aspose_words_cloud/models/fields_response.rb +211 -216
  67. data/lib/aspose_words_cloud/models/file_link.rb +231 -237
  68. data/lib/aspose_words_cloud/models/files_list.rb +203 -209
  69. data/lib/aspose_words_cloud/models/files_upload_result.rb +215 -221
  70. data/lib/aspose_words_cloud/models/fixed_page_save_options_data.rb +407 -403
  71. data/lib/aspose_words_cloud/models/font.rb +675 -671
  72. data/lib/aspose_words_cloud/models/font_info.rb +231 -237
  73. data/lib/aspose_words_cloud/models/font_response.rb +211 -216
  74. data/lib/aspose_words_cloud/models/footnote.rb +303 -301
  75. data/lib/aspose_words_cloud/models/footnote_base.rb +41 -41
  76. data/lib/aspose_words_cloud/models/footnote_collection.rb +213 -218
  77. data/lib/aspose_words_cloud/models/footnote_insert.rb +41 -41
  78. data/lib/aspose_words_cloud/models/footnote_link.rb +211 -216
  79. data/lib/aspose_words_cloud/models/footnote_response.rb +211 -216
  80. data/lib/aspose_words_cloud/models/footnote_update.rb +41 -41
  81. data/lib/aspose_words_cloud/models/footnotes_response.rb +211 -216
  82. data/lib/aspose_words_cloud/models/footnotes_stat_data.rb +211 -217
  83. data/lib/aspose_words_cloud/models/form_field.rb +301 -306
  84. data/lib/aspose_words_cloud/models/form_field_checkbox.rb +331 -336
  85. data/lib/aspose_words_cloud/models/form_field_collection.rb +213 -218
  86. data/lib/aspose_words_cloud/models/form_field_drop_down.rb +323 -328
  87. data/lib/aspose_words_cloud/models/form_field_response.rb +211 -216
  88. data/lib/aspose_words_cloud/models/form_field_text_input.rb +382 -383
  89. data/lib/aspose_words_cloud/models/form_fields_response.rb +211 -216
  90. data/lib/aspose_words_cloud/models/gif_save_options_data.rb +543 -532
  91. data/lib/aspose_words_cloud/models/graphics_quality_options_data.rb +356 -357
  92. data/lib/aspose_words_cloud/models/header_footer.rb +284 -283
  93. data/lib/aspose_words_cloud/models/header_footer_link.rb +252 -253
  94. data/lib/aspose_words_cloud/models/header_footer_link_collection.rb +213 -218
  95. data/lib/aspose_words_cloud/models/header_footer_response.rb +211 -216
  96. data/lib/aspose_words_cloud/models/header_footers_response.rb +211 -216
  97. data/lib/aspose_words_cloud/models/html_fixed_save_options_data.rb +551 -543
  98. data/lib/aspose_words_cloud/models/html_save_options_data.rb +783 -772
  99. data/lib/aspose_words_cloud/models/hyperlink.rb +221 -226
  100. data/lib/aspose_words_cloud/models/hyperlink_response.rb +211 -216
  101. data/lib/aspose_words_cloud/models/hyperlinks.rb +213 -218
  102. data/lib/aspose_words_cloud/models/hyperlinks_response.rb +211 -216
  103. data/lib/aspose_words_cloud/models/image_save_options_data.rb +543 -532
  104. data/lib/aspose_words_cloud/models/jpeg_save_options_data.rb +543 -532
  105. data/lib/aspose_words_cloud/models/link.rb +232 -237
  106. data/lib/aspose_words_cloud/models/link_element.rb +201 -206
  107. data/lib/aspose_words_cloud/models/list_format.rb +30 -35
  108. data/lib/aspose_words_cloud/models/list_format_update.rb +38 -44
  109. data/lib/aspose_words_cloud/models/list_info.rb +36 -39
  110. data/lib/aspose_words_cloud/models/list_insert.rb +27 -29
  111. data/lib/aspose_words_cloud/models/list_level.rb +43 -42
  112. data/lib/aspose_words_cloud/models/list_level_update.rb +91 -93
  113. data/lib/aspose_words_cloud/models/list_levels.rb +30 -35
  114. data/lib/aspose_words_cloud/models/list_response.rb +28 -33
  115. data/lib/aspose_words_cloud/models/list_update.rb +25 -31
  116. data/lib/aspose_words_cloud/models/lists.rb +31 -36
  117. data/lib/aspose_words_cloud/models/lists_response.rb +28 -33
  118. data/lib/aspose_words_cloud/models/load_web_document_data.rb +211 -216
  119. data/lib/aspose_words_cloud/models/markdown_save_options_data.rb +419 -0
  120. data/lib/aspose_words_cloud/models/metafile_rendering_options_data.rb +242 -247
  121. data/lib/aspose_words_cloud/models/mhtml_save_options_data.rb +793 -782
  122. data/lib/aspose_words_cloud/models/modification_operation_result.rb +211 -215
  123. data/lib/aspose_words_cloud/models/node_link.rb +211 -216
  124. data/lib/aspose_words_cloud/models/odt_save_options_data.rb +391 -390
  125. data/lib/aspose_words_cloud/models/office_math_link.rb +211 -216
  126. data/lib/aspose_words_cloud/models/office_math_object.rb +324 -324
  127. data/lib/aspose_words_cloud/models/office_math_object_response.rb +211 -216
  128. data/lib/aspose_words_cloud/models/office_math_objects_collection.rb +213 -218
  129. data/lib/aspose_words_cloud/models/office_math_objects_response.rb +211 -216
  130. data/lib/aspose_words_cloud/models/ooxml_save_options_data.rb +390 -390
  131. data/lib/aspose_words_cloud/models/optimization_options.rb +242 -0
  132. data/lib/aspose_words_cloud/models/outline_options_data.rb +253 -259
  133. data/lib/aspose_words_cloud/models/page_number.rb +231 -237
  134. data/lib/aspose_words_cloud/models/page_setup.rb +646 -645
  135. data/lib/aspose_words_cloud/models/page_stat_data.rb +231 -236
  136. data/lib/aspose_words_cloud/models/paragraph.rb +223 -228
  137. data/lib/aspose_words_cloud/models/paragraph_format.rb +587 -576
  138. data/lib/aspose_words_cloud/models/paragraph_format_base.rb +567 -0
  139. data/lib/aspose_words_cloud/models/paragraph_format_response.rb +211 -216
  140. data/lib/aspose_words_cloud/models/paragraph_format_update.rb +567 -0
  141. data/lib/aspose_words_cloud/models/paragraph_insert.rb +201 -207
  142. data/lib/aspose_words_cloud/models/paragraph_link.rb +221 -226
  143. data/lib/aspose_words_cloud/models/paragraph_link_collection.rb +213 -218
  144. data/lib/aspose_words_cloud/models/paragraph_link_collection_response.rb +211 -216
  145. data/lib/aspose_words_cloud/models/paragraph_list_format_response.rb +28 -33
  146. data/lib/aspose_words_cloud/models/paragraph_response.rb +211 -216
  147. data/lib/aspose_words_cloud/models/pcl_save_options_data.rb +427 -423
  148. data/lib/aspose_words_cloud/models/pdf_digital_signature_details_data.rb +241 -247
  149. data/lib/aspose_words_cloud/models/pdf_encryption_details_data.rb +231 -237
  150. data/lib/aspose_words_cloud/models/pdf_save_options_data.rb +677 -665
  151. data/lib/aspose_words_cloud/models/png_save_options_data.rb +543 -532
  152. data/lib/aspose_words_cloud/models/preferred_width.rb +252 -254
  153. data/lib/aspose_words_cloud/models/protection_data.rb +201 -207
  154. data/lib/aspose_words_cloud/models/protection_data_response.rb +221 -225
  155. data/lib/aspose_words_cloud/models/protection_request.rb +221 -227
  156. data/lib/aspose_words_cloud/models/ps_save_options_data.rb +417 -413
  157. data/lib/aspose_words_cloud/models/range_document.rb +201 -207
  158. data/lib/aspose_words_cloud/models/range_text_response.rb +211 -217
  159. data/lib/aspose_words_cloud/models/replace_range.rb +252 -254
  160. data/lib/aspose_words_cloud/models/replace_text_parameters.rb +241 -247
  161. data/lib/aspose_words_cloud/models/replace_text_response.rb +221 -226
  162. data/lib/aspose_words_cloud/models/report_build_options.rb +25 -5
  163. data/lib/aspose_words_cloud/models/report_engine_settings.rb +50 -51
  164. data/lib/aspose_words_cloud/models/requests/accept_all_revisions_request.rb +68 -0
  165. data/lib/aspose_words_cloud/models/requests/append_document_request.rb +83 -0
  166. data/lib/aspose_words_cloud/models/requests/apply_style_to_document_element_request.rb +88 -0
  167. data/lib/aspose_words_cloud/models/requests/build_report_online_request.rb +58 -0
  168. data/lib/aspose_words_cloud/models/requests/build_report_request.rb +78 -0
  169. data/lib/aspose_words_cloud/models/requests/classify_document_request.rb +73 -0
  170. data/lib/aspose_words_cloud/models/requests/classify_request.rb +48 -0
  171. data/lib/aspose_words_cloud/models/requests/compare_document_request.rb +73 -0
  172. data/lib/aspose_words_cloud/models/requests/convert_document_request.rb +68 -0
  173. data/lib/aspose_words_cloud/models/requests/copy_file_request.rb +63 -0
  174. data/lib/aspose_words_cloud/models/requests/copy_folder_request.rb +58 -0
  175. data/lib/aspose_words_cloud/models/requests/copy_style_request.rb +83 -0
  176. data/lib/aspose_words_cloud/models/requests/create_document_request.rb +53 -0
  177. data/lib/aspose_words_cloud/models/requests/create_folder_request.rb +48 -0
  178. data/lib/aspose_words_cloud/models/requests/create_or_update_document_property_request.rb +88 -0
  179. data/lib/aspose_words_cloud/models/requests/delete_all_paragraph_tab_stops_request.rb +78 -0
  180. data/lib/aspose_words_cloud/models/requests/delete_border_request.rb +88 -0
  181. data/lib/aspose_words_cloud/models/requests/delete_borders_request.rb +83 -0
  182. data/lib/aspose_words_cloud/models/requests/delete_comment_request.rb +83 -0
  183. data/lib/aspose_words_cloud/models/requests/delete_document_property_request.rb +83 -0
  184. data/lib/aspose_words_cloud/models/requests/delete_drawing_object_request.rb +88 -0
  185. data/lib/aspose_words_cloud/models/requests/delete_field_request.rb +88 -0
  186. data/lib/aspose_words_cloud/models/requests/delete_fields_request.rb +83 -0
  187. data/lib/aspose_words_cloud/models/requests/delete_file_request.rb +53 -0
  188. data/lib/aspose_words_cloud/models/requests/delete_folder_request.rb +53 -0
  189. data/lib/aspose_words_cloud/models/requests/delete_footnote_request.rb +88 -0
  190. data/lib/aspose_words_cloud/models/requests/delete_form_field_request.rb +88 -0
  191. data/lib/aspose_words_cloud/models/requests/delete_header_footer_request.rb +88 -0
  192. data/lib/aspose_words_cloud/models/requests/delete_headers_footers_request.rb +88 -0
  193. data/lib/aspose_words_cloud/models/requests/delete_macros_request.rb +78 -0
  194. data/lib/aspose_words_cloud/models/requests/delete_office_math_object_request.rb +88 -0
  195. data/lib/aspose_words_cloud/models/requests/delete_paragraph_list_format_request.rb +88 -0
  196. data/lib/aspose_words_cloud/models/requests/delete_paragraph_request.rb +88 -0
  197. data/lib/aspose_words_cloud/models/requests/delete_paragraph_tab_stop_request.rb +83 -0
  198. data/lib/aspose_words_cloud/models/requests/delete_run_request.rb +88 -0
  199. data/lib/aspose_words_cloud/models/requests/delete_section_request.rb +83 -0
  200. data/lib/aspose_words_cloud/models/requests/delete_table_cell_request.rb +88 -0
  201. data/lib/aspose_words_cloud/models/requests/delete_table_request.rb +88 -0
  202. data/lib/aspose_words_cloud/models/requests/delete_table_row_request.rb +88 -0
  203. data/lib/aspose_words_cloud/models/requests/delete_watermark_request.rb +78 -0
  204. data/lib/aspose_words_cloud/models/requests/download_file_request.rb +53 -0
  205. data/lib/aspose_words_cloud/models/requests/execute_mail_merge_online_request.rb +63 -0
  206. data/lib/aspose_words_cloud/models/requests/execute_mail_merge_request.rb +93 -0
  207. data/lib/aspose_words_cloud/models/requests/get_available_fonts_request.rb +43 -0
  208. data/lib/aspose_words_cloud/models/requests/get_bookmark_by_name_request.rb +68 -0
  209. data/lib/aspose_words_cloud/models/requests/get_bookmarks_request.rb +63 -0
  210. data/lib/aspose_words_cloud/models/requests/get_border_request.rb +73 -0
  211. data/lib/aspose_words_cloud/models/requests/get_borders_request.rb +68 -0
  212. data/lib/aspose_words_cloud/models/requests/get_comment_request.rb +68 -0
  213. data/lib/aspose_words_cloud/models/requests/get_comments_request.rb +63 -0
  214. data/lib/aspose_words_cloud/models/requests/get_document_drawing_object_by_index_request.rb +73 -0
  215. data/lib/aspose_words_cloud/models/requests/get_document_drawing_object_image_data_request.rb +73 -0
  216. data/lib/aspose_words_cloud/models/requests/get_document_drawing_object_ole_data_request.rb +73 -0
  217. data/lib/aspose_words_cloud/models/requests/get_document_drawing_objects_request.rb +68 -0
  218. data/lib/aspose_words_cloud/models/requests/get_document_field_names_online_request.rb +48 -0
  219. data/lib/aspose_words_cloud/models/requests/get_document_field_names_request.rb +68 -0
  220. data/lib/aspose_words_cloud/models/requests/get_document_hyperlink_by_index_request.rb +68 -0
  221. data/lib/aspose_words_cloud/models/requests/get_document_hyperlinks_request.rb +63 -0
  222. data/lib/aspose_words_cloud/models/requests/get_document_properties_request.rb +63 -0
  223. data/lib/aspose_words_cloud/models/requests/get_document_property_request.rb +68 -0
  224. data/lib/aspose_words_cloud/models/requests/get_document_protection_request.rb +63 -0
  225. data/lib/aspose_words_cloud/models/requests/get_document_request.rb +63 -0
  226. data/lib/aspose_words_cloud/models/requests/get_document_statistics_request.rb +78 -0
  227. data/lib/aspose_words_cloud/models/requests/get_document_with_format_request.rb +78 -0
  228. data/lib/aspose_words_cloud/models/requests/get_field_request.rb +73 -0
  229. data/lib/aspose_words_cloud/models/requests/get_fields_request.rb +68 -0
  230. data/lib/aspose_words_cloud/models/requests/get_files_list_request.rb +48 -0
  231. data/lib/aspose_words_cloud/models/requests/get_footnote_request.rb +73 -0
  232. data/lib/aspose_words_cloud/models/requests/get_footnotes_request.rb +68 -0
  233. data/lib/aspose_words_cloud/models/requests/get_form_field_request.rb +73 -0
  234. data/lib/aspose_words_cloud/models/requests/get_form_fields_request.rb +68 -0
  235. data/lib/aspose_words_cloud/models/requests/get_header_footer_of_section_request.rb +78 -0
  236. data/lib/aspose_words_cloud/models/requests/get_header_footer_request.rb +73 -0
  237. data/lib/aspose_words_cloud/models/requests/get_header_footers_request.rb +73 -0
  238. data/lib/aspose_words_cloud/models/requests/get_list_request.rb +68 -0
  239. data/lib/aspose_words_cloud/models/requests/get_lists_request.rb +63 -0
  240. data/lib/aspose_words_cloud/models/requests/get_office_math_object_request.rb +73 -0
  241. data/lib/aspose_words_cloud/models/requests/get_office_math_objects_request.rb +68 -0
  242. data/lib/aspose_words_cloud/models/requests/get_paragraph_format_request.rb +73 -0
  243. data/lib/aspose_words_cloud/models/requests/get_paragraph_list_format_request.rb +73 -0
  244. data/lib/aspose_words_cloud/models/requests/get_paragraph_request.rb +73 -0
  245. data/lib/aspose_words_cloud/models/requests/get_paragraph_tab_stops_request.rb +73 -0
  246. data/lib/aspose_words_cloud/models/requests/get_paragraphs_request.rb +68 -0
  247. data/lib/aspose_words_cloud/models/requests/get_range_text_request.rb +73 -0
  248. data/lib/aspose_words_cloud/models/requests/get_run_font_request.rb +73 -0
  249. data/lib/aspose_words_cloud/models/requests/get_run_request.rb +73 -0
  250. data/lib/aspose_words_cloud/models/requests/get_runs_request.rb +68 -0
  251. data/lib/aspose_words_cloud/models/requests/get_section_page_setup_request.rb +68 -0
  252. data/lib/aspose_words_cloud/models/requests/get_section_request.rb +68 -0
  253. data/lib/aspose_words_cloud/models/requests/get_sections_request.rb +63 -0
  254. data/lib/aspose_words_cloud/models/requests/get_style_from_document_element_request.rb +68 -0
  255. data/lib/aspose_words_cloud/models/requests/get_style_request.rb +68 -0
  256. data/lib/aspose_words_cloud/models/requests/get_styles_request.rb +63 -0
  257. data/lib/aspose_words_cloud/models/requests/get_table_cell_format_request.rb +73 -0
  258. data/lib/aspose_words_cloud/models/requests/get_table_cell_request.rb +73 -0
  259. data/lib/aspose_words_cloud/models/requests/get_table_properties_request.rb +73 -0
  260. data/lib/aspose_words_cloud/models/requests/get_table_request.rb +73 -0
  261. data/lib/aspose_words_cloud/models/requests/get_table_row_format_request.rb +73 -0
  262. data/lib/aspose_words_cloud/models/requests/get_table_row_request.rb +73 -0
  263. data/lib/aspose_words_cloud/models/requests/get_tables_request.rb +68 -0
  264. data/lib/aspose_words_cloud/models/requests/insert_comment_request.rb +83 -0
  265. data/lib/aspose_words_cloud/models/requests/insert_drawing_object_request.rb +93 -0
  266. data/lib/aspose_words_cloud/models/requests/insert_field_request.rb +93 -0
  267. data/lib/aspose_words_cloud/models/requests/insert_footnote_request.rb +88 -0
  268. data/lib/aspose_words_cloud/models/requests/insert_form_field_request.rb +93 -0
  269. data/lib/aspose_words_cloud/models/requests/insert_header_footer_request.rb +88 -0
  270. data/lib/aspose_words_cloud/models/requests/insert_list_request.rb +83 -0
  271. data/lib/aspose_words_cloud/models/requests/insert_or_update_paragraph_tab_stop_request.rb +83 -0
  272. data/lib/aspose_words_cloud/models/requests/insert_page_numbers_request.rb +83 -0
  273. data/lib/aspose_words_cloud/models/requests/insert_paragraph_request.rb +93 -0
  274. data/lib/aspose_words_cloud/models/requests/insert_run_request.rb +93 -0
  275. data/lib/aspose_words_cloud/models/requests/insert_style_request.rb +83 -0
  276. data/lib/aspose_words_cloud/models/requests/insert_table_cell_request.rb +88 -0
  277. data/lib/aspose_words_cloud/models/requests/insert_table_request.rb +88 -0
  278. data/lib/aspose_words_cloud/models/requests/insert_table_row_request.rb +88 -0
  279. data/lib/aspose_words_cloud/models/requests/insert_watermark_image_request.rb +93 -0
  280. data/lib/aspose_words_cloud/models/requests/insert_watermark_text_request.rb +83 -0
  281. data/lib/aspose_words_cloud/models/requests/load_web_document_request.rb +48 -0
  282. data/lib/aspose_words_cloud/models/requests/move_file_request.rb +63 -0
  283. data/lib/aspose_words_cloud/models/requests/move_folder_request.rb +58 -0
  284. data/lib/aspose_words_cloud/models/requests/optimize_document_request.rb +83 -0
  285. data/lib/aspose_words_cloud/models/requests/protect_document_request.rb +73 -0
  286. data/lib/aspose_words_cloud/models/requests/reject_all_revisions_request.rb +68 -0
  287. data/lib/aspose_words_cloud/models/requests/remove_range_request.rb +78 -0
  288. data/lib/aspose_words_cloud/models/requests/render_drawing_object_request.rb +83 -0
  289. data/lib/aspose_words_cloud/models/requests/render_math_object_request.rb +83 -0
  290. data/lib/aspose_words_cloud/models/requests/render_page_request.rb +78 -0
  291. data/lib/aspose_words_cloud/models/requests/render_paragraph_request.rb +83 -0
  292. data/lib/aspose_words_cloud/models/requests/render_table_request.rb +83 -0
  293. data/lib/aspose_words_cloud/models/requests/replace_text_request.rb +83 -0
  294. data/lib/aspose_words_cloud/models/requests/replace_with_text_request.rb +83 -0
  295. data/lib/aspose_words_cloud/models/requests/reset_cache_request.rb +33 -0
  296. data/lib/aspose_words_cloud/models/requests/save_as_range_request.rb +78 -0
  297. data/lib/aspose_words_cloud/models/requests/save_as_request.rb +73 -0
  298. data/lib/aspose_words_cloud/models/requests/save_as_tiff_request.rb +158 -0
  299. data/lib/aspose_words_cloud/models/requests/search_request.rb +68 -0
  300. data/lib/aspose_words_cloud/models/requests/split_document_request.rb +93 -0
  301. data/lib/aspose_words_cloud/models/requests/unprotect_document_request.rb +73 -0
  302. data/lib/aspose_words_cloud/models/requests/update_bookmark_request.rb +88 -0
  303. data/lib/aspose_words_cloud/models/requests/update_border_request.rb +93 -0
  304. data/lib/aspose_words_cloud/models/requests/update_comment_request.rb +88 -0
  305. data/lib/aspose_words_cloud/models/requests/update_drawing_object_request.rb +98 -0
  306. data/lib/aspose_words_cloud/models/requests/update_field_request.rb +93 -0
  307. data/lib/aspose_words_cloud/models/requests/update_fields_request.rb +68 -0
  308. data/lib/aspose_words_cloud/models/requests/update_footnote_request.rb +93 -0
  309. data/lib/aspose_words_cloud/models/requests/update_form_field_request.rb +93 -0
  310. data/lib/aspose_words_cloud/models/requests/update_list_level_request.rb +93 -0
  311. data/lib/aspose_words_cloud/models/requests/update_list_request.rb +88 -0
  312. data/lib/aspose_words_cloud/models/requests/update_paragraph_format_request.rb +93 -0
  313. data/lib/aspose_words_cloud/models/requests/update_paragraph_list_format_request.rb +93 -0
  314. data/lib/aspose_words_cloud/models/requests/update_run_font_request.rb +93 -0
  315. data/lib/aspose_words_cloud/models/requests/update_run_request.rb +93 -0
  316. data/lib/aspose_words_cloud/models/requests/update_section_page_setup_request.rb +88 -0
  317. data/lib/aspose_words_cloud/models/requests/update_style_request.rb +88 -0
  318. data/lib/aspose_words_cloud/models/requests/update_table_cell_format_request.rb +93 -0
  319. data/lib/aspose_words_cloud/models/requests/update_table_properties_request.rb +93 -0
  320. data/lib/aspose_words_cloud/models/requests/update_table_row_format_request.rb +93 -0
  321. data/lib/aspose_words_cloud/models/requests/upload_file_request.rb +55 -0
  322. data/lib/aspose_words_cloud/models/response_error.rb +241 -246
  323. data/lib/aspose_words_cloud/models/revisions_modification_response.rb +211 -216
  324. data/lib/aspose_words_cloud/models/rtf_save_options_data.rb +374 -374
  325. data/lib/aspose_words_cloud/models/run.rb +221 -226
  326. data/lib/aspose_words_cloud/models/run_base.rb +25 -31
  327. data/lib/aspose_words_cloud/models/run_insert.rb +25 -31
  328. data/lib/aspose_words_cloud/models/run_link.rb +221 -226
  329. data/lib/aspose_words_cloud/models/run_response.rb +211 -216
  330. data/lib/aspose_words_cloud/models/run_update.rb +25 -31
  331. data/lib/aspose_words_cloud/models/runs.rb +213 -218
  332. data/lib/aspose_words_cloud/models/runs_response.rb +211 -216
  333. data/lib/aspose_words_cloud/models/save_options_data.rb +334 -334
  334. data/lib/aspose_words_cloud/models/save_response.rb +211 -216
  335. data/lib/aspose_words_cloud/models/save_result.rb +223 -227
  336. data/lib/aspose_words_cloud/models/search_response.rb +221 -226
  337. data/lib/aspose_words_cloud/models/search_result.rb +211 -215
  338. data/lib/aspose_words_cloud/models/search_results_collection.rb +213 -218
  339. data/lib/aspose_words_cloud/models/section.rb +253 -254
  340. data/lib/aspose_words_cloud/models/section_link.rb +211 -216
  341. data/lib/aspose_words_cloud/models/section_link_collection.rb +213 -218
  342. data/lib/aspose_words_cloud/models/section_link_collection_response.rb +211 -216
  343. data/lib/aspose_words_cloud/models/section_page_setup_response.rb +211 -216
  344. data/lib/aspose_words_cloud/models/section_response.rb +211 -216
  345. data/lib/aspose_words_cloud/models/shading.rb +29 -29
  346. data/lib/aspose_words_cloud/models/split_document_response.rb +211 -216
  347. data/lib/aspose_words_cloud/models/split_document_result.rb +223 -227
  348. data/lib/aspose_words_cloud/models/stat_data_response.rb +221 -225
  349. data/lib/aspose_words_cloud/models/storage_file.rb +241 -247
  350. data/lib/aspose_words_cloud/models/story_child_nodes.rb +203 -209
  351. data/lib/aspose_words_cloud/models/string_format_data.rb +346 -348
  352. data/lib/aspose_words_cloud/models/style.rb +38 -38
  353. data/lib/aspose_words_cloud/models/style_apply.rb +24 -30
  354. data/lib/aspose_words_cloud/models/style_copy.rb +24 -30
  355. data/lib/aspose_words_cloud/models/style_insert.rb +26 -28
  356. data/lib/aspose_words_cloud/models/style_response.rb +28 -33
  357. data/lib/aspose_words_cloud/models/style_update.rb +38 -44
  358. data/lib/aspose_words_cloud/models/styles_response.rb +28 -34
  359. data/lib/aspose_words_cloud/models/svg_save_options_data.rb +467 -463
  360. data/lib/aspose_words_cloud/models/tab_stop.rb +28 -30
  361. data/lib/aspose_words_cloud/models/tab_stop_base.rb +26 -28
  362. data/lib/aspose_words_cloud/models/tab_stop_insert.rb +26 -28
  363. data/lib/aspose_words_cloud/models/tab_stops_response.rb +28 -34
  364. data/lib/aspose_words_cloud/models/table.rb +233 -237
  365. data/lib/aspose_words_cloud/models/table_cell.rb +223 -228
  366. data/lib/aspose_words_cloud/models/table_cell_format.rb +410 -410
  367. data/lib/aspose_words_cloud/models/table_cell_format_response.rb +211 -216
  368. data/lib/aspose_words_cloud/models/table_cell_insert.rb +201 -207
  369. data/lib/aspose_words_cloud/models/table_cell_response.rb +211 -216
  370. data/lib/aspose_words_cloud/models/table_insert.rb +221 -226
  371. data/lib/aspose_words_cloud/models/table_link.rb +211 -216
  372. data/lib/aspose_words_cloud/models/table_link_collection.rb +213 -218
  373. data/lib/aspose_words_cloud/models/table_link_collection_response.rb +211 -216
  374. data/lib/aspose_words_cloud/models/table_properties.rb +431 -430
  375. data/lib/aspose_words_cloud/models/table_properties_response.rb +211 -216
  376. data/lib/aspose_words_cloud/models/table_response.rb +211 -216
  377. data/lib/aspose_words_cloud/models/table_row.rb +233 -237
  378. data/lib/aspose_words_cloud/models/table_row_format.rb +282 -283
  379. data/lib/aspose_words_cloud/models/table_row_format_response.rb +211 -216
  380. data/lib/aspose_words_cloud/models/table_row_insert.rb +211 -217
  381. data/lib/aspose_words_cloud/models/table_row_response.rb +211 -216
  382. data/lib/aspose_words_cloud/models/text_save_options_data.rb +423 -420
  383. data/lib/aspose_words_cloud/models/tiff_save_options_data.rb +574 -562
  384. data/lib/aspose_words_cloud/models/txt_save_options_base_data.rb +392 -0
  385. data/lib/aspose_words_cloud/models/watermark_text.rb +211 -217
  386. data/lib/aspose_words_cloud/models/word_ml_save_options_data.rb +344 -344
  387. data/lib/aspose_words_cloud/models/words_api_error_response.rb +211 -216
  388. data/lib/aspose_words_cloud/models/words_api_link.rb +231 -237
  389. data/lib/aspose_words_cloud/models/words_response.rb +201 -207
  390. data/lib/aspose_words_cloud/models/xaml_fixed_save_options_data.rb +428 -423
  391. data/lib/aspose_words_cloud/models/xaml_flow_save_options_data.rb +354 -354
  392. data/lib/aspose_words_cloud/models/xml_color.rb +211 -217
  393. data/lib/aspose_words_cloud/models/xps_save_options_data.rb +447 -442
  394. data/lib/aspose_words_cloud/version.rb +28 -29
  395. metadata +165 -207
  396. data/lib/aspose_words_cloud/models/requests/AcceptAllRevisionsRequest.rb +0 -65
  397. data/lib/aspose_words_cloud/models/requests/AppendDocumentRequest.rb +0 -77
  398. data/lib/aspose_words_cloud/models/requests/ApplyStyleToDocumentElementRequest.rb +0 -81
  399. data/lib/aspose_words_cloud/models/requests/BuildReportOnlineRequest.rb +0 -57
  400. data/lib/aspose_words_cloud/models/requests/BuildReportRequest.rb +0 -73
  401. data/lib/aspose_words_cloud/models/requests/ClassifyDocumentRequest.rb +0 -69
  402. data/lib/aspose_words_cloud/models/requests/ClassifyRequest.rb +0 -49
  403. data/lib/aspose_words_cloud/models/requests/CompareDocumentRequest.rb +0 -69
  404. data/lib/aspose_words_cloud/models/requests/ConvertDocumentRequest.rb +0 -65
  405. data/lib/aspose_words_cloud/models/requests/CopyFileRequest.rb +0 -61
  406. data/lib/aspose_words_cloud/models/requests/CopyFolderRequest.rb +0 -57
  407. data/lib/aspose_words_cloud/models/requests/CopyStyleRequest.rb +0 -77
  408. data/lib/aspose_words_cloud/models/requests/CreateDocumentRequest.rb +0 -53
  409. data/lib/aspose_words_cloud/models/requests/CreateFolderRequest.rb +0 -49
  410. data/lib/aspose_words_cloud/models/requests/CreateOrUpdateDocumentPropertyRequest.rb +0 -81
  411. data/lib/aspose_words_cloud/models/requests/DeleteAllParagraphTabStopsRequest.rb +0 -73
  412. data/lib/aspose_words_cloud/models/requests/DeleteAllParagraphTabStopsWithoutNodePathRequest.rb +0 -69
  413. data/lib/aspose_words_cloud/models/requests/DeleteBorderRequest.rb +0 -81
  414. data/lib/aspose_words_cloud/models/requests/DeleteBordersRequest.rb +0 -77
  415. data/lib/aspose_words_cloud/models/requests/DeleteCommentRequest.rb +0 -77
  416. data/lib/aspose_words_cloud/models/requests/DeleteDocumentPropertyRequest.rb +0 -77
  417. data/lib/aspose_words_cloud/models/requests/DeleteDrawingObjectRequest.rb +0 -81
  418. data/lib/aspose_words_cloud/models/requests/DeleteDrawingObjectWithoutNodePathRequest.rb +0 -77
  419. data/lib/aspose_words_cloud/models/requests/DeleteFieldRequest.rb +0 -81
  420. data/lib/aspose_words_cloud/models/requests/DeleteFieldWithoutNodePathRequest.rb +0 -77
  421. data/lib/aspose_words_cloud/models/requests/DeleteFieldsRequest.rb +0 -77
  422. data/lib/aspose_words_cloud/models/requests/DeleteFieldsWithoutNodePathRequest.rb +0 -73
  423. data/lib/aspose_words_cloud/models/requests/DeleteFileRequest.rb +0 -53
  424. data/lib/aspose_words_cloud/models/requests/DeleteFolderRequest.rb +0 -53
  425. data/lib/aspose_words_cloud/models/requests/DeleteFootnoteRequest.rb +0 -81
  426. data/lib/aspose_words_cloud/models/requests/DeleteFootnoteWithoutNodePathRequest.rb +0 -77
  427. data/lib/aspose_words_cloud/models/requests/DeleteFormFieldRequest.rb +0 -81
  428. data/lib/aspose_words_cloud/models/requests/DeleteFormFieldWithoutNodePathRequest.rb +0 -77
  429. data/lib/aspose_words_cloud/models/requests/DeleteHeaderFooterRequest.rb +0 -81
  430. data/lib/aspose_words_cloud/models/requests/DeleteHeadersFootersRequest.rb +0 -81
  431. data/lib/aspose_words_cloud/models/requests/DeleteMacrosRequest.rb +0 -73
  432. data/lib/aspose_words_cloud/models/requests/DeleteOfficeMathObjectRequest.rb +0 -81
  433. data/lib/aspose_words_cloud/models/requests/DeleteOfficeMathObjectWithoutNodePathRequest.rb +0 -77
  434. data/lib/aspose_words_cloud/models/requests/DeleteParagraphListFormatRequest.rb +0 -81
  435. data/lib/aspose_words_cloud/models/requests/DeleteParagraphListFormatWithoutNodePathRequest.rb +0 -77
  436. data/lib/aspose_words_cloud/models/requests/DeleteParagraphRequest.rb +0 -81
  437. data/lib/aspose_words_cloud/models/requests/DeleteParagraphTabStopRequest.rb +0 -77
  438. data/lib/aspose_words_cloud/models/requests/DeleteParagraphTabStopWithoutNodePathRequest.rb +0 -73
  439. data/lib/aspose_words_cloud/models/requests/DeleteParagraphWithoutNodePathRequest.rb +0 -77
  440. data/lib/aspose_words_cloud/models/requests/DeleteRunRequest.rb +0 -81
  441. data/lib/aspose_words_cloud/models/requests/DeleteSectionRequest.rb +0 -77
  442. data/lib/aspose_words_cloud/models/requests/DeleteTableCellRequest.rb +0 -81
  443. data/lib/aspose_words_cloud/models/requests/DeleteTableRequest.rb +0 -81
  444. data/lib/aspose_words_cloud/models/requests/DeleteTableRowRequest.rb +0 -81
  445. data/lib/aspose_words_cloud/models/requests/DeleteTableWithoutNodePathRequest.rb +0 -77
  446. data/lib/aspose_words_cloud/models/requests/DeleteWatermarkRequest.rb +0 -73
  447. data/lib/aspose_words_cloud/models/requests/DownloadFileRequest.rb +0 -53
  448. data/lib/aspose_words_cloud/models/requests/ExecuteMailMergeOnlineRequest.rb +0 -61
  449. data/lib/aspose_words_cloud/models/requests/ExecuteMailMergeRequest.rb +0 -85
  450. data/lib/aspose_words_cloud/models/requests/GetAvailableFontsRequest.rb +0 -45
  451. data/lib/aspose_words_cloud/models/requests/GetBookmarkByNameRequest.rb +0 -65
  452. data/lib/aspose_words_cloud/models/requests/GetBookmarksRequest.rb +0 -61
  453. data/lib/aspose_words_cloud/models/requests/GetBorderRequest.rb +0 -69
  454. data/lib/aspose_words_cloud/models/requests/GetBordersRequest.rb +0 -65
  455. data/lib/aspose_words_cloud/models/requests/GetCommentRequest.rb +0 -65
  456. data/lib/aspose_words_cloud/models/requests/GetCommentsRequest.rb +0 -61
  457. data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectByIndexRequest.rb +0 -69
  458. data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectByIndexWithoutNodePathRequest.rb +0 -65
  459. data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectImageDataRequest.rb +0 -69
  460. data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectImageDataWithoutNodePathRequest.rb +0 -65
  461. data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectOleDataRequest.rb +0 -69
  462. data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectOleDataWithoutNodePathRequest.rb +0 -65
  463. data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectsRequest.rb +0 -65
  464. data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectsWithoutNodePathRequest.rb +0 -61
  465. data/lib/aspose_words_cloud/models/requests/GetDocumentFieldNamesOnlineRequest.rb +0 -49
  466. data/lib/aspose_words_cloud/models/requests/GetDocumentFieldNamesRequest.rb +0 -65
  467. data/lib/aspose_words_cloud/models/requests/GetDocumentHyperlinkByIndexRequest.rb +0 -65
  468. data/lib/aspose_words_cloud/models/requests/GetDocumentHyperlinksRequest.rb +0 -61
  469. data/lib/aspose_words_cloud/models/requests/GetDocumentPropertiesRequest.rb +0 -61
  470. data/lib/aspose_words_cloud/models/requests/GetDocumentPropertyRequest.rb +0 -65
  471. data/lib/aspose_words_cloud/models/requests/GetDocumentProtectionRequest.rb +0 -61
  472. data/lib/aspose_words_cloud/models/requests/GetDocumentRequest.rb +0 -61
  473. data/lib/aspose_words_cloud/models/requests/GetDocumentStatisticsRequest.rb +0 -73
  474. data/lib/aspose_words_cloud/models/requests/GetDocumentWithFormatRequest.rb +0 -73
  475. data/lib/aspose_words_cloud/models/requests/GetFieldRequest.rb +0 -69
  476. data/lib/aspose_words_cloud/models/requests/GetFieldWithoutNodePathRequest.rb +0 -65
  477. data/lib/aspose_words_cloud/models/requests/GetFieldsRequest.rb +0 -65
  478. data/lib/aspose_words_cloud/models/requests/GetFieldsWithoutNodePathRequest.rb +0 -61
  479. data/lib/aspose_words_cloud/models/requests/GetFilesListRequest.rb +0 -49
  480. data/lib/aspose_words_cloud/models/requests/GetFootnoteRequest.rb +0 -69
  481. data/lib/aspose_words_cloud/models/requests/GetFootnoteWithoutNodePathRequest.rb +0 -65
  482. data/lib/aspose_words_cloud/models/requests/GetFootnotesRequest.rb +0 -65
  483. data/lib/aspose_words_cloud/models/requests/GetFootnotesWithoutNodePathRequest.rb +0 -61
  484. data/lib/aspose_words_cloud/models/requests/GetFormFieldRequest.rb +0 -69
  485. data/lib/aspose_words_cloud/models/requests/GetFormFieldWithoutNodePathRequest.rb +0 -65
  486. data/lib/aspose_words_cloud/models/requests/GetFormFieldsRequest.rb +0 -65
  487. data/lib/aspose_words_cloud/models/requests/GetFormFieldsWithoutNodePathRequest.rb +0 -61
  488. data/lib/aspose_words_cloud/models/requests/GetHeaderFooterOfSectionRequest.rb +0 -73
  489. data/lib/aspose_words_cloud/models/requests/GetHeaderFooterRequest.rb +0 -69
  490. data/lib/aspose_words_cloud/models/requests/GetHeaderFootersRequest.rb +0 -69
  491. data/lib/aspose_words_cloud/models/requests/GetListRequest.rb +0 -65
  492. data/lib/aspose_words_cloud/models/requests/GetListsRequest.rb +0 -61
  493. data/lib/aspose_words_cloud/models/requests/GetOfficeMathObjectRequest.rb +0 -69
  494. data/lib/aspose_words_cloud/models/requests/GetOfficeMathObjectWithoutNodePathRequest.rb +0 -65
  495. data/lib/aspose_words_cloud/models/requests/GetOfficeMathObjectsRequest.rb +0 -65
  496. data/lib/aspose_words_cloud/models/requests/GetOfficeMathObjectsWithoutNodePathRequest.rb +0 -61
  497. data/lib/aspose_words_cloud/models/requests/GetParagraphFormatRequest.rb +0 -69
  498. data/lib/aspose_words_cloud/models/requests/GetParagraphFormatWithoutNodePathRequest.rb +0 -65
  499. data/lib/aspose_words_cloud/models/requests/GetParagraphListFormatRequest.rb +0 -69
  500. data/lib/aspose_words_cloud/models/requests/GetParagraphListFormatWithoutNodePathRequest.rb +0 -65
  501. data/lib/aspose_words_cloud/models/requests/GetParagraphRequest.rb +0 -69
  502. data/lib/aspose_words_cloud/models/requests/GetParagraphTabStopsRequest.rb +0 -69
  503. data/lib/aspose_words_cloud/models/requests/GetParagraphTabStopsWithoutNodePathRequest.rb +0 -65
  504. data/lib/aspose_words_cloud/models/requests/GetParagraphWithoutNodePathRequest.rb +0 -65
  505. data/lib/aspose_words_cloud/models/requests/GetParagraphsRequest.rb +0 -65
  506. data/lib/aspose_words_cloud/models/requests/GetParagraphsWithoutNodePathRequest.rb +0 -61
  507. data/lib/aspose_words_cloud/models/requests/GetRangeTextRequest.rb +0 -69
  508. data/lib/aspose_words_cloud/models/requests/GetRunFontRequest.rb +0 -69
  509. data/lib/aspose_words_cloud/models/requests/GetRunRequest.rb +0 -69
  510. data/lib/aspose_words_cloud/models/requests/GetRunsRequest.rb +0 -65
  511. data/lib/aspose_words_cloud/models/requests/GetSectionPageSetupRequest.rb +0 -65
  512. data/lib/aspose_words_cloud/models/requests/GetSectionRequest.rb +0 -65
  513. data/lib/aspose_words_cloud/models/requests/GetSectionsRequest.rb +0 -61
  514. data/lib/aspose_words_cloud/models/requests/GetStyleFromDocumentElementRequest.rb +0 -65
  515. data/lib/aspose_words_cloud/models/requests/GetStyleRequest.rb +0 -65
  516. data/lib/aspose_words_cloud/models/requests/GetStylesRequest.rb +0 -61
  517. data/lib/aspose_words_cloud/models/requests/GetTableCellFormatRequest.rb +0 -69
  518. data/lib/aspose_words_cloud/models/requests/GetTableCellRequest.rb +0 -69
  519. data/lib/aspose_words_cloud/models/requests/GetTablePropertiesRequest.rb +0 -69
  520. data/lib/aspose_words_cloud/models/requests/GetTablePropertiesWithoutNodePathRequest.rb +0 -65
  521. data/lib/aspose_words_cloud/models/requests/GetTableRequest.rb +0 -69
  522. data/lib/aspose_words_cloud/models/requests/GetTableRowFormatRequest.rb +0 -69
  523. data/lib/aspose_words_cloud/models/requests/GetTableRowRequest.rb +0 -69
  524. data/lib/aspose_words_cloud/models/requests/GetTableWithoutNodePathRequest.rb +0 -65
  525. data/lib/aspose_words_cloud/models/requests/GetTablesRequest.rb +0 -65
  526. data/lib/aspose_words_cloud/models/requests/GetTablesWithoutNodePathRequest.rb +0 -61
  527. data/lib/aspose_words_cloud/models/requests/InsertCommentRequest.rb +0 -77
  528. data/lib/aspose_words_cloud/models/requests/InsertDrawingObjectRequest.rb +0 -85
  529. data/lib/aspose_words_cloud/models/requests/InsertDrawingObjectWithoutNodePathRequest.rb +0 -81
  530. data/lib/aspose_words_cloud/models/requests/InsertFieldRequest.rb +0 -85
  531. data/lib/aspose_words_cloud/models/requests/InsertFieldWithoutNodePathRequest.rb +0 -81
  532. data/lib/aspose_words_cloud/models/requests/InsertFootnoteRequest.rb +0 -81
  533. data/lib/aspose_words_cloud/models/requests/InsertFootnoteWithoutNodePathRequest.rb +0 -77
  534. data/lib/aspose_words_cloud/models/requests/InsertFormFieldRequest.rb +0 -85
  535. data/lib/aspose_words_cloud/models/requests/InsertFormFieldWithoutNodePathRequest.rb +0 -81
  536. data/lib/aspose_words_cloud/models/requests/InsertHeaderFooterRequest.rb +0 -81
  537. data/lib/aspose_words_cloud/models/requests/InsertListRequest.rb +0 -77
  538. data/lib/aspose_words_cloud/models/requests/InsertOrUpdateParagraphTabStopRequest.rb +0 -77
  539. data/lib/aspose_words_cloud/models/requests/InsertOrUpdateParagraphTabStopWithoutNodePathRequest.rb +0 -73
  540. data/lib/aspose_words_cloud/models/requests/InsertPageNumbersRequest.rb +0 -77
  541. data/lib/aspose_words_cloud/models/requests/InsertParagraphRequest.rb +0 -85
  542. data/lib/aspose_words_cloud/models/requests/InsertParagraphWithoutNodePathRequest.rb +0 -81
  543. data/lib/aspose_words_cloud/models/requests/InsertRunRequest.rb +0 -85
  544. data/lib/aspose_words_cloud/models/requests/InsertStyleRequest.rb +0 -77
  545. data/lib/aspose_words_cloud/models/requests/InsertTableCellRequest.rb +0 -81
  546. data/lib/aspose_words_cloud/models/requests/InsertTableRequest.rb +0 -81
  547. data/lib/aspose_words_cloud/models/requests/InsertTableRowRequest.rb +0 -81
  548. data/lib/aspose_words_cloud/models/requests/InsertTableWithoutNodePathRequest.rb +0 -77
  549. data/lib/aspose_words_cloud/models/requests/InsertWatermarkImageRequest.rb +0 -85
  550. data/lib/aspose_words_cloud/models/requests/InsertWatermarkTextRequest.rb +0 -77
  551. data/lib/aspose_words_cloud/models/requests/LoadWebDocumentRequest.rb +0 -49
  552. data/lib/aspose_words_cloud/models/requests/MoveFileRequest.rb +0 -61
  553. data/lib/aspose_words_cloud/models/requests/MoveFolderRequest.rb +0 -57
  554. data/lib/aspose_words_cloud/models/requests/ProtectDocumentRequest.rb +0 -69
  555. data/lib/aspose_words_cloud/models/requests/RejectAllRevisionsRequest.rb +0 -65
  556. data/lib/aspose_words_cloud/models/requests/RemoveRangeRequest.rb +0 -73
  557. data/lib/aspose_words_cloud/models/requests/RenderDrawingObjectRequest.rb +0 -77
  558. data/lib/aspose_words_cloud/models/requests/RenderDrawingObjectWithoutNodePathRequest.rb +0 -73
  559. data/lib/aspose_words_cloud/models/requests/RenderMathObjectRequest.rb +0 -77
  560. data/lib/aspose_words_cloud/models/requests/RenderMathObjectWithoutNodePathRequest.rb +0 -73
  561. data/lib/aspose_words_cloud/models/requests/RenderPageRequest.rb +0 -73
  562. data/lib/aspose_words_cloud/models/requests/RenderParagraphRequest.rb +0 -77
  563. data/lib/aspose_words_cloud/models/requests/RenderParagraphWithoutNodePathRequest.rb +0 -73
  564. data/lib/aspose_words_cloud/models/requests/RenderTableRequest.rb +0 -77
  565. data/lib/aspose_words_cloud/models/requests/RenderTableWithoutNodePathRequest.rb +0 -73
  566. data/lib/aspose_words_cloud/models/requests/ReplaceTextRequest.rb +0 -77
  567. data/lib/aspose_words_cloud/models/requests/ReplaceWithTextRequest.rb +0 -77
  568. data/lib/aspose_words_cloud/models/requests/ResetCacheRequest.rb +0 -36
  569. data/lib/aspose_words_cloud/models/requests/SaveAsRangeRequest.rb +0 -73
  570. data/lib/aspose_words_cloud/models/requests/SaveAsRequest.rb +0 -69
  571. data/lib/aspose_words_cloud/models/requests/SaveAsTiffRequest.rb +0 -137
  572. data/lib/aspose_words_cloud/models/requests/SearchRequest.rb +0 -65
  573. data/lib/aspose_words_cloud/models/requests/SplitDocumentRequest.rb +0 -85
  574. data/lib/aspose_words_cloud/models/requests/UnprotectDocumentRequest.rb +0 -69
  575. data/lib/aspose_words_cloud/models/requests/UpdateBookmarkRequest.rb +0 -81
  576. data/lib/aspose_words_cloud/models/requests/UpdateBorderRequest.rb +0 -85
  577. data/lib/aspose_words_cloud/models/requests/UpdateCommentRequest.rb +0 -81
  578. data/lib/aspose_words_cloud/models/requests/UpdateDrawingObjectRequest.rb +0 -89
  579. data/lib/aspose_words_cloud/models/requests/UpdateDrawingObjectWithoutNodePathRequest.rb +0 -85
  580. data/lib/aspose_words_cloud/models/requests/UpdateFieldRequest.rb +0 -85
  581. data/lib/aspose_words_cloud/models/requests/UpdateFieldsRequest.rb +0 -65
  582. data/lib/aspose_words_cloud/models/requests/UpdateFootnoteRequest.rb +0 -85
  583. data/lib/aspose_words_cloud/models/requests/UpdateFootnoteWithoutNodePathRequest.rb +0 -81
  584. data/lib/aspose_words_cloud/models/requests/UpdateFormFieldRequest.rb +0 -85
  585. data/lib/aspose_words_cloud/models/requests/UpdateFormFieldWithoutNodePathRequest.rb +0 -81
  586. data/lib/aspose_words_cloud/models/requests/UpdateListLevelRequest.rb +0 -85
  587. data/lib/aspose_words_cloud/models/requests/UpdateListRequest.rb +0 -81
  588. data/lib/aspose_words_cloud/models/requests/UpdateParagraphFormatRequest.rb +0 -85
  589. data/lib/aspose_words_cloud/models/requests/UpdateParagraphFormatWithoutNodePathRequest.rb +0 -81
  590. data/lib/aspose_words_cloud/models/requests/UpdateParagraphListFormatRequest.rb +0 -85
  591. data/lib/aspose_words_cloud/models/requests/UpdateParagraphListFormatWithoutNodePathRequest.rb +0 -81
  592. data/lib/aspose_words_cloud/models/requests/UpdateRunFontRequest.rb +0 -85
  593. data/lib/aspose_words_cloud/models/requests/UpdateRunRequest.rb +0 -85
  594. data/lib/aspose_words_cloud/models/requests/UpdateSectionPageSetupRequest.rb +0 -81
  595. data/lib/aspose_words_cloud/models/requests/UpdateStyleRequest.rb +0 -81
  596. data/lib/aspose_words_cloud/models/requests/UpdateTableCellFormatRequest.rb +0 -85
  597. data/lib/aspose_words_cloud/models/requests/UpdateTablePropertiesRequest.rb +0 -85
  598. data/lib/aspose_words_cloud/models/requests/UpdateTablePropertiesWithoutNodePathRequest.rb +0 -81
  599. data/lib/aspose_words_cloud/models/requests/UpdateTableRowFormatRequest.rb +0 -85
  600. data/lib/aspose_words_cloud/models/requests/UploadFileRequest.rb +0 -53
@@ -1,412 +1,411 @@
1
- # -----------------------------------------------------------------------------------
2
- # <copyright company="Aspose" file="api_client.rb">
3
- # Copyright (c) 2019 Aspose.Words for Cloud
4
- # </copyright>
5
- # <summary>
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in all
14
- # copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
- # </summary>
24
- # -----------------------------------------------------------------------------------
25
-
26
- require 'date'
27
- require 'json'
28
- require 'logger'
29
- require 'tempfile'
30
- require 'uri'
31
- require 'faraday'
32
- require 'mimemagic'
33
- require_relative 'version'
34
- require_relative 'api_error'
35
-
36
- module AsposeWordsCloud
37
- #
38
- # api client is mainly responsible for making the HTTP call to the API backend.
39
- #
40
- class ApiClient
41
- # The Configuration object holding settings to be used in the API client.
42
- attr_accessor :config
43
-
44
- # Defines the headers to be used in HTTP requests of all API calls by default.
45
- #
46
- # @return [Hash]
47
- attr_accessor :default_headers
48
-
49
- # Initializes the ApiClient
50
- # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
51
- def initialize(config = Configuration.default)
52
- @config = config
53
- @default_headers = {
54
- 'Content-Type' => "application/json",
55
- 'x-aspose-client' => "ruby sdk",
56
- 'x-aspose-version' => AsposeWordsCloud::VERSION.to_s
57
- }
58
- end
59
-
60
- def self.default
61
- @@default ||= ApiClient.new
62
- end
63
-
64
- # Call an API with given options.
65
- #
66
- # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
67
- # the data deserialized from response body (could be nil), response status code and response headers.
68
- def call_api(http_method, path, opts = {})
69
- if @config.api_key['app_sid'].nil? || @config.api_key['app_sid'] == ''
70
- raise "AppSid could not be an empty string."
71
- end
72
-
73
- if @config.api_key['api_key'].nil? || @config.api_key['api_key'] == ''
74
- raise "AppKey could not be an empty string."
75
- end
76
-
77
- response = build_request(http_method, path, opts)
78
- download_file response if opts[:return_type] == 'File'
79
- if @config.debugging
80
- @config.logger.debug "'HTTP' response body '~BEGIN~'\n #{response.body}\n'~END~'\n"
81
- end
82
-
83
- unless response.success?
84
- if response.status == 0
85
- # Errors from libcurl will be made visible here
86
- raise ApiError.new(:code => 0,
87
- :message => response.reason_phrase)
88
- else
89
- raise ApiError.new(:code => response.status,
90
- :response_headers => response.headers,
91
- :response_body => response.body),
92
- response.reason_phrase
93
- end
94
- end
95
-
96
-
97
- data = deserialize(response, opts[:return_type]) if opts[:return_type]
98
- [data, response.status, response.headers]
99
- end
100
-
101
- # Builds the HTTP request
102
- #
103
- # @param [String] http_method HTTP method/verb (e.g. POST)
104
- # @param [String] path URL path (e.g. /account/new)
105
- # @option opts [Hash] :header_params Header parameters
106
- # @option opts [Hash] :query_params Query parameters
107
- # @option opts [Hash] :form_params Query parameters
108
- # @option opts [Object] :body HTTP body (JSON/XML)
109
- # @return [Faraday::Response] A Faraday Response
110
- def build_request(http_method, path, opts = {})
111
- url = build_request_url(path)
112
- http_method = http_method.to_sym.downcase
113
-
114
- header_params = @default_headers.merge(opts[:header_params] || {})
115
- query_params = opts[:query_params] || {}
116
- form_params = opts[:form_params] || {}
117
- body = opts[:body] if opts[:body] || nil?
118
-
119
- update_params_for_auth! header_params, query_params, opts[:auth_names]
120
-
121
- req_opts = {
122
- :method => http_method,
123
- :headers => header_params,
124
- :params => query_params,
125
- :body => body
126
- }
127
-
128
- if [:post, :patch, :put, :delete].include?(http_method)
129
- req_body = build_request_body(header_params, form_params, opts[:body])
130
- req_opts.update :body => req_body
131
- if @config.debugging
132
- @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
133
- end
134
- end
135
-
136
- conn = Faraday.new url, { :params => query_params, :headers => header_params } do |f|
137
- f.request :multipart
138
- f.request :url_encoded
139
- f.adapter Faraday.default_adapter
140
- end
141
-
142
- case http_method
143
- when :post
144
- return conn.post url, req_opts[:body]
145
- when :put
146
- return conn.put url, req_opts[:body]
147
- when :get
148
- return conn.get url, req_opts[:body]
149
- else
150
- return conn.delete url do |c|
151
- c.body = req_opts[:body]
152
- end
153
- end
154
- end
155
-
156
- # Check if the given MIME is a JSON MIME.
157
- # JSON MIME examples:
158
- # application/json
159
- # application/json; charset=UTF8
160
- # APPLICATION/JSON
161
- # */*
162
- # @param [String] mime MIME
163
- # @return [Boolean] True if the MIME is application/json
164
- def json_mime?(mime)
165
- (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
166
- end
167
-
168
- # Deserialize the response to the given return type.
169
- #
170
- # @param [Response] response HTTP response
171
- # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
172
- def deserialize(response, return_type)
173
- body = response.body
174
-
175
- # handle file downloading - return the File instance processed in request callbacks
176
- # note that response body is empty when the file is written in chunks in request on_body callback
177
- return @tempfile if return_type == 'File'
178
-
179
- return nil if body.nil? || body.empty?
180
-
181
- # return response body directly for String return type
182
- return body if return_type == 'String'
183
-
184
- # ensuring a default content type
185
- content_type = response.headers['Content-Type'] || 'application/json'
186
-
187
- raise "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
188
-
189
- begin
190
- data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
191
- rescue JSON::ParserError => e
192
- if %w[String Date DateTime].include?(return_type)
193
- data = body
194
- else
195
- raise e
196
- end
197
- end
198
-
199
- convert_to_type data, return_type
200
- end
201
-
202
- # Convert data to the given return type.
203
- # @param [Object] data Data to be converted
204
- # @param [String] return_type Return type
205
- # @return [Mixed] Data in a particular type
206
- def convert_to_type(data, return_type)
207
- return nil if data.nil?
208
- case return_type
209
- when 'String'
210
- data.to_s
211
- when 'Integer'
212
- data.to_i
213
- when 'Float'
214
- data.to_f
215
- when 'BOOLEAN'
216
- data == true
217
- when 'DateTime'
218
- # parse date time (expecting ISO 8601 format)
219
- DateTime.parse data
220
- when 'Date'
221
- # parse date time (expecting ISO 8601 format)
222
- Date.parse data
223
- when 'Object'
224
- # generic object (usually a Hash), return directly
225
- data
226
- when /\AArray<(.+)>\z/
227
- # e.g. Array<Pet>
228
- sub_type = $1
229
- data.map {|item| convert_to_type(item, sub_type) }
230
- when /\AHash\<String, (.+)\>\z/
231
- # e.g. Hash<String, Integer>
232
- sub_type = $1
233
- {}.tap do |hash|
234
- data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
235
- end
236
- else
237
- # models, e.g. Pet
238
- AsposeWordsCloud.const_get(return_type).new.tap do |model|
239
- model.build_from_hash data
240
- end
241
- end
242
- end
243
-
244
- # Save response body into a file in (the defined) temporary folder, using the filename
245
- # from the "Content-Disposition" header if provided, otherwise a random filename.
246
- # The response body is written to the file in chunks in order to handle files which
247
- # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
248
- # process can use.
249
- #
250
- # @see Configuration#temp_folder_path
251
- def download_file(response)
252
- tempfile = nil
253
- encoding = nil
254
- content_disposition = response.headers['Content-Disposition']
255
- if content_disposition and content_disposition =~ /filename=/i
256
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
257
- prefix = sanitize_filename(filename)
258
- else
259
- prefix = 'download-'
260
- end
261
- prefix += '-' unless prefix.end_with?('-')
262
- encoding = response.body.encoding
263
- tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
264
- @tempfile = tempfile
265
- tempfile.write(response.body)
266
- response.on_complete do |resp|
267
- tempfile.close
268
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
269
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
270
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
271
- "explicitly with `tempfile.delete`"
272
- end
273
- end
274
-
275
- # Sanitize filename by removing path.
276
- # e.g. ../../sun.gif becomes sun.gif
277
- #
278
- # @param [String] filename the filename to be sanitized
279
- # @return [String] the sanitized filename
280
- def sanitize_filename(filename)
281
- filename.gsub(/.*[\/\\]/, '')
282
- end
283
-
284
- def build_request_url(path)
285
- # remove empty path parameter artifacts
286
- path = path.gsub(/\/+/, '/')
287
- path = path.gsub(" ", "%20")
288
- return @config.getFullUrl(path, path == "/connect/token")
289
- end
290
-
291
- # Builds the HTTP request body
292
- #
293
- # @param [Hash] header_params Header parameters
294
- # @param [Hash] form_params Query parameters
295
- # @param [Object] body HTTP body (JSON/XML)
296
- # @return [String] HTTP body data in the form of string
297
- def build_request_body(header_params, form_params, body)
298
- # http form
299
- if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
300
- header_params['Content-Type'] == 'multipart/form-data'
301
- data = {}
302
- form_params.each do |key, value|
303
- case value
304
- when ::File
305
- data[key] = Faraday::UploadIO.new(value.path, MimeMagic.by_magic(value).to_s, key)
306
- when ::Array, nil
307
- data[key] = value
308
- else
309
- data[key] = value.to_s
310
- end
311
- end
312
- elsif body
313
- data = body.is_a?(String) ? body : body.to_json
314
- else
315
- data = nil
316
- end
317
- data
318
- end
319
-
320
- # Update hearder and query params based on authentication settings.
321
- #
322
- # @param [Hash] header_params Header parameters
323
- # @param [Hash] query_params Query parameters
324
- # @param [String] auth_names Authentication scheme name
325
- def update_params_for_auth!(header_params, query_params, auth_names)
326
- Array(auth_names).each do |auth_name|
327
- auth_setting = @config.auth_settings[auth_name]
328
- next unless auth_setting
329
- case auth_setting[:in]
330
- when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
331
- when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
332
- else raise ArgumentError, 'Authentication token must be in `query` of `header`'
333
- end
334
- end
335
- end
336
-
337
- # Sets user agent in HTTP header
338
- #
339
- # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
340
- def user_agent=(user_agent)
341
- @user_agent = user_agent
342
- @default_headers['User-Agent'] = @user_agent
343
- end
344
-
345
- # Return Accept header based on an array of accepts provided.
346
- # @param [Array] accepts array for Accept
347
- # @return [String] the Accept header (e.g. application/json)
348
- def select_header_accept(accepts)
349
- return nil if accepts.nil? || accepts.empty?
350
- # use JSON when present, otherwise use all of the provided
351
- json_accept = accepts.find { |s| json_mime?(s) }
352
- return json_accept || accepts.join(',')
353
- end
354
-
355
- # Return Content-Type header based on an array of content types provided.
356
- # @param [Array] content_types array for Content-Type
357
- # @return [String] the Content-Type header (e.g. application/json)
358
- def select_header_content_type(content_types)
359
- # use application/json by default
360
- return 'application/json' if content_types.nil? || content_types.empty?
361
- # use JSON when present, otherwise use the first one
362
- json_content_type = content_types.find { |s| json_mime?(s) }
363
- return json_content_type || content_types.first
364
- end
365
-
366
- # Convert object (array, hash, object, etc) to JSON string.
367
- # @param [Object] model object to be converted into JSON string
368
- # @return [String] JSON string representation of the object
369
- def object_to_http_body(model)
370
- return '"' + model + '"' if model.is_a?(String)
371
- return model if model.nil?
372
- local_body = nil
373
- if model.is_a?(Array)
374
- local_body = model.map { |m| object_to_hash(m) }
375
- else
376
- local_body = object_to_hash(model)
377
- end
378
- local_body.to_json
379
- end
380
-
381
- # Convert object(non-array) to hash.
382
- # @param [Object] obj object to be converted into JSON string
383
- # @return [String] JSON string representation of the object
384
- def object_to_hash(obj)
385
- if obj.respond_to?(:to_hash)
386
- obj.to_hash
387
- else
388
- obj
389
- end
390
- end
391
-
392
- # Build parameter value according to the given collection format.
393
- # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
394
- def build_collection_param(param, collection_format)
395
- case collection_format
396
- when :csv
397
- param.join(',')
398
- when :ssv
399
- param.join(' ')
400
- when :tsv
401
- param.join("\t")
402
- when :pipes
403
- param.join('|')
404
- when :multi
405
- # return the array directly as faraday will handle it as expected
406
- param
407
- else
408
- raise "unknown collection format: #{collection_format.inspect}"
409
- end
410
- end
411
- end
412
- end
1
+ # ------------------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="api_client.rb">
3
+ # Copyright (c) 2020 Aspose.Words for Cloud
4
+ # </copyright>
5
+ # <summary>
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ # SOFTWARE.
23
+ # </summary>
24
+ # ------------------------------------------------------------------------------------
25
+
26
+ require 'date'
27
+ require 'json'
28
+ require 'logger'
29
+ require 'tempfile'
30
+ require 'uri'
31
+ require 'faraday'
32
+ require 'mimemagic'
33
+ require_relative 'version'
34
+ require_relative 'api_error'
35
+
36
+ module AsposeWordsCloud
37
+ #
38
+ # api client is mainly responsible for making the HTTP call to the API backend.
39
+ #
40
+ class ApiClient
41
+ # The Configuration object holding settings to be used in the API client.
42
+ attr_accessor :config
43
+
44
+ # Defines the headers to be used in HTTP requests of all API calls by default.
45
+ #
46
+ # @return [Hash]
47
+ attr_accessor :default_headers
48
+
49
+ # Initializes the ApiClient
50
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
51
+ def initialize(config = Configuration.default)
52
+ @config = config
53
+ @default_headers = {
54
+ 'Content-Type' => "application/json",
55
+ 'x-aspose-client' => "ruby sdk",
56
+ 'x-aspose-version' => AsposeWordsCloud::VERSION.to_s
57
+ }
58
+ end
59
+
60
+ def self.default
61
+ @@default ||= ApiClient.new
62
+ end
63
+
64
+ # Call an API with given options.
65
+ #
66
+ # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
67
+ # the data deserialized from response body (could be nil), response status code and response headers.
68
+ def call_api(http_method, path, opts = {})
69
+ if @config.client_data['ClientId'].nil? || @config.client_data['ClientId'] == ''
70
+ raise "ClientId could not be an empty string."
71
+ end
72
+
73
+ if @config.client_data['ClientSecret'].nil? || @config.client_data['ClientSecret'] == ''
74
+ raise "ClientSecret could not be an empty string."
75
+ end
76
+
77
+ response = build_request(http_method, path, opts)
78
+ download_file response if opts[:return_type] == 'File'
79
+ if @config.debugging
80
+ @config.logger.debug "'HTTP' response body '~BEGIN~'\n #{response.body}\n'~END~'\n"
81
+ end
82
+
83
+ unless response.success?
84
+ if response.status == 0
85
+ # Errors from libcurl will be made visible here
86
+ raise ApiError.new(:code => 0,
87
+ :message => response.reason_phrase)
88
+ else
89
+ raise ApiError.new(:code => response.status,
90
+ :response_headers => response.headers,
91
+ :response_body => response.body),
92
+ response.reason_phrase
93
+ end
94
+ end
95
+
96
+
97
+ data = deserialize(response, opts[:return_type]) if opts[:return_type]
98
+ [data, response.status, response.headers]
99
+ end
100
+
101
+ # Builds the HTTP request
102
+ #
103
+ # @param [String] http_method HTTP method/verb (e.g. POST)
104
+ # @param [String] path URL path (e.g. /account/new)
105
+ # @option opts [Hash] :header_params Header parameters
106
+ # @option opts [Hash] :query_params Query parameters
107
+ # @option opts [Hash] :form_params Query parameters
108
+ # @option opts [Object] :body HTTP body (JSON/XML)
109
+ # @return [Faraday::Response] A Faraday Response
110
+ def build_request(http_method, path, opts = {})
111
+ url = build_request_url(path)
112
+ http_method = http_method.to_sym.downcase
113
+
114
+ header_params = @default_headers.merge(opts[:header_params] || {})
115
+ query_params = opts[:query_params] || {}
116
+ form_params = opts[:form_params] || {}
117
+ body = opts[:body] if opts[:body] || nil?
118
+
119
+ update_params_for_auth! header_params, query_params, opts[:auth_names]
120
+
121
+ req_opts = {
122
+ :method => http_method,
123
+ :headers => header_params,
124
+ :params => query_params,
125
+ :body => body
126
+ }
127
+
128
+ if [:post, :patch, :put, :delete].include?(http_method)
129
+ req_body = build_request_body(header_params, form_params, opts[:body])
130
+ req_opts.update :body => req_body
131
+ if @config.debugging
132
+ @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
133
+ end
134
+ end
135
+
136
+ conn = Faraday.new url, { :params => query_params, :headers => header_params } do |f|
137
+ f.request :multipart
138
+ f.request :url_encoded
139
+ f.adapter Faraday.default_adapter
140
+ end
141
+
142
+ case http_method
143
+ when :post
144
+ return conn.post url, req_opts[:body]
145
+ when :put
146
+ return conn.put url, req_opts[:body]
147
+ when :get
148
+ return conn.get url, req_opts[:body]
149
+ else
150
+ return conn.delete url do |c|
151
+ c.body = req_opts[:body]
152
+ end
153
+ end
154
+ end
155
+
156
+ # Check if the given MIME is a JSON MIME.
157
+ # JSON MIME examples:
158
+ # application/json
159
+ # application/json; charset=UTF8
160
+ # APPLICATION/JSON
161
+ # */*
162
+ # @param [String] mime MIME
163
+ # @return [Boolean] True if the MIME is application/json
164
+ def json_mime?(mime)
165
+ (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
166
+ end
167
+
168
+ # Deserialize the response to the given return type.
169
+ #
170
+ # @param [Response] response HTTP response
171
+ # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
172
+ def deserialize(response, return_type)
173
+ body = response.body
174
+
175
+ # handle file downloading - return the File instance processed in request callbacks
176
+ # note that response body is empty when the file is written in chunks in request on_body callback
177
+ return @tempfile if return_type == 'File'
178
+
179
+ return nil if body.nil? || body.empty?
180
+
181
+ # return response body directly for String return type
182
+ return body if return_type == 'String'
183
+
184
+ # ensuring a default content type
185
+ content_type = response.headers['Content-Type'] || 'application/json'
186
+
187
+ raise "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
188
+
189
+ begin
190
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
191
+ rescue JSON::ParserError => e
192
+ if %w[String Date DateTime].include?(return_type)
193
+ data = body
194
+ else
195
+ raise e
196
+ end
197
+ end
198
+
199
+ convert_to_type data, return_type
200
+ end
201
+
202
+ # Convert data to the given return type.
203
+ # @param [Object] data Data to be converted
204
+ # @param [String] return_type Return type
205
+ # @return [Mixed] Data in a particular type
206
+ def convert_to_type(data, return_type)
207
+ return nil if data.nil?
208
+ case return_type
209
+ when 'String'
210
+ data.to_s
211
+ when 'Integer'
212
+ data.to_i
213
+ when 'Float'
214
+ data.to_f
215
+ when 'BOOLEAN'
216
+ data == true
217
+ when 'DateTime'
218
+ # parse date time (expecting ISO 8601 format)
219
+ DateTime.parse data
220
+ when 'Date'
221
+ # parse date time (expecting ISO 8601 format)
222
+ Date.parse data
223
+ when 'Object'
224
+ # generic object (usually a Hash), return directly
225
+ data
226
+ when /\AArray<(.+)>\z/
227
+ # e.g. Array<Pet>
228
+ sub_type = $1
229
+ data.map {|item| convert_to_type(item, sub_type) }
230
+ when /\AHash\<String, (.+)\>\z/
231
+ # e.g. Hash<String, Integer>
232
+ sub_type = $1
233
+ {}.tap do |hash|
234
+ data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
235
+ end
236
+ else
237
+ # models, e.g. Pet
238
+ AsposeWordsCloud.const_get(return_type).new.tap do |model|
239
+ model.build_from_hash data
240
+ end
241
+ end
242
+ end
243
+
244
+ # Save response body into a file in (the defined) temporary folder, using the filename
245
+ # from the "Content-Disposition" header if provided, otherwise a random filename.
246
+ # The response body is written to the file in chunks in order to handle files which
247
+ # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
248
+ # process can use.
249
+ #
250
+ # @see Configuration#temp_folder_path
251
+ def download_file(response)
252
+ tempfile = nil
253
+ encoding = nil
254
+ content_disposition = response.headers['Content-Disposition']
255
+ if content_disposition and content_disposition =~ /filename=/i
256
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
257
+ prefix = sanitize_filename(filename)
258
+ else
259
+ prefix = 'download-'
260
+ end
261
+ prefix += '-' unless prefix.end_with?('-')
262
+ encoding = response.body.encoding
263
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
264
+ @tempfile = tempfile
265
+ tempfile.write(response.body)
266
+ response.on_complete do |resp|
267
+ tempfile.close
268
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
269
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
270
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
271
+ "explicitly with `tempfile.delete`"
272
+ end
273
+ end
274
+
275
+ # Sanitize filename by removing path.
276
+ # e.g. ../../sun.gif becomes sun.gif
277
+ #
278
+ # @param [String] filename the filename to be sanitized
279
+ # @return [String] the sanitized filename
280
+ def sanitize_filename(filename)
281
+ filename.gsub(/.*[\/\\]/, '')
282
+ end
283
+
284
+ def build_request_url(path)
285
+ # remove empty path parameter artifacts
286
+ path = path.gsub(/\/+/, '/')
287
+ return @config.getFullUrl(path, path == "/connect/token")
288
+ end
289
+
290
+ # Builds the HTTP request body
291
+ #
292
+ # @param [Hash] header_params Header parameters
293
+ # @param [Hash] form_params Query parameters
294
+ # @param [Object] body HTTP body (JSON/XML)
295
+ # @return [String] HTTP body data in the form of string
296
+ def build_request_body(header_params, form_params, body)
297
+ # http form
298
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
299
+ header_params['Content-Type'] == 'multipart/form-data'
300
+ data = {}
301
+ form_params.each do |key, value|
302
+ case value
303
+ when ::File
304
+ data[key] = Faraday::UploadIO.new(value.path, MimeMagic.by_magic(value).to_s, key)
305
+ when ::Array, nil
306
+ data[key] = value
307
+ else
308
+ data[key] = value.to_s
309
+ end
310
+ end
311
+ elsif body
312
+ data = body.is_a?(String) ? body : body.to_json
313
+ else
314
+ data = nil
315
+ end
316
+ data
317
+ end
318
+
319
+ # Update hearder and query params based on authentication settings.
320
+ #
321
+ # @param [Hash] header_params Header parameters
322
+ # @param [Hash] query_params Query parameters
323
+ # @param [String] auth_names Authentication scheme name
324
+ def update_params_for_auth!(header_params, query_params, auth_names)
325
+ Array(auth_names).each do |auth_name|
326
+ auth_setting = @config.auth_settings[auth_name]
327
+ next unless auth_setting
328
+ case auth_setting[:in]
329
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
330
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
331
+ else raise ArgumentError, 'Authentication token must be in `query` of `header`'
332
+ end
333
+ end
334
+ end
335
+
336
+ # Sets user agent in HTTP header
337
+ #
338
+ # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
339
+ def user_agent=(user_agent)
340
+ @user_agent = user_agent
341
+ @default_headers['User-Agent'] = @user_agent
342
+ end
343
+
344
+ # Return Accept header based on an array of accepts provided.
345
+ # @param [Array] accepts array for Accept
346
+ # @return [String] the Accept header (e.g. application/json)
347
+ def select_header_accept(accepts)
348
+ return nil if accepts.nil? || accepts.empty?
349
+ # use JSON when present, otherwise use all of the provided
350
+ json_accept = accepts.find { |s| json_mime?(s) }
351
+ return json_accept || accepts.join(',')
352
+ end
353
+
354
+ # Return Content-Type header based on an array of content types provided.
355
+ # @param [Array] content_types array for Content-Type
356
+ # @return [String] the Content-Type header (e.g. application/json)
357
+ def select_header_content_type(content_types)
358
+ # use application/json by default
359
+ return 'application/json' if content_types.nil? || content_types.empty?
360
+ # use JSON when present, otherwise use the first one
361
+ json_content_type = content_types.find { |s| json_mime?(s) }
362
+ return json_content_type || content_types.first
363
+ end
364
+
365
+ # Convert object (array, hash, object, etc) to JSON string.
366
+ # @param [Object] model object to be converted into JSON string
367
+ # @return [String] JSON string representation of the object
368
+ def object_to_http_body(model)
369
+ return '"' + model + '"' if model.is_a?(String)
370
+ return model if model.nil?
371
+ local_body = nil
372
+ if model.is_a?(Array)
373
+ local_body = model.map { |m| object_to_hash(m) }
374
+ else
375
+ local_body = object_to_hash(model)
376
+ end
377
+ local_body.to_json
378
+ end
379
+
380
+ # Convert object(non-array) to hash.
381
+ # @param [Object] obj object to be converted into JSON string
382
+ # @return [String] JSON string representation of the object
383
+ def object_to_hash(obj)
384
+ if obj.respond_to?(:to_hash)
385
+ obj.to_hash
386
+ else
387
+ obj
388
+ end
389
+ end
390
+
391
+ # Build parameter value according to the given collection format.
392
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
393
+ def build_collection_param(param, collection_format)
394
+ case collection_format
395
+ when :csv
396
+ param.join(',')
397
+ when :ssv
398
+ param.join(' ')
399
+ when :tsv
400
+ param.join("\t")
401
+ when :pipes
402
+ param.join('|')
403
+ when :multi
404
+ # return the array directly as faraday will handle it as expected
405
+ param
406
+ else
407
+ raise "unknown collection format: #{collection_format.inspect}"
408
+ end
409
+ end
410
+ end
411
+ end