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.
- checksums.yaml +4 -4
- data/lib/aspose_words_cloud.rb +443 -290
- data/lib/aspose_words_cloud/api/words_api.rb +11506 -19429
- data/lib/aspose_words_cloud/api_client.rb +411 -412
- data/lib/aspose_words_cloud/api_error.rb +58 -58
- data/lib/aspose_words_cloud/configuration.rb +153 -157
- data/lib/aspose_words_cloud/models/available_fonts_response.rb +237 -243
- data/lib/aspose_words_cloud/models/bmp_save_options_data.rb +543 -532
- data/lib/aspose_words_cloud/models/bookmark.rb +221 -226
- data/lib/aspose_words_cloud/models/bookmark_data.rb +211 -217
- data/lib/aspose_words_cloud/models/bookmark_response.rb +211 -216
- data/lib/aspose_words_cloud/models/bookmarks.rb +213 -218
- data/lib/aspose_words_cloud/models/bookmarks_outline_level_data.rb +211 -217
- data/lib/aspose_words_cloud/models/bookmarks_response.rb +211 -216
- data/lib/aspose_words_cloud/models/border.rb +318 -318
- data/lib/aspose_words_cloud/models/border_response.rb +211 -216
- data/lib/aspose_words_cloud/models/borders_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/borders_response.rb +211 -216
- data/lib/aspose_words_cloud/models/classification_response.rb +233 -239
- data/lib/aspose_words_cloud/models/classification_result.rb +211 -217
- data/lib/aspose_words_cloud/models/comment.rb +271 -273
- data/lib/aspose_words_cloud/models/comment_base.rb +54 -58
- data/lib/aspose_words_cloud/models/comment_insert.rb +54 -58
- data/lib/aspose_words_cloud/models/comment_link.rb +201 -206
- data/lib/aspose_words_cloud/models/comment_response.rb +211 -216
- data/lib/aspose_words_cloud/models/comment_update.rb +54 -58
- data/lib/aspose_words_cloud/models/comments_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/comments_response.rb +211 -216
- data/lib/aspose_words_cloud/models/compare_data.rb +231 -236
- data/lib/aspose_words_cloud/models/compare_options.rb +62 -64
- data/lib/aspose_words_cloud/models/csv_data_load_options.rb +45 -51
- data/lib/aspose_words_cloud/models/doc_save_options_data.rb +376 -374
- data/lib/aspose_words_cloud/models/document.rb +294 -295
- data/lib/aspose_words_cloud/models/document_entry.rb +211 -217
- data/lib/aspose_words_cloud/models/document_entry_list.rb +213 -209
- data/lib/aspose_words_cloud/models/document_position.rb +211 -216
- data/lib/aspose_words_cloud/models/document_properties.rb +213 -218
- data/lib/aspose_words_cloud/models/document_properties_response.rb +211 -216
- data/lib/aspose_words_cloud/models/document_property.rb +232 -236
- data/lib/aspose_words_cloud/models/document_property_base.rb +25 -31
- data/lib/aspose_words_cloud/models/document_property_create_or_update.rb +25 -31
- data/lib/aspose_words_cloud/models/document_property_response.rb +211 -216
- data/lib/aspose_words_cloud/models/document_response.rb +211 -216
- data/lib/aspose_words_cloud/models/document_stat_data.rb +243 -248
- data/lib/aspose_words_cloud/models/downsample_options_data.rb +221 -227
- data/lib/aspose_words_cloud/models/drawing_object.rb +386 -385
- data/lib/aspose_words_cloud/models/drawing_object_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/drawing_object_insert.rb +53 -54
- data/lib/aspose_words_cloud/models/drawing_object_link.rb +211 -216
- data/lib/aspose_words_cloud/models/drawing_object_response.rb +211 -216
- data/lib/aspose_words_cloud/models/drawing_object_update.rb +49 -51
- data/lib/aspose_words_cloud/models/drawing_objects_response.rb +211 -216
- data/lib/aspose_words_cloud/models/emf_save_options_data.rb +543 -532
- data/lib/aspose_words_cloud/models/epub_save_options_data.rb +793 -782
- data/lib/aspose_words_cloud/models/error.rb +231 -236
- data/lib/aspose_words_cloud/models/error_details.rb +211 -217
- data/lib/aspose_words_cloud/models/field.rb +241 -246
- data/lib/aspose_words_cloud/models/field_base.rb +26 -32
- data/lib/aspose_words_cloud/models/field_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/field_insert.rb +26 -32
- data/lib/aspose_words_cloud/models/field_link.rb +221 -226
- data/lib/aspose_words_cloud/models/field_names.rb +213 -218
- data/lib/aspose_words_cloud/models/field_names_response.rb +211 -216
- data/lib/aspose_words_cloud/models/field_response.rb +211 -216
- data/lib/aspose_words_cloud/models/field_update.rb +26 -32
- data/lib/aspose_words_cloud/models/fields_response.rb +211 -216
- data/lib/aspose_words_cloud/models/file_link.rb +231 -237
- data/lib/aspose_words_cloud/models/files_list.rb +203 -209
- data/lib/aspose_words_cloud/models/files_upload_result.rb +215 -221
- data/lib/aspose_words_cloud/models/fixed_page_save_options_data.rb +407 -403
- data/lib/aspose_words_cloud/models/font.rb +675 -671
- data/lib/aspose_words_cloud/models/font_info.rb +231 -237
- data/lib/aspose_words_cloud/models/font_response.rb +211 -216
- data/lib/aspose_words_cloud/models/footnote.rb +303 -301
- data/lib/aspose_words_cloud/models/footnote_base.rb +41 -41
- data/lib/aspose_words_cloud/models/footnote_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/footnote_insert.rb +41 -41
- data/lib/aspose_words_cloud/models/footnote_link.rb +211 -216
- data/lib/aspose_words_cloud/models/footnote_response.rb +211 -216
- data/lib/aspose_words_cloud/models/footnote_update.rb +41 -41
- data/lib/aspose_words_cloud/models/footnotes_response.rb +211 -216
- data/lib/aspose_words_cloud/models/footnotes_stat_data.rb +211 -217
- data/lib/aspose_words_cloud/models/form_field.rb +301 -306
- data/lib/aspose_words_cloud/models/form_field_checkbox.rb +331 -336
- data/lib/aspose_words_cloud/models/form_field_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/form_field_drop_down.rb +323 -328
- data/lib/aspose_words_cloud/models/form_field_response.rb +211 -216
- data/lib/aspose_words_cloud/models/form_field_text_input.rb +382 -383
- data/lib/aspose_words_cloud/models/form_fields_response.rb +211 -216
- data/lib/aspose_words_cloud/models/gif_save_options_data.rb +543 -532
- data/lib/aspose_words_cloud/models/graphics_quality_options_data.rb +356 -357
- data/lib/aspose_words_cloud/models/header_footer.rb +284 -283
- data/lib/aspose_words_cloud/models/header_footer_link.rb +252 -253
- data/lib/aspose_words_cloud/models/header_footer_link_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/header_footer_response.rb +211 -216
- data/lib/aspose_words_cloud/models/header_footers_response.rb +211 -216
- data/lib/aspose_words_cloud/models/html_fixed_save_options_data.rb +551 -543
- data/lib/aspose_words_cloud/models/html_save_options_data.rb +783 -772
- data/lib/aspose_words_cloud/models/hyperlink.rb +221 -226
- data/lib/aspose_words_cloud/models/hyperlink_response.rb +211 -216
- data/lib/aspose_words_cloud/models/hyperlinks.rb +213 -218
- data/lib/aspose_words_cloud/models/hyperlinks_response.rb +211 -216
- data/lib/aspose_words_cloud/models/image_save_options_data.rb +543 -532
- data/lib/aspose_words_cloud/models/jpeg_save_options_data.rb +543 -532
- data/lib/aspose_words_cloud/models/link.rb +232 -237
- data/lib/aspose_words_cloud/models/link_element.rb +201 -206
- data/lib/aspose_words_cloud/models/list_format.rb +30 -35
- data/lib/aspose_words_cloud/models/list_format_update.rb +38 -44
- data/lib/aspose_words_cloud/models/list_info.rb +36 -39
- data/lib/aspose_words_cloud/models/list_insert.rb +27 -29
- data/lib/aspose_words_cloud/models/list_level.rb +43 -42
- data/lib/aspose_words_cloud/models/list_level_update.rb +91 -93
- data/lib/aspose_words_cloud/models/list_levels.rb +30 -35
- data/lib/aspose_words_cloud/models/list_response.rb +28 -33
- data/lib/aspose_words_cloud/models/list_update.rb +25 -31
- data/lib/aspose_words_cloud/models/lists.rb +31 -36
- data/lib/aspose_words_cloud/models/lists_response.rb +28 -33
- data/lib/aspose_words_cloud/models/load_web_document_data.rb +211 -216
- data/lib/aspose_words_cloud/models/markdown_save_options_data.rb +419 -0
- data/lib/aspose_words_cloud/models/metafile_rendering_options_data.rb +242 -247
- data/lib/aspose_words_cloud/models/mhtml_save_options_data.rb +793 -782
- data/lib/aspose_words_cloud/models/modification_operation_result.rb +211 -215
- data/lib/aspose_words_cloud/models/node_link.rb +211 -216
- data/lib/aspose_words_cloud/models/odt_save_options_data.rb +391 -390
- data/lib/aspose_words_cloud/models/office_math_link.rb +211 -216
- data/lib/aspose_words_cloud/models/office_math_object.rb +324 -324
- data/lib/aspose_words_cloud/models/office_math_object_response.rb +211 -216
- data/lib/aspose_words_cloud/models/office_math_objects_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/office_math_objects_response.rb +211 -216
- data/lib/aspose_words_cloud/models/ooxml_save_options_data.rb +390 -390
- data/lib/aspose_words_cloud/models/optimization_options.rb +242 -0
- data/lib/aspose_words_cloud/models/outline_options_data.rb +253 -259
- data/lib/aspose_words_cloud/models/page_number.rb +231 -237
- data/lib/aspose_words_cloud/models/page_setup.rb +646 -645
- data/lib/aspose_words_cloud/models/page_stat_data.rb +231 -236
- data/lib/aspose_words_cloud/models/paragraph.rb +223 -228
- data/lib/aspose_words_cloud/models/paragraph_format.rb +587 -576
- data/lib/aspose_words_cloud/models/paragraph_format_base.rb +567 -0
- data/lib/aspose_words_cloud/models/paragraph_format_response.rb +211 -216
- data/lib/aspose_words_cloud/models/paragraph_format_update.rb +567 -0
- data/lib/aspose_words_cloud/models/paragraph_insert.rb +201 -207
- data/lib/aspose_words_cloud/models/paragraph_link.rb +221 -226
- data/lib/aspose_words_cloud/models/paragraph_link_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/paragraph_link_collection_response.rb +211 -216
- data/lib/aspose_words_cloud/models/paragraph_list_format_response.rb +28 -33
- data/lib/aspose_words_cloud/models/paragraph_response.rb +211 -216
- data/lib/aspose_words_cloud/models/pcl_save_options_data.rb +427 -423
- data/lib/aspose_words_cloud/models/pdf_digital_signature_details_data.rb +241 -247
- data/lib/aspose_words_cloud/models/pdf_encryption_details_data.rb +231 -237
- data/lib/aspose_words_cloud/models/pdf_save_options_data.rb +677 -665
- data/lib/aspose_words_cloud/models/png_save_options_data.rb +543 -532
- data/lib/aspose_words_cloud/models/preferred_width.rb +252 -254
- data/lib/aspose_words_cloud/models/protection_data.rb +201 -207
- data/lib/aspose_words_cloud/models/protection_data_response.rb +221 -225
- data/lib/aspose_words_cloud/models/protection_request.rb +221 -227
- data/lib/aspose_words_cloud/models/ps_save_options_data.rb +417 -413
- data/lib/aspose_words_cloud/models/range_document.rb +201 -207
- data/lib/aspose_words_cloud/models/range_text_response.rb +211 -217
- data/lib/aspose_words_cloud/models/replace_range.rb +252 -254
- data/lib/aspose_words_cloud/models/replace_text_parameters.rb +241 -247
- data/lib/aspose_words_cloud/models/replace_text_response.rb +221 -226
- data/lib/aspose_words_cloud/models/report_build_options.rb +25 -5
- data/lib/aspose_words_cloud/models/report_engine_settings.rb +50 -51
- data/lib/aspose_words_cloud/models/requests/accept_all_revisions_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/append_document_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/apply_style_to_document_element_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/build_report_online_request.rb +58 -0
- data/lib/aspose_words_cloud/models/requests/build_report_request.rb +78 -0
- data/lib/aspose_words_cloud/models/requests/classify_document_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/classify_request.rb +48 -0
- data/lib/aspose_words_cloud/models/requests/compare_document_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/convert_document_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/copy_file_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/copy_folder_request.rb +58 -0
- data/lib/aspose_words_cloud/models/requests/copy_style_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/create_document_request.rb +53 -0
- data/lib/aspose_words_cloud/models/requests/create_folder_request.rb +48 -0
- data/lib/aspose_words_cloud/models/requests/create_or_update_document_property_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_all_paragraph_tab_stops_request.rb +78 -0
- data/lib/aspose_words_cloud/models/requests/delete_border_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_borders_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/delete_comment_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/delete_document_property_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/delete_drawing_object_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_field_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_fields_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/delete_file_request.rb +53 -0
- data/lib/aspose_words_cloud/models/requests/delete_folder_request.rb +53 -0
- data/lib/aspose_words_cloud/models/requests/delete_footnote_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_form_field_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_header_footer_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_headers_footers_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_macros_request.rb +78 -0
- data/lib/aspose_words_cloud/models/requests/delete_office_math_object_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_paragraph_list_format_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_paragraph_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_paragraph_tab_stop_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/delete_run_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_section_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/delete_table_cell_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_table_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_table_row_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/delete_watermark_request.rb +78 -0
- data/lib/aspose_words_cloud/models/requests/download_file_request.rb +53 -0
- data/lib/aspose_words_cloud/models/requests/execute_mail_merge_online_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/execute_mail_merge_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/get_available_fonts_request.rb +43 -0
- data/lib/aspose_words_cloud/models/requests/get_bookmark_by_name_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_bookmarks_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/get_border_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_borders_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_comment_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_comments_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/get_document_drawing_object_by_index_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_document_drawing_object_image_data_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_document_drawing_object_ole_data_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_document_drawing_objects_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_document_field_names_online_request.rb +48 -0
- data/lib/aspose_words_cloud/models/requests/get_document_field_names_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_document_hyperlink_by_index_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_document_hyperlinks_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/get_document_properties_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/get_document_property_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_document_protection_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/get_document_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/get_document_statistics_request.rb +78 -0
- data/lib/aspose_words_cloud/models/requests/get_document_with_format_request.rb +78 -0
- data/lib/aspose_words_cloud/models/requests/get_field_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_fields_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_files_list_request.rb +48 -0
- data/lib/aspose_words_cloud/models/requests/get_footnote_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_footnotes_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_form_field_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_form_fields_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_header_footer_of_section_request.rb +78 -0
- data/lib/aspose_words_cloud/models/requests/get_header_footer_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_header_footers_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_list_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_lists_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/get_office_math_object_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_office_math_objects_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_paragraph_format_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_paragraph_list_format_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_paragraph_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_paragraph_tab_stops_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_paragraphs_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_range_text_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_run_font_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_run_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_runs_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_section_page_setup_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_section_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_sections_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/get_style_from_document_element_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_style_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/get_styles_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/get_table_cell_format_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_table_cell_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_table_properties_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_table_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_table_row_format_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_table_row_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/get_tables_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/insert_comment_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/insert_drawing_object_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/insert_field_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/insert_footnote_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/insert_form_field_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/insert_header_footer_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/insert_list_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/insert_or_update_paragraph_tab_stop_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/insert_page_numbers_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/insert_paragraph_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/insert_run_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/insert_style_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/insert_table_cell_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/insert_table_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/insert_table_row_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/insert_watermark_image_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/insert_watermark_text_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/load_web_document_request.rb +48 -0
- data/lib/aspose_words_cloud/models/requests/move_file_request.rb +63 -0
- data/lib/aspose_words_cloud/models/requests/move_folder_request.rb +58 -0
- data/lib/aspose_words_cloud/models/requests/optimize_document_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/protect_document_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/reject_all_revisions_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/remove_range_request.rb +78 -0
- data/lib/aspose_words_cloud/models/requests/render_drawing_object_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/render_math_object_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/render_page_request.rb +78 -0
- data/lib/aspose_words_cloud/models/requests/render_paragraph_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/render_table_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/replace_text_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/replace_with_text_request.rb +83 -0
- data/lib/aspose_words_cloud/models/requests/reset_cache_request.rb +33 -0
- data/lib/aspose_words_cloud/models/requests/save_as_range_request.rb +78 -0
- data/lib/aspose_words_cloud/models/requests/save_as_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/save_as_tiff_request.rb +158 -0
- data/lib/aspose_words_cloud/models/requests/search_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/split_document_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/unprotect_document_request.rb +73 -0
- data/lib/aspose_words_cloud/models/requests/update_bookmark_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/update_border_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/update_comment_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/update_drawing_object_request.rb +98 -0
- data/lib/aspose_words_cloud/models/requests/update_field_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/update_fields_request.rb +68 -0
- data/lib/aspose_words_cloud/models/requests/update_footnote_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/update_form_field_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/update_list_level_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/update_list_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/update_paragraph_format_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/update_paragraph_list_format_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/update_run_font_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/update_run_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/update_section_page_setup_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/update_style_request.rb +88 -0
- data/lib/aspose_words_cloud/models/requests/update_table_cell_format_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/update_table_properties_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/update_table_row_format_request.rb +93 -0
- data/lib/aspose_words_cloud/models/requests/upload_file_request.rb +55 -0
- data/lib/aspose_words_cloud/models/response_error.rb +241 -246
- data/lib/aspose_words_cloud/models/revisions_modification_response.rb +211 -216
- data/lib/aspose_words_cloud/models/rtf_save_options_data.rb +374 -374
- data/lib/aspose_words_cloud/models/run.rb +221 -226
- data/lib/aspose_words_cloud/models/run_base.rb +25 -31
- data/lib/aspose_words_cloud/models/run_insert.rb +25 -31
- data/lib/aspose_words_cloud/models/run_link.rb +221 -226
- data/lib/aspose_words_cloud/models/run_response.rb +211 -216
- data/lib/aspose_words_cloud/models/run_update.rb +25 -31
- data/lib/aspose_words_cloud/models/runs.rb +213 -218
- data/lib/aspose_words_cloud/models/runs_response.rb +211 -216
- data/lib/aspose_words_cloud/models/save_options_data.rb +334 -334
- data/lib/aspose_words_cloud/models/save_response.rb +211 -216
- data/lib/aspose_words_cloud/models/save_result.rb +223 -227
- data/lib/aspose_words_cloud/models/search_response.rb +221 -226
- data/lib/aspose_words_cloud/models/search_result.rb +211 -215
- data/lib/aspose_words_cloud/models/search_results_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/section.rb +253 -254
- data/lib/aspose_words_cloud/models/section_link.rb +211 -216
- data/lib/aspose_words_cloud/models/section_link_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/section_link_collection_response.rb +211 -216
- data/lib/aspose_words_cloud/models/section_page_setup_response.rb +211 -216
- data/lib/aspose_words_cloud/models/section_response.rb +211 -216
- data/lib/aspose_words_cloud/models/shading.rb +29 -29
- data/lib/aspose_words_cloud/models/split_document_response.rb +211 -216
- data/lib/aspose_words_cloud/models/split_document_result.rb +223 -227
- data/lib/aspose_words_cloud/models/stat_data_response.rb +221 -225
- data/lib/aspose_words_cloud/models/storage_file.rb +241 -247
- data/lib/aspose_words_cloud/models/story_child_nodes.rb +203 -209
- data/lib/aspose_words_cloud/models/string_format_data.rb +346 -348
- data/lib/aspose_words_cloud/models/style.rb +38 -38
- data/lib/aspose_words_cloud/models/style_apply.rb +24 -30
- data/lib/aspose_words_cloud/models/style_copy.rb +24 -30
- data/lib/aspose_words_cloud/models/style_insert.rb +26 -28
- data/lib/aspose_words_cloud/models/style_response.rb +28 -33
- data/lib/aspose_words_cloud/models/style_update.rb +38 -44
- data/lib/aspose_words_cloud/models/styles_response.rb +28 -34
- data/lib/aspose_words_cloud/models/svg_save_options_data.rb +467 -463
- data/lib/aspose_words_cloud/models/tab_stop.rb +28 -30
- data/lib/aspose_words_cloud/models/tab_stop_base.rb +26 -28
- data/lib/aspose_words_cloud/models/tab_stop_insert.rb +26 -28
- data/lib/aspose_words_cloud/models/tab_stops_response.rb +28 -34
- data/lib/aspose_words_cloud/models/table.rb +233 -237
- data/lib/aspose_words_cloud/models/table_cell.rb +223 -228
- data/lib/aspose_words_cloud/models/table_cell_format.rb +410 -410
- data/lib/aspose_words_cloud/models/table_cell_format_response.rb +211 -216
- data/lib/aspose_words_cloud/models/table_cell_insert.rb +201 -207
- data/lib/aspose_words_cloud/models/table_cell_response.rb +211 -216
- data/lib/aspose_words_cloud/models/table_insert.rb +221 -226
- data/lib/aspose_words_cloud/models/table_link.rb +211 -216
- data/lib/aspose_words_cloud/models/table_link_collection.rb +213 -218
- data/lib/aspose_words_cloud/models/table_link_collection_response.rb +211 -216
- data/lib/aspose_words_cloud/models/table_properties.rb +431 -430
- data/lib/aspose_words_cloud/models/table_properties_response.rb +211 -216
- data/lib/aspose_words_cloud/models/table_response.rb +211 -216
- data/lib/aspose_words_cloud/models/table_row.rb +233 -237
- data/lib/aspose_words_cloud/models/table_row_format.rb +282 -283
- data/lib/aspose_words_cloud/models/table_row_format_response.rb +211 -216
- data/lib/aspose_words_cloud/models/table_row_insert.rb +211 -217
- data/lib/aspose_words_cloud/models/table_row_response.rb +211 -216
- data/lib/aspose_words_cloud/models/text_save_options_data.rb +423 -420
- data/lib/aspose_words_cloud/models/tiff_save_options_data.rb +574 -562
- data/lib/aspose_words_cloud/models/txt_save_options_base_data.rb +392 -0
- data/lib/aspose_words_cloud/models/watermark_text.rb +211 -217
- data/lib/aspose_words_cloud/models/word_ml_save_options_data.rb +344 -344
- data/lib/aspose_words_cloud/models/words_api_error_response.rb +211 -216
- data/lib/aspose_words_cloud/models/words_api_link.rb +231 -237
- data/lib/aspose_words_cloud/models/words_response.rb +201 -207
- data/lib/aspose_words_cloud/models/xaml_fixed_save_options_data.rb +428 -423
- data/lib/aspose_words_cloud/models/xaml_flow_save_options_data.rb +354 -354
- data/lib/aspose_words_cloud/models/xml_color.rb +211 -217
- data/lib/aspose_words_cloud/models/xps_save_options_data.rb +447 -442
- data/lib/aspose_words_cloud/version.rb +28 -29
- metadata +165 -207
- data/lib/aspose_words_cloud/models/requests/AcceptAllRevisionsRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/AppendDocumentRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/ApplyStyleToDocumentElementRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/BuildReportOnlineRequest.rb +0 -57
- data/lib/aspose_words_cloud/models/requests/BuildReportRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/ClassifyDocumentRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/ClassifyRequest.rb +0 -49
- data/lib/aspose_words_cloud/models/requests/CompareDocumentRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/ConvertDocumentRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/CopyFileRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/CopyFolderRequest.rb +0 -57
- data/lib/aspose_words_cloud/models/requests/CopyStyleRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/CreateDocumentRequest.rb +0 -53
- data/lib/aspose_words_cloud/models/requests/CreateFolderRequest.rb +0 -49
- data/lib/aspose_words_cloud/models/requests/CreateOrUpdateDocumentPropertyRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteAllParagraphTabStopsRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/DeleteAllParagraphTabStopsWithoutNodePathRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/DeleteBorderRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteBordersRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteCommentRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteDocumentPropertyRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteDrawingObjectRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteDrawingObjectWithoutNodePathRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteFieldRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteFieldWithoutNodePathRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteFieldsRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteFieldsWithoutNodePathRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/DeleteFileRequest.rb +0 -53
- data/lib/aspose_words_cloud/models/requests/DeleteFolderRequest.rb +0 -53
- data/lib/aspose_words_cloud/models/requests/DeleteFootnoteRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteFootnoteWithoutNodePathRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteFormFieldRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteFormFieldWithoutNodePathRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteHeaderFooterRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteHeadersFootersRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteMacrosRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/DeleteOfficeMathObjectRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteOfficeMathObjectWithoutNodePathRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteParagraphListFormatRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteParagraphListFormatWithoutNodePathRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteParagraphRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteParagraphTabStopRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteParagraphTabStopWithoutNodePathRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/DeleteParagraphWithoutNodePathRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteRunRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteSectionRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteTableCellRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteTableRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteTableRowRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/DeleteTableWithoutNodePathRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/DeleteWatermarkRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/DownloadFileRequest.rb +0 -53
- data/lib/aspose_words_cloud/models/requests/ExecuteMailMergeOnlineRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/ExecuteMailMergeRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/GetAvailableFontsRequest.rb +0 -45
- data/lib/aspose_words_cloud/models/requests/GetBookmarkByNameRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetBookmarksRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetBorderRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetBordersRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetCommentRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetCommentsRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectByIndexRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectByIndexWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectImageDataRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectImageDataWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectOleDataRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectOleDataWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectsRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetDocumentDrawingObjectsWithoutNodePathRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetDocumentFieldNamesOnlineRequest.rb +0 -49
- data/lib/aspose_words_cloud/models/requests/GetDocumentFieldNamesRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetDocumentHyperlinkByIndexRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetDocumentHyperlinksRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetDocumentPropertiesRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetDocumentPropertyRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetDocumentProtectionRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetDocumentRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetDocumentStatisticsRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/GetDocumentWithFormatRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/GetFieldRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetFieldWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetFieldsRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetFieldsWithoutNodePathRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetFilesListRequest.rb +0 -49
- data/lib/aspose_words_cloud/models/requests/GetFootnoteRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetFootnoteWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetFootnotesRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetFootnotesWithoutNodePathRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetFormFieldRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetFormFieldWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetFormFieldsRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetFormFieldsWithoutNodePathRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetHeaderFooterOfSectionRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/GetHeaderFooterRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetHeaderFootersRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetListRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetListsRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetOfficeMathObjectRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetOfficeMathObjectWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetOfficeMathObjectsRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetOfficeMathObjectsWithoutNodePathRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetParagraphFormatRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetParagraphFormatWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetParagraphListFormatRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetParagraphListFormatWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetParagraphRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetParagraphTabStopsRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetParagraphTabStopsWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetParagraphWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetParagraphsRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetParagraphsWithoutNodePathRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetRangeTextRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetRunFontRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetRunRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetRunsRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetSectionPageSetupRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetSectionRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetSectionsRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetStyleFromDocumentElementRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetStyleRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetStylesRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/GetTableCellFormatRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetTableCellRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetTablePropertiesRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetTablePropertiesWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetTableRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetTableRowFormatRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetTableRowRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/GetTableWithoutNodePathRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetTablesRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/GetTablesWithoutNodePathRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/InsertCommentRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/InsertDrawingObjectRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/InsertDrawingObjectWithoutNodePathRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/InsertFieldRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/InsertFieldWithoutNodePathRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/InsertFootnoteRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/InsertFootnoteWithoutNodePathRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/InsertFormFieldRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/InsertFormFieldWithoutNodePathRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/InsertHeaderFooterRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/InsertListRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/InsertOrUpdateParagraphTabStopRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/InsertOrUpdateParagraphTabStopWithoutNodePathRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/InsertPageNumbersRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/InsertParagraphRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/InsertParagraphWithoutNodePathRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/InsertRunRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/InsertStyleRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/InsertTableCellRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/InsertTableRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/InsertTableRowRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/InsertTableWithoutNodePathRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/InsertWatermarkImageRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/InsertWatermarkTextRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/LoadWebDocumentRequest.rb +0 -49
- data/lib/aspose_words_cloud/models/requests/MoveFileRequest.rb +0 -61
- data/lib/aspose_words_cloud/models/requests/MoveFolderRequest.rb +0 -57
- data/lib/aspose_words_cloud/models/requests/ProtectDocumentRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/RejectAllRevisionsRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/RemoveRangeRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/RenderDrawingObjectRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/RenderDrawingObjectWithoutNodePathRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/RenderMathObjectRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/RenderMathObjectWithoutNodePathRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/RenderPageRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/RenderParagraphRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/RenderParagraphWithoutNodePathRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/RenderTableRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/RenderTableWithoutNodePathRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/ReplaceTextRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/ReplaceWithTextRequest.rb +0 -77
- data/lib/aspose_words_cloud/models/requests/ResetCacheRequest.rb +0 -36
- data/lib/aspose_words_cloud/models/requests/SaveAsRangeRequest.rb +0 -73
- data/lib/aspose_words_cloud/models/requests/SaveAsRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/SaveAsTiffRequest.rb +0 -137
- data/lib/aspose_words_cloud/models/requests/SearchRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/SplitDocumentRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UnprotectDocumentRequest.rb +0 -69
- data/lib/aspose_words_cloud/models/requests/UpdateBookmarkRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/UpdateBorderRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateCommentRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/UpdateDrawingObjectRequest.rb +0 -89
- data/lib/aspose_words_cloud/models/requests/UpdateDrawingObjectWithoutNodePathRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateFieldRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateFieldsRequest.rb +0 -65
- data/lib/aspose_words_cloud/models/requests/UpdateFootnoteRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateFootnoteWithoutNodePathRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/UpdateFormFieldRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateFormFieldWithoutNodePathRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/UpdateListLevelRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateListRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/UpdateParagraphFormatRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateParagraphFormatWithoutNodePathRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/UpdateParagraphListFormatRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateParagraphListFormatWithoutNodePathRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/UpdateRunFontRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateRunRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateSectionPageSetupRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/UpdateStyleRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/UpdateTableCellFormatRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateTablePropertiesRequest.rb +0 -85
- data/lib/aspose_words_cloud/models/requests/UpdateTablePropertiesWithoutNodePathRequest.rb +0 -81
- data/lib/aspose_words_cloud/models/requests/UpdateTableRowFormatRequest.rb +0 -85
- 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)
|
4
|
-
# </copyright>
|
5
|
-
# <summary>
|
6
|
-
#
|
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.
|
70
|
-
raise "
|
71
|
-
end
|
72
|
-
|
73
|
-
if @config.
|
74
|
-
raise "
|
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
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
#
|
292
|
-
#
|
293
|
-
# @param [Hash]
|
294
|
-
# @param [
|
295
|
-
# @
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
#
|
321
|
-
#
|
322
|
-
# @param [Hash]
|
323
|
-
# @param [
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
when '
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
#
|
338
|
-
#
|
339
|
-
|
340
|
-
|
341
|
-
@
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
#
|
346
|
-
# @
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
json_accept
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
#
|
356
|
-
# @
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
json_content_type
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
#
|
367
|
-
# @
|
368
|
-
|
369
|
-
|
370
|
-
return
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
#
|
382
|
-
# @
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
#
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
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
|