aspose_cells_cloud 20.11 → 20.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +116 -0
- data/lib/aspose_cells_cloud.rb +296 -0
- data/lib/aspose_cells_cloud/api/cells_api.rb +19867 -0
- data/lib/aspose_cells_cloud/api_client.rb +493 -0
- data/lib/aspose_cells_cloud/api_error.rb +48 -0
- data/lib/aspose_cells_cloud/configuration.rb +178 -0
- data/lib/aspose_cells_cloud/models/above_average.rb +234 -0
- data/lib/aspose_cells_cloud/models/access_token_response.rb +261 -0
- data/lib/aspose_cells_cloud/models/area.rb +243 -0
- data/lib/aspose_cells_cloud/models/auto_filter.rb +227 -0
- data/lib/aspose_cells_cloud/models/auto_filter_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/auto_fitter_options.rb +231 -0
- data/lib/aspose_cells_cloud/models/auto_shape.rb +504 -0
- data/lib/aspose_cells_cloud/models/auto_shape_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/auto_shapes.rb +209 -0
- data/lib/aspose_cells_cloud/models/auto_shapes_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/border.rb +216 -0
- data/lib/aspose_cells_cloud/models/calculation_options.rb +225 -0
- data/lib/aspose_cells_cloud/models/cell.rb +401 -0
- data/lib/aspose_cells_cloud/models/cell_area.rb +245 -0
- data/lib/aspose_cells_cloud/models/cell_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/cell_value.rb +234 -0
- data/lib/aspose_cells_cloud/models/cells.rb +270 -0
- data/lib/aspose_cells_cloud/models/cells_cloud_file_info.rb +230 -0
- data/lib/aspose_cells_cloud/models/cells_cloud_response.rb +212 -0
- data/lib/aspose_cells_cloud/models/cells_color.rb +234 -0
- data/lib/aspose_cells_cloud/models/cells_document_properties.rb +209 -0
- data/lib/aspose_cells_cloud/models/cells_document_properties_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/cells_document_property.rb +225 -0
- data/lib/aspose_cells_cloud/models/cells_document_property_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/cells_error.rb +229 -0
- data/lib/aspose_cells_cloud/models/cells_object_operate_task_parameter.rb +216 -0
- data/lib/aspose_cells_cloud/models/cells_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/chart.rb +626 -0
- data/lib/aspose_cells_cloud/models/chart_area.rb +317 -0
- data/lib/aspose_cells_cloud/models/chart_area_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/chart_frame.rb +317 -0
- data/lib/aspose_cells_cloud/models/chart_operate_parameter.rb +279 -0
- data/lib/aspose_cells_cloud/models/charts.rb +209 -0
- data/lib/aspose_cells_cloud/models/charts_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/color.rb +245 -0
- data/lib/aspose_cells_cloud/models/color_filter.rb +234 -0
- data/lib/aspose_cells_cloud/models/color_filter_request.rb +216 -0
- data/lib/aspose_cells_cloud/models/color_scale.rb +249 -0
- data/lib/aspose_cells_cloud/models/column.rb +243 -0
- data/lib/aspose_cells_cloud/models/column_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/columns.rb +237 -0
- data/lib/aspose_cells_cloud/models/columns_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/comment.rb +297 -0
- data/lib/aspose_cells_cloud/models/comment_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/comments.rb +209 -0
- data/lib/aspose_cells_cloud/models/comments_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/conditional_formatting.rb +218 -0
- data/lib/aspose_cells_cloud/models/conditional_formatting_icon.rb +235 -0
- data/lib/aspose_cells_cloud/models/conditional_formatting_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/conditional_formatting_value.rb +219 -0
- data/lib/aspose_cells_cloud/models/conditional_formattings.rb +223 -0
- data/lib/aspose_cells_cloud/models/conditional_formattings_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/convert_task_parameter.rb +216 -0
- data/lib/aspose_cells_cloud/models/copy_options.rb +248 -0
- data/lib/aspose_cells_cloud/models/create_pivot_table_request.rb +263 -0
- data/lib/aspose_cells_cloud/models/custom_filter.rb +207 -0
- data/lib/aspose_cells_cloud/models/custom_parser_config.rb +216 -0
- data/lib/aspose_cells_cloud/models/data_bar.rb +309 -0
- data/lib/aspose_cells_cloud/models/data_bar_border.rb +209 -0
- data/lib/aspose_cells_cloud/models/data_sorter.rb +227 -0
- data/lib/aspose_cells_cloud/models/dif_save_options.rb +265 -0
- data/lib/aspose_cells_cloud/models/disc_usage.rb +219 -0
- data/lib/aspose_cells_cloud/models/dynamic_filter.rb +216 -0
- data/lib/aspose_cells_cloud/models/error_details.rb +214 -0
- data/lib/aspose_cells_cloud/models/file_source.rb +207 -0
- data/lib/aspose_cells_cloud/models/file_version.rb +274 -0
- data/lib/aspose_cells_cloud/models/file_versions.rb +201 -0
- data/lib/aspose_cells_cloud/models/files_list.rb +201 -0
- data/lib/aspose_cells_cloud/models/files_upload_result.rb +213 -0
- data/lib/aspose_cells_cloud/models/fill_format.rb +259 -0
- data/lib/aspose_cells_cloud/models/fill_format_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/filter_column.rb +277 -0
- data/lib/aspose_cells_cloud/models/font.rb +279 -0
- data/lib/aspose_cells_cloud/models/font_setting.rb +244 -0
- data/lib/aspose_cells_cloud/models/format_condition.rb +327 -0
- data/lib/aspose_cells_cloud/models/gradient_fill.rb +227 -0
- data/lib/aspose_cells_cloud/models/gradient_fill_stop.rb +226 -0
- data/lib/aspose_cells_cloud/models/horizontal_page_break.rb +231 -0
- data/lib/aspose_cells_cloud/models/horizontal_page_break_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/horizontal_page_breaks.rb +209 -0
- data/lib/aspose_cells_cloud/models/horizontal_page_breaks_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/html_save_options.rb +373 -0
- data/lib/aspose_cells_cloud/models/hyperlink.rb +234 -0
- data/lib/aspose_cells_cloud/models/hyperlink_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/hyperlinks.rb +223 -0
- data/lib/aspose_cells_cloud/models/hyperlinks_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/icon_filter.rb +212 -0
- data/lib/aspose_cells_cloud/models/icon_set.rb +253 -0
- data/lib/aspose_cells_cloud/models/image_save_options.rb +373 -0
- data/lib/aspose_cells_cloud/models/import_batch_data_option.rb +236 -0
- data/lib/aspose_cells_cloud/models/import_csv_data_option.rb +281 -0
- data/lib/aspose_cells_cloud/models/import_data_task_parameter.rb +216 -0
- data/lib/aspose_cells_cloud/models/import_double_array_option.rb +263 -0
- data/lib/aspose_cells_cloud/models/import_int_array_option.rb +263 -0
- data/lib/aspose_cells_cloud/models/import_option.rb +225 -0
- data/lib/aspose_cells_cloud/models/import_string_array_option.rb +263 -0
- data/lib/aspose_cells_cloud/models/legend.rb +335 -0
- data/lib/aspose_cells_cloud/models/legend_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/line.rb +360 -0
- data/lib/aspose_cells_cloud/models/line_format.rb +358 -0
- data/lib/aspose_cells_cloud/models/line_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/link.rb +225 -0
- data/lib/aspose_cells_cloud/models/link_element.rb +198 -0
- data/lib/aspose_cells_cloud/models/list_column.rb +209 -0
- data/lib/aspose_cells_cloud/models/list_object.rb +350 -0
- data/lib/aspose_cells_cloud/models/list_object_operate_parameter.rb +207 -0
- data/lib/aspose_cells_cloud/models/list_object_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/list_objects.rb +209 -0
- data/lib/aspose_cells_cloud/models/list_objects_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/m_html_save_options.rb +373 -0
- data/lib/aspose_cells_cloud/models/markdown_save_options.rb +292 -0
- data/lib/aspose_cells_cloud/models/merged_cell.rb +254 -0
- data/lib/aspose_cells_cloud/models/merged_cell_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/merged_cells.rb +223 -0
- data/lib/aspose_cells_cloud/models/merged_cells_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/multiple_filter.rb +189 -0
- data/lib/aspose_cells_cloud/models/multiple_filters.rb +209 -0
- data/lib/aspose_cells_cloud/models/name.rb +276 -0
- data/lib/aspose_cells_cloud/models/name_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/names.rb +223 -0
- data/lib/aspose_cells_cloud/models/names_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/negative_bar_format.rb +229 -0
- data/lib/aspose_cells_cloud/models/object_exist.rb +219 -0
- data/lib/aspose_cells_cloud/models/ods_save_options.rb +265 -0
- data/lib/aspose_cells_cloud/models/ole_object.rb +567 -0
- data/lib/aspose_cells_cloud/models/ole_object_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/ole_objects.rb +209 -0
- data/lib/aspose_cells_cloud/models/ole_objects_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/ooxml_save_options.rb +274 -0
- data/lib/aspose_cells_cloud/models/operate_object.rb +207 -0
- data/lib/aspose_cells_cloud/models/operate_object_position.rb +243 -0
- data/lib/aspose_cells_cloud/models/operate_parameter.rb +198 -0
- data/lib/aspose_cells_cloud/models/page_break_operate_parameter.rb +252 -0
- data/lib/aspose_cells_cloud/models/page_section.rb +259 -0
- data/lib/aspose_cells_cloud/models/page_sections_response.rb +223 -0
- data/lib/aspose_cells_cloud/models/page_setup.rb +542 -0
- data/lib/aspose_cells_cloud/models/page_setup_operate_parameter.rb +207 -0
- data/lib/aspose_cells_cloud/models/page_setup_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/password_request.rb +198 -0
- data/lib/aspose_cells_cloud/models/paste_options.rb +225 -0
- data/lib/aspose_cells_cloud/models/pattern_fill.rb +252 -0
- data/lib/aspose_cells_cloud/models/pdf_save_options.rb +355 -0
- data/lib/aspose_cells_cloud/models/pdf_security_options.rb +283 -0
- data/lib/aspose_cells_cloud/models/pic_format_option.rb +243 -0
- data/lib/aspose_cells_cloud/models/picture.rb +558 -0
- data/lib/aspose_cells_cloud/models/picture_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/pictures.rb +209 -0
- data/lib/aspose_cells_cloud/models/pictures_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/pivot_field.rb +546 -0
- data/lib/aspose_cells_cloud/models/pivot_field_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/pivot_filter.rb +279 -0
- data/lib/aspose_cells_cloud/models/pivot_filter_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/pivot_filters_response.rb +223 -0
- data/lib/aspose_cells_cloud/models/pivot_item.rb +228 -0
- data/lib/aspose_cells_cloud/models/pivot_table.rb +824 -0
- data/lib/aspose_cells_cloud/models/pivot_table_field_request.rb +200 -0
- data/lib/aspose_cells_cloud/models/pivot_table_operate_parameter.rb +276 -0
- data/lib/aspose_cells_cloud/models/pivot_table_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/pivot_tables.rb +209 -0
- data/lib/aspose_cells_cloud/models/pivot_tables_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/protect_sheet_parameter.rb +335 -0
- data/lib/aspose_cells_cloud/models/range.rb +309 -0
- data/lib/aspose_cells_cloud/models/range_copy_request.rb +225 -0
- data/lib/aspose_cells_cloud/models/range_set_outline_border_request.rb +225 -0
- data/lib/aspose_cells_cloud/models/range_set_style_request.rb +207 -0
- data/lib/aspose_cells_cloud/models/range_value_response.rb +223 -0
- data/lib/aspose_cells_cloud/models/ranges.rb +200 -0
- data/lib/aspose_cells_cloud/models/ranges_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/result_destination.rb +216 -0
- data/lib/aspose_cells_cloud/models/row.rb +261 -0
- data/lib/aspose_cells_cloud/models/row_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/rows.rb +237 -0
- data/lib/aspose_cells_cloud/models/rows_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/save_options.rb +265 -0
- data/lib/aspose_cells_cloud/models/save_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/save_result.rb +200 -0
- data/lib/aspose_cells_cloud/models/save_result_task_parameter.rb +207 -0
- data/lib/aspose_cells_cloud/models/shadow_effect.rb +252 -0
- data/lib/aspose_cells_cloud/models/shape.rb +504 -0
- data/lib/aspose_cells_cloud/models/shape_operate_parameter.rb +207 -0
- data/lib/aspose_cells_cloud/models/shape_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/shapes.rb +209 -0
- data/lib/aspose_cells_cloud/models/shapes_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/single_value.rb +207 -0
- data/lib/aspose_cells_cloud/models/single_value_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/smart_marker_task_parameter.rb +216 -0
- data/lib/aspose_cells_cloud/models/solid_fill.rb +216 -0
- data/lib/aspose_cells_cloud/models/sort_key.rb +221 -0
- data/lib/aspose_cells_cloud/models/sparkline.rb +226 -0
- data/lib/aspose_cells_cloud/models/sparkline_group.rb +434 -0
- data/lib/aspose_cells_cloud/models/sparkline_group_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/sparkline_groups.rb +200 -0
- data/lib/aspose_cells_cloud/models/sparkline_groups_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/split_result.rb +200 -0
- data/lib/aspose_cells_cloud/models/split_result_document.rb +212 -0
- data/lib/aspose_cells_cloud/models/split_result_response.rb +222 -0
- data/lib/aspose_cells_cloud/models/split_workbook_task_parameter.rb +243 -0
- data/lib/aspose_cells_cloud/models/spreadsheet_ml2003_save_options.rb +292 -0
- data/lib/aspose_cells_cloud/models/storage_exist.rb +204 -0
- data/lib/aspose_cells_cloud/models/storage_file.rb +249 -0
- data/lib/aspose_cells_cloud/models/style.rb +407 -0
- data/lib/aspose_cells_cloud/models/style_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/svg_save_options.rb +274 -0
- data/lib/aspose_cells_cloud/models/task_data.rb +200 -0
- data/lib/aspose_cells_cloud/models/task_description.rb +207 -0
- data/lib/aspose_cells_cloud/models/task_parameter.rb +189 -0
- data/lib/aspose_cells_cloud/models/text_item.rb +207 -0
- data/lib/aspose_cells_cloud/models/text_items.rb +209 -0
- data/lib/aspose_cells_cloud/models/text_items_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/text_options.rb +333 -0
- data/lib/aspose_cells_cloud/models/text_water_marker_request.rb +239 -0
- data/lib/aspose_cells_cloud/models/texture_fill.rb +243 -0
- data/lib/aspose_cells_cloud/models/theme_color.rb +207 -0
- data/lib/aspose_cells_cloud/models/tile_pic_option.rb +263 -0
- data/lib/aspose_cells_cloud/models/title.rb +380 -0
- data/lib/aspose_cells_cloud/models/title_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/top10.rb +219 -0
- data/lib/aspose_cells_cloud/models/top10_filter.rb +240 -0
- data/lib/aspose_cells_cloud/models/txt_save_options.rb +301 -0
- data/lib/aspose_cells_cloud/models/validation.rb +360 -0
- data/lib/aspose_cells_cloud/models/validation_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/validations.rb +223 -0
- data/lib/aspose_cells_cloud/models/validations_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/value_type.rb +189 -0
- data/lib/aspose_cells_cloud/models/vertical_page_break.rb +231 -0
- data/lib/aspose_cells_cloud/models/vertical_page_break_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/vertical_page_breaks.rb +209 -0
- data/lib/aspose_cells_cloud/models/vertical_page_breaks_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/workbook.rb +290 -0
- data/lib/aspose_cells_cloud/models/workbook_encryption_request.rb +224 -0
- data/lib/aspose_cells_cloud/models/workbook_operate_parameter.rb +198 -0
- data/lib/aspose_cells_cloud/models/workbook_protection_request.rb +209 -0
- data/lib/aspose_cells_cloud/models/workbook_replace_response.rb +235 -0
- data/lib/aspose_cells_cloud/models/workbook_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/workbook_settings.rb +626 -0
- data/lib/aspose_cells_cloud/models/workbook_settings_operate_parameter.rb +207 -0
- data/lib/aspose_cells_cloud/models/workbook_settings_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/worksheet.rb +510 -0
- data/lib/aspose_cells_cloud/models/worksheet_moving_request.rb +209 -0
- data/lib/aspose_cells_cloud/models/worksheet_replace_response.rb +235 -0
- data/lib/aspose_cells_cloud/models/worksheet_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/worksheets.rb +209 -0
- data/lib/aspose_cells_cloud/models/worksheets_response.rb +221 -0
- data/lib/aspose_cells_cloud/models/xls_save_options.rb +265 -0
- data/lib/aspose_cells_cloud/models/xlsb_save_options.rb +265 -0
- data/lib/aspose_cells_cloud/models/xps_save_options.rb +265 -0
- data/lib/aspose_cells_cloud/version.rb +25 -0
- data/spec/api/cells_api_spec.rb +1145 -0
- data/spec/api/cells_auto_filter_api_spec.rb +430 -0
- data/spec/api/cells_chart_area_api_spec.rb +92 -0
- data/spec/api/cells_charts_api_spec.rb +390 -0
- data/spec/api/cells_conditional_formattings_api_spec.rb +259 -0
- data/spec/api/cells_hypelinks_api_spec.rb +170 -0
- data/spec/api/cells_list_objects_api_spec.rb +245 -0
- data/spec/api/cells_ole_objects_api_spec.rb +177 -0
- data/spec/api/cells_page_breaks_api_spec.rb +269 -0
- data/spec/api/cells_page_setup_api_spec.rb +198 -0
- data/spec/api/cells_pictures_api_spec.rb +174 -0
- data/spec/api/cells_pivot_tables_api_spec.rb +525 -0
- data/spec/api/cells_properties_api_spec.rb +129 -0
- data/spec/api/cells_ranges_api_spec.rb +284 -0
- data/spec/api/cells_save_as_api_spec.rb +74 -0
- data/spec/api/cells_shapes_api_spec.rb +174 -0
- data/spec/api/cells_simple_spec.rb +44 -0
- data/spec/api/cells_sparkline_group_spec.rb +43 -0
- data/spec/api/cells_storage_api_spec.rb +69 -0
- data/spec/api/cells_storage_spec.rb +45 -0
- data/spec/api/cells_task_api_spec.rb +61 -0
- data/spec/api/cells_workbook_api_spec.rb +641 -0
- data/spec/api/cells_worksheet_validations_api_spec.rb +139 -0
- data/spec/api/cells_worksheets_api_spec.rb +843 -0
- data/spec/spec_helper.rb +132 -0
- metadata +282 -3
@@ -0,0 +1,355 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2020 Aspose.Cells Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
|
21
|
+
=end
|
22
|
+
|
23
|
+
require 'date'
|
24
|
+
|
25
|
+
module AsposeCellsCloud
|
26
|
+
|
27
|
+
class PdfSaveOptions
|
28
|
+
attr_accessor :enable_http_compression
|
29
|
+
|
30
|
+
attr_accessor :save_format
|
31
|
+
|
32
|
+
# Make the workbook empty after saving the file.
|
33
|
+
attr_accessor :clear_data
|
34
|
+
|
35
|
+
# The cached file folder is used to store some large data.
|
36
|
+
attr_accessor :cached_file_folder
|
37
|
+
|
38
|
+
# Indicates whether validate merged areas before saving the file. The default value is false.
|
39
|
+
attr_accessor :validate_merged_areas
|
40
|
+
|
41
|
+
attr_accessor :refresh_chart_cache
|
42
|
+
|
43
|
+
# If true and the directory does not exist, the directory will be automatically created before saving the file.
|
44
|
+
attr_accessor :create_directory
|
45
|
+
|
46
|
+
attr_accessor :sort_names
|
47
|
+
|
48
|
+
attr_accessor :calculate_formula
|
49
|
+
|
50
|
+
attr_accessor :check_font_compatibility
|
51
|
+
|
52
|
+
attr_accessor :one_page_per_sheet
|
53
|
+
|
54
|
+
attr_accessor :compliance
|
55
|
+
|
56
|
+
attr_accessor :default_font
|
57
|
+
|
58
|
+
attr_accessor :printing_page_type
|
59
|
+
|
60
|
+
attr_accessor :image_type
|
61
|
+
|
62
|
+
attr_accessor :desired_ppi
|
63
|
+
|
64
|
+
attr_accessor :jpeg_quality
|
65
|
+
|
66
|
+
attr_accessor :security_options
|
67
|
+
|
68
|
+
|
69
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
70
|
+
def self.attribute_map
|
71
|
+
{
|
72
|
+
:'enable_http_compression' => :'EnableHTTPCompression',
|
73
|
+
:'save_format' => :'SaveFormat',
|
74
|
+
:'clear_data' => :'ClearData',
|
75
|
+
:'cached_file_folder' => :'CachedFileFolder',
|
76
|
+
:'validate_merged_areas' => :'ValidateMergedAreas',
|
77
|
+
:'refresh_chart_cache' => :'RefreshChartCache',
|
78
|
+
:'create_directory' => :'CreateDirectory',
|
79
|
+
:'sort_names' => :'SortNames',
|
80
|
+
:'calculate_formula' => :'CalculateFormula',
|
81
|
+
:'check_font_compatibility' => :'CheckFontCompatibility',
|
82
|
+
:'one_page_per_sheet' => :'OnePagePerSheet',
|
83
|
+
:'compliance' => :'Compliance',
|
84
|
+
:'default_font' => :'DefaultFont',
|
85
|
+
:'printing_page_type' => :'PrintingPageType',
|
86
|
+
:'image_type' => :'ImageType',
|
87
|
+
:'desired_ppi' => :'desiredPPI',
|
88
|
+
:'jpeg_quality' => :'jpegQuality',
|
89
|
+
:'security_options' => :'SecurityOptions'
|
90
|
+
}
|
91
|
+
end
|
92
|
+
|
93
|
+
# Attribute type mapping.
|
94
|
+
def self.swagger_types
|
95
|
+
{
|
96
|
+
:'enable_http_compression' => :'BOOLEAN',
|
97
|
+
:'save_format' => :'String',
|
98
|
+
:'clear_data' => :'BOOLEAN',
|
99
|
+
:'cached_file_folder' => :'String',
|
100
|
+
:'validate_merged_areas' => :'BOOLEAN',
|
101
|
+
:'refresh_chart_cache' => :'BOOLEAN',
|
102
|
+
:'create_directory' => :'BOOLEAN',
|
103
|
+
:'sort_names' => :'BOOLEAN',
|
104
|
+
:'calculate_formula' => :'BOOLEAN',
|
105
|
+
:'check_font_compatibility' => :'BOOLEAN',
|
106
|
+
:'one_page_per_sheet' => :'BOOLEAN',
|
107
|
+
:'compliance' => :'String',
|
108
|
+
:'default_font' => :'String',
|
109
|
+
:'printing_page_type' => :'String',
|
110
|
+
:'image_type' => :'String',
|
111
|
+
:'desired_ppi' => :'Integer',
|
112
|
+
:'jpeg_quality' => :'Integer',
|
113
|
+
:'security_options' => :'PdfSecurityOptions'
|
114
|
+
}
|
115
|
+
end
|
116
|
+
|
117
|
+
# Initializes the object
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
def initialize(attributes = {})
|
120
|
+
return unless attributes.is_a?(Hash)
|
121
|
+
|
122
|
+
# convert string to symbol for hash key
|
123
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
124
|
+
|
125
|
+
if attributes.has_key?(:'EnableHTTPCompression')
|
126
|
+
self.enable_http_compression = attributes[:'EnableHTTPCompression']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.has_key?(:'SaveFormat')
|
130
|
+
self.save_format = attributes[:'SaveFormat']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.has_key?(:'ClearData')
|
134
|
+
self.clear_data = attributes[:'ClearData']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.has_key?(:'CachedFileFolder')
|
138
|
+
self.cached_file_folder = attributes[:'CachedFileFolder']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.has_key?(:'ValidateMergedAreas')
|
142
|
+
self.validate_merged_areas = attributes[:'ValidateMergedAreas']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.has_key?(:'RefreshChartCache')
|
146
|
+
self.refresh_chart_cache = attributes[:'RefreshChartCache']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.has_key?(:'CreateDirectory')
|
150
|
+
self.create_directory = attributes[:'CreateDirectory']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.has_key?(:'SortNames')
|
154
|
+
self.sort_names = attributes[:'SortNames']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.has_key?(:'CalculateFormula')
|
158
|
+
self.calculate_formula = attributes[:'CalculateFormula']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.has_key?(:'CheckFontCompatibility')
|
162
|
+
self.check_font_compatibility = attributes[:'CheckFontCompatibility']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.has_key?(:'OnePagePerSheet')
|
166
|
+
self.one_page_per_sheet = attributes[:'OnePagePerSheet']
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.has_key?(:'Compliance')
|
170
|
+
self.compliance = attributes[:'Compliance']
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.has_key?(:'DefaultFont')
|
174
|
+
self.default_font = attributes[:'DefaultFont']
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.has_key?(:'PrintingPageType')
|
178
|
+
self.printing_page_type = attributes[:'PrintingPageType']
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.has_key?(:'ImageType')
|
182
|
+
self.image_type = attributes[:'ImageType']
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.has_key?(:'desiredPPI')
|
186
|
+
self.desired_ppi = attributes[:'desiredPPI']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.has_key?(:'jpegQuality')
|
190
|
+
self.jpeg_quality = attributes[:'jpegQuality']
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.has_key?(:'SecurityOptions')
|
194
|
+
self.security_options = attributes[:'SecurityOptions']
|
195
|
+
end
|
196
|
+
|
197
|
+
end
|
198
|
+
|
199
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
200
|
+
# @return Array for valid properies with the reasons
|
201
|
+
def list_invalid_properties
|
202
|
+
invalid_properties = Array.new
|
203
|
+
return invalid_properties
|
204
|
+
end
|
205
|
+
|
206
|
+
# Check to see if the all the properties in the model are valid
|
207
|
+
# @return true if the model is valid
|
208
|
+
def valid?
|
209
|
+
return true
|
210
|
+
end
|
211
|
+
|
212
|
+
# Checks equality by comparing each attribute.
|
213
|
+
# @param [Object] Object to be compared
|
214
|
+
def ==(o)
|
215
|
+
return true if self.equal?(o)
|
216
|
+
self.class == o.class &&
|
217
|
+
enable_http_compression == o.enable_http_compression &&
|
218
|
+
save_format == o.save_format &&
|
219
|
+
clear_data == o.clear_data &&
|
220
|
+
cached_file_folder == o.cached_file_folder &&
|
221
|
+
validate_merged_areas == o.validate_merged_areas &&
|
222
|
+
refresh_chart_cache == o.refresh_chart_cache &&
|
223
|
+
create_directory == o.create_directory &&
|
224
|
+
sort_names == o.sort_names &&
|
225
|
+
calculate_formula == o.calculate_formula &&
|
226
|
+
check_font_compatibility == o.check_font_compatibility &&
|
227
|
+
one_page_per_sheet == o.one_page_per_sheet &&
|
228
|
+
compliance == o.compliance &&
|
229
|
+
default_font == o.default_font &&
|
230
|
+
printing_page_type == o.printing_page_type &&
|
231
|
+
image_type == o.image_type &&
|
232
|
+
desired_ppi == o.desired_ppi &&
|
233
|
+
jpeg_quality == o.jpeg_quality &&
|
234
|
+
security_options == o.security_options
|
235
|
+
end
|
236
|
+
|
237
|
+
# @see the `==` method
|
238
|
+
# @param [Object] Object to be compared
|
239
|
+
def eql?(o)
|
240
|
+
self == o
|
241
|
+
end
|
242
|
+
|
243
|
+
# Calculates hash code according to all attributes.
|
244
|
+
# @return [Fixnum] Hash code
|
245
|
+
def hash
|
246
|
+
[enable_http_compression, save_format, clear_data, cached_file_folder, validate_merged_areas, refresh_chart_cache, create_directory, sort_names, calculate_formula, check_font_compatibility, one_page_per_sheet, compliance, default_font, printing_page_type, image_type, desired_ppi, jpeg_quality, security_options].hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Builds the object from hash
|
250
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
251
|
+
# @return [Object] Returns the model itself
|
252
|
+
def build_from_hash(attributes)
|
253
|
+
return nil unless attributes.is_a?(Hash)
|
254
|
+
self.class.swagger_types.each_pair do |key, type|
|
255
|
+
if type =~ /\AArray<(.*)>/i
|
256
|
+
# check to ensure the input is an array given that the the attribute
|
257
|
+
# is documented as an array but the input is not
|
258
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
259
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
260
|
+
end
|
261
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
262
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
263
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
264
|
+
end
|
265
|
+
|
266
|
+
self
|
267
|
+
end
|
268
|
+
|
269
|
+
# Deserializes the data based on type
|
270
|
+
# @param string type Data type
|
271
|
+
# @param string value Value to be deserialized
|
272
|
+
# @return [Object] Deserialized data
|
273
|
+
def _deserialize(type, value)
|
274
|
+
case type.to_sym
|
275
|
+
when :DateTime
|
276
|
+
DateTime.parse(value)
|
277
|
+
when :Date
|
278
|
+
Date.parse(value)
|
279
|
+
when :String
|
280
|
+
value.to_s
|
281
|
+
when :Integer
|
282
|
+
value.to_i
|
283
|
+
when :Float
|
284
|
+
value.to_f
|
285
|
+
when :BOOLEAN
|
286
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
287
|
+
true
|
288
|
+
else
|
289
|
+
false
|
290
|
+
end
|
291
|
+
when :Object
|
292
|
+
# generic object (usually a Hash), return directly
|
293
|
+
value
|
294
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
295
|
+
inner_type = Regexp.last_match[:inner_type]
|
296
|
+
value.map { |v| _deserialize(inner_type, v) }
|
297
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
298
|
+
k_type = Regexp.last_match[:k_type]
|
299
|
+
v_type = Regexp.last_match[:v_type]
|
300
|
+
{}.tap do |hash|
|
301
|
+
value.each do |k, v|
|
302
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
303
|
+
end
|
304
|
+
end
|
305
|
+
else # model
|
306
|
+
temp_model = AsposeCellsCloud.const_get(type).new
|
307
|
+
temp_model.build_from_hash(value)
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
# Returns the string representation of the object
|
312
|
+
# @return [String] String presentation of the object
|
313
|
+
def to_s
|
314
|
+
to_hash.to_s
|
315
|
+
end
|
316
|
+
|
317
|
+
# to_body is an alias to to_hash (backward compatibility)
|
318
|
+
# @return [Hash] Returns the object in the form of hash
|
319
|
+
def to_body
|
320
|
+
to_hash
|
321
|
+
end
|
322
|
+
|
323
|
+
# Returns the object in the form of hash
|
324
|
+
# @return [Hash] Returns the object in the form of hash
|
325
|
+
def to_hash
|
326
|
+
hash = {}
|
327
|
+
self.class.attribute_map.each_pair do |attr, param|
|
328
|
+
value = self.send(attr)
|
329
|
+
next if value.nil?
|
330
|
+
hash[param] = _to_hash(value)
|
331
|
+
end
|
332
|
+
hash
|
333
|
+
end
|
334
|
+
|
335
|
+
# Outputs non-array value in the form of hash
|
336
|
+
# For object, use to_hash. Otherwise, just return the value
|
337
|
+
# @param [Object] value Any valid value
|
338
|
+
# @return [Hash] Returns the value in the form of hash
|
339
|
+
def _to_hash(value)
|
340
|
+
if value.is_a?(Array)
|
341
|
+
value.compact.map{ |v| _to_hash(v) }
|
342
|
+
elsif value.is_a?(Hash)
|
343
|
+
{}.tap do |hash|
|
344
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
345
|
+
end
|
346
|
+
elsif value.respond_to? :to_hash
|
347
|
+
value.to_hash
|
348
|
+
else
|
349
|
+
value
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
end
|
354
|
+
|
355
|
+
end
|
@@ -0,0 +1,283 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2020 Aspose.Cells Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
|
21
|
+
=end
|
22
|
+
|
23
|
+
require 'date'
|
24
|
+
|
25
|
+
module AsposeCellsCloud
|
26
|
+
|
27
|
+
class PdfSecurityOptions
|
28
|
+
attr_accessor :annotations_permission
|
29
|
+
|
30
|
+
attr_accessor :assemble_document_permission
|
31
|
+
|
32
|
+
# Make the workbook empty after saving the file.
|
33
|
+
attr_accessor :extract_content_permission
|
34
|
+
|
35
|
+
# The cached file folder is used to store some large data.
|
36
|
+
attr_accessor :extract_content_permission_obsolete
|
37
|
+
|
38
|
+
# Indicates whether validate merged areas before saving the file. The default value is false.
|
39
|
+
attr_accessor :fill_forms_permission
|
40
|
+
|
41
|
+
attr_accessor :full_quality_print_permission
|
42
|
+
|
43
|
+
# If true and the directory does not exist, the directory will be automatically created before saving the file.
|
44
|
+
attr_accessor :modify_document_permission
|
45
|
+
|
46
|
+
attr_accessor :owner_password
|
47
|
+
|
48
|
+
attr_accessor :print_permission
|
49
|
+
|
50
|
+
attr_accessor :user_password
|
51
|
+
|
52
|
+
|
53
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
54
|
+
def self.attribute_map
|
55
|
+
{
|
56
|
+
:'annotations_permission' => :'AnnotationsPermission',
|
57
|
+
:'assemble_document_permission' => :'AssembleDocumentPermission',
|
58
|
+
:'extract_content_permission' => :'ExtractContentPermission',
|
59
|
+
:'extract_content_permission_obsolete' => :'ExtractContentPermissionObsolete',
|
60
|
+
:'fill_forms_permission' => :'FillFormsPermission',
|
61
|
+
:'full_quality_print_permission' => :'FullQualityPrintPermission',
|
62
|
+
:'modify_document_permission' => :'ModifyDocumentPermission',
|
63
|
+
:'owner_password' => :'OwnerPassword',
|
64
|
+
:'print_permission' => :'PrintPermission',
|
65
|
+
:'user_password' => :'UserPassword'
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
# Attribute type mapping.
|
70
|
+
def self.swagger_types
|
71
|
+
{
|
72
|
+
:'annotations_permission' => :'BOOLEAN',
|
73
|
+
:'assemble_document_permission' => :'BOOLEAN',
|
74
|
+
:'extract_content_permission' => :'BOOLEAN',
|
75
|
+
:'extract_content_permission_obsolete' => :'BOOLEAN',
|
76
|
+
:'fill_forms_permission' => :'BOOLEAN',
|
77
|
+
:'full_quality_print_permission' => :'BOOLEAN',
|
78
|
+
:'modify_document_permission' => :'BOOLEAN',
|
79
|
+
:'owner_password' => :'String',
|
80
|
+
:'print_permission' => :'BOOLEAN',
|
81
|
+
:'user_password' => :'String'
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
# Initializes the object
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
87
|
+
def initialize(attributes = {})
|
88
|
+
return unless attributes.is_a?(Hash)
|
89
|
+
|
90
|
+
# convert string to symbol for hash key
|
91
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
92
|
+
|
93
|
+
if attributes.has_key?(:'AnnotationsPermission')
|
94
|
+
self.annotations_permission = attributes[:'AnnotationsPermission']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.has_key?(:'AssembleDocumentPermission')
|
98
|
+
self.assemble_document_permission = attributes[:'AssembleDocumentPermission']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.has_key?(:'ExtractContentPermission')
|
102
|
+
self.extract_content_permission = attributes[:'ExtractContentPermission']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.has_key?(:'ExtractContentPermissionObsolete')
|
106
|
+
self.extract_content_permission_obsolete = attributes[:'ExtractContentPermissionObsolete']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.has_key?(:'FillFormsPermission')
|
110
|
+
self.fill_forms_permission = attributes[:'FillFormsPermission']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.has_key?(:'FullQualityPrintPermission')
|
114
|
+
self.full_quality_print_permission = attributes[:'FullQualityPrintPermission']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.has_key?(:'ModifyDocumentPermission')
|
118
|
+
self.modify_document_permission = attributes[:'ModifyDocumentPermission']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.has_key?(:'OwnerPassword')
|
122
|
+
self.owner_password = attributes[:'OwnerPassword']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.has_key?(:'PrintPermission')
|
126
|
+
self.print_permission = attributes[:'PrintPermission']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.has_key?(:'UserPassword')
|
130
|
+
self.user_password = attributes[:'UserPassword']
|
131
|
+
end
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
136
|
+
# @return Array for valid properies with the reasons
|
137
|
+
def list_invalid_properties
|
138
|
+
invalid_properties = Array.new
|
139
|
+
return invalid_properties
|
140
|
+
end
|
141
|
+
|
142
|
+
# Check to see if the all the properties in the model are valid
|
143
|
+
# @return true if the model is valid
|
144
|
+
def valid?
|
145
|
+
return true
|
146
|
+
end
|
147
|
+
|
148
|
+
# Checks equality by comparing each attribute.
|
149
|
+
# @param [Object] Object to be compared
|
150
|
+
def ==(o)
|
151
|
+
return true if self.equal?(o)
|
152
|
+
self.class == o.class &&
|
153
|
+
annotations_permission == o.annotations_permission &&
|
154
|
+
assemble_document_permission == o.assemble_document_permission &&
|
155
|
+
extract_content_permission == o.extract_content_permission &&
|
156
|
+
extract_content_permission_obsolete == o.extract_content_permission_obsolete &&
|
157
|
+
fill_forms_permission == o.fill_forms_permission &&
|
158
|
+
full_quality_print_permission == o.full_quality_print_permission &&
|
159
|
+
modify_document_permission == o.modify_document_permission &&
|
160
|
+
owner_password == o.owner_password &&
|
161
|
+
print_permission == o.print_permission &&
|
162
|
+
user_password == o.user_password
|
163
|
+
end
|
164
|
+
|
165
|
+
# @see the `==` method
|
166
|
+
# @param [Object] Object to be compared
|
167
|
+
def eql?(o)
|
168
|
+
self == o
|
169
|
+
end
|
170
|
+
|
171
|
+
# Calculates hash code according to all attributes.
|
172
|
+
# @return [Fixnum] Hash code
|
173
|
+
def hash
|
174
|
+
[annotations_permission, assemble_document_permission, extract_content_permission, extract_content_permission_obsolete, fill_forms_permission, full_quality_print_permission, modify_document_permission, owner_password, print_permission, user_password].hash
|
175
|
+
end
|
176
|
+
|
177
|
+
# Builds the object from hash
|
178
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
179
|
+
# @return [Object] Returns the model itself
|
180
|
+
def build_from_hash(attributes)
|
181
|
+
return nil unless attributes.is_a?(Hash)
|
182
|
+
self.class.swagger_types.each_pair do |key, type|
|
183
|
+
if type =~ /\AArray<(.*)>/i
|
184
|
+
# check to ensure the input is an array given that the the attribute
|
185
|
+
# is documented as an array but the input is not
|
186
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
187
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
188
|
+
end
|
189
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
190
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
191
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
192
|
+
end
|
193
|
+
|
194
|
+
self
|
195
|
+
end
|
196
|
+
|
197
|
+
# Deserializes the data based on type
|
198
|
+
# @param string type Data type
|
199
|
+
# @param string value Value to be deserialized
|
200
|
+
# @return [Object] Deserialized data
|
201
|
+
def _deserialize(type, value)
|
202
|
+
case type.to_sym
|
203
|
+
when :DateTime
|
204
|
+
DateTime.parse(value)
|
205
|
+
when :Date
|
206
|
+
Date.parse(value)
|
207
|
+
when :String
|
208
|
+
value.to_s
|
209
|
+
when :Integer
|
210
|
+
value.to_i
|
211
|
+
when :Float
|
212
|
+
value.to_f
|
213
|
+
when :BOOLEAN
|
214
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
215
|
+
true
|
216
|
+
else
|
217
|
+
false
|
218
|
+
end
|
219
|
+
when :Object
|
220
|
+
# generic object (usually a Hash), return directly
|
221
|
+
value
|
222
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
223
|
+
inner_type = Regexp.last_match[:inner_type]
|
224
|
+
value.map { |v| _deserialize(inner_type, v) }
|
225
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
226
|
+
k_type = Regexp.last_match[:k_type]
|
227
|
+
v_type = Regexp.last_match[:v_type]
|
228
|
+
{}.tap do |hash|
|
229
|
+
value.each do |k, v|
|
230
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
231
|
+
end
|
232
|
+
end
|
233
|
+
else # model
|
234
|
+
temp_model = AsposeCellsCloud.const_get(type).new
|
235
|
+
temp_model.build_from_hash(value)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
# Returns the string representation of the object
|
240
|
+
# @return [String] String presentation of the object
|
241
|
+
def to_s
|
242
|
+
to_hash.to_s
|
243
|
+
end
|
244
|
+
|
245
|
+
# to_body is an alias to to_hash (backward compatibility)
|
246
|
+
# @return [Hash] Returns the object in the form of hash
|
247
|
+
def to_body
|
248
|
+
to_hash
|
249
|
+
end
|
250
|
+
|
251
|
+
# Returns the object in the form of hash
|
252
|
+
# @return [Hash] Returns the object in the form of hash
|
253
|
+
def to_hash
|
254
|
+
hash = {}
|
255
|
+
self.class.attribute_map.each_pair do |attr, param|
|
256
|
+
value = self.send(attr)
|
257
|
+
next if value.nil?
|
258
|
+
hash[param] = _to_hash(value)
|
259
|
+
end
|
260
|
+
hash
|
261
|
+
end
|
262
|
+
|
263
|
+
# Outputs non-array value in the form of hash
|
264
|
+
# For object, use to_hash. Otherwise, just return the value
|
265
|
+
# @param [Object] value Any valid value
|
266
|
+
# @return [Hash] Returns the value in the form of hash
|
267
|
+
def _to_hash(value)
|
268
|
+
if value.is_a?(Array)
|
269
|
+
value.compact.map{ |v| _to_hash(v) }
|
270
|
+
elsif value.is_a?(Hash)
|
271
|
+
{}.tap do |hash|
|
272
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
273
|
+
end
|
274
|
+
elsif value.respond_to? :to_hash
|
275
|
+
value.to_hash
|
276
|
+
else
|
277
|
+
value
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
end
|
282
|
+
|
283
|
+
end
|