aspose_cells_cloud 23.8 → 23.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +4 -1
  3. data/README.md +6 -4
  4. data/lib/aspose_cells_cloud/api/cells_api.rb +25 -2
  5. data/lib/aspose_cells_cloud/models/above_average.rb +3 -3
  6. data/lib/aspose_cells_cloud/models/abstract_calculation_engine.rb +234 -0
  7. data/lib/aspose_cells_cloud/models/{barcode_response.rb → abstract_calculation_monitor.rb} +33 -45
  8. data/lib/aspose_cells_cloud/models/arc_shape.rb +6 -6
  9. data/lib/aspose_cells_cloud/models/area.rb +5 -5
  10. data/lib/aspose_cells_cloud/models/auto_filter.rb +4 -4
  11. data/lib/aspose_cells_cloud/models/auto_fitter_options.rb +68 -8
  12. data/lib/aspose_cells_cloud/models/axis.rb +34 -34
  13. data/lib/aspose_cells_cloud/models/batch_convert_request.rb +7 -7
  14. data/lib/aspose_cells_cloud/models/batch_lock_request.rb +6 -6
  15. data/lib/aspose_cells_cloud/models/batch_protect_request.rb +6 -6
  16. data/lib/aspose_cells_cloud/models/batch_split_request.rb +9 -9
  17. data/lib/aspose_cells_cloud/models/border.rb +4 -4
  18. data/lib/aspose_cells_cloud/models/calculation_options.rb +44 -8
  19. data/lib/aspose_cells_cloud/models/cell.rb +15 -15
  20. data/lib/aspose_cells_cloud/models/cells.rb +4 -4
  21. data/lib/aspose_cells_cloud/models/cells_color.rb +7 -7
  22. data/lib/aspose_cells_cloud/models/chart.rb +43 -43
  23. data/lib/aspose_cells_cloud/models/chart_data_table.rb +8 -8
  24. data/lib/aspose_cells_cloud/models/chart_frame.rb +13 -13
  25. data/lib/aspose_cells_cloud/models/{barcode_response_list.rb → chart_globalization_settings.rb} +2 -2
  26. data/lib/aspose_cells_cloud/models/chart_point.rb +8 -8
  27. data/lib/aspose_cells_cloud/models/check_box.rb +3 -3
  28. data/lib/aspose_cells_cloud/models/color_filter.rb +1 -1
  29. data/lib/aspose_cells_cloud/models/color_filter_request.rb +3 -3
  30. data/lib/aspose_cells_cloud/models/color_scale.rb +6 -6
  31. data/lib/aspose_cells_cloud/models/column.rb +5 -5
  32. data/lib/aspose_cells_cloud/models/combo_box.rb +5 -5
  33. data/lib/aspose_cells_cloud/models/comment.rb +10 -10
  34. data/lib/aspose_cells_cloud/models/comment_shape.rb +1 -1
  35. data/lib/aspose_cells_cloud/models/conditional_formatting_icon.rb +3 -3
  36. data/lib/aspose_cells_cloud/models/conditional_formatting_value.rb +3 -3
  37. data/lib/aspose_cells_cloud/models/copy_options.rb +6 -6
  38. data/lib/aspose_cells_cloud/models/create_pivot_table_request.rb +7 -7
  39. data/lib/aspose_cells_cloud/models/custom_filter.rb +2 -2
  40. data/lib/aspose_cells_cloud/models/custom_parser_config.rb +2 -2
  41. data/lib/aspose_cells_cloud/models/data_bar.rb +12 -12
  42. data/lib/aspose_cells_cloud/models/data_bar_border.rb +2 -2
  43. data/lib/aspose_cells_cloud/models/data_labels.rb +13 -13
  44. data/lib/aspose_cells_cloud/models/data_sorter.rb +21 -9
  45. data/lib/aspose_cells_cloud/models/data_sorter_key.rb +270 -0
  46. data/lib/aspose_cells_cloud/models/date_time_group_item.rb +7 -7
  47. data/lib/aspose_cells_cloud/models/digital_signature.rb +8 -8
  48. data/lib/aspose_cells_cloud/models/display_unit_label.rb +1 -1
  49. data/lib/aspose_cells_cloud/models/drop_bars.rb +2 -2
  50. data/lib/aspose_cells_cloud/models/dynamic_filter.rb +3 -3
  51. data/lib/aspose_cells_cloud/models/error_bar.rb +6 -6
  52. data/lib/aspose_cells_cloud/models/fill_format.rb +6 -6
  53. data/lib/aspose_cells_cloud/models/filter_column.rb +3 -3
  54. data/lib/aspose_cells_cloud/models/floor.rb +1 -1
  55. data/lib/aspose_cells_cloud/models/font.rb +10 -10
  56. data/lib/aspose_cells_cloud/models/font_setting.rb +5 -5
  57. data/lib/aspose_cells_cloud/models/format_condition.rb +14 -14
  58. data/lib/aspose_cells_cloud/models/formula_format_condition.rb +3 -3
  59. data/lib/aspose_cells_cloud/models/formula_settings.rb +330 -0
  60. data/lib/aspose_cells_cloud/models/globalization_settings.rb +258 -0
  61. data/lib/aspose_cells_cloud/models/gradient_fill.rb +4 -4
  62. data/lib/aspose_cells_cloud/models/group_box.rb +1 -1
  63. data/lib/aspose_cells_cloud/models/horizontal_page_break.rb +3 -3
  64. data/lib/aspose_cells_cloud/models/html_save_options.rb +30 -30
  65. data/lib/aspose_cells_cloud/models/hyperlink.rb +5 -5
  66. data/lib/aspose_cells_cloud/models/icon_filter.rb +2 -2
  67. data/lib/aspose_cells_cloud/models/icon_set.rb +5 -5
  68. data/lib/aspose_cells_cloud/models/image_or_print_options.rb +8 -8
  69. data/lib/aspose_cells_cloud/models/image_save_options.rb +12 -12
  70. data/lib/aspose_cells_cloud/models/import_picture_option.rb +1 -1
  71. data/lib/aspose_cells_cloud/models/json_save_options.rb +4 -4
  72. data/lib/aspose_cells_cloud/models/label.rb +1 -1
  73. data/lib/aspose_cells_cloud/models/legend.rb +2 -2
  74. data/lib/aspose_cells_cloud/models/legend_entry.rb +4 -4
  75. data/lib/aspose_cells_cloud/models/line.rb +19 -19
  76. data/lib/aspose_cells_cloud/models/line_format.rb +11 -11
  77. data/lib/aspose_cells_cloud/models/line_shape.rb +6 -6
  78. data/lib/aspose_cells_cloud/models/list_box.rb +6 -6
  79. data/lib/aspose_cells_cloud/models/list_column.rb +20 -8
  80. data/lib/aspose_cells_cloud/models/list_object.rb +88 -16
  81. data/lib/aspose_cells_cloud/models/load_options.rb +8 -8
  82. data/lib/aspose_cells_cloud/models/m_html_save_options.rb +12 -12
  83. data/lib/aspose_cells_cloud/models/markdown_save_options.rb +3 -3
  84. data/lib/aspose_cells_cloud/models/marker.rb +4 -4
  85. data/lib/aspose_cells_cloud/models/match_condition_request.rb +2 -2
  86. data/lib/aspose_cells_cloud/models/name.rb +6 -6
  87. data/lib/aspose_cells_cloud/models/negative_bar_format.rb +4 -4
  88. data/lib/aspose_cells_cloud/models/ole_object.rb +7 -7
  89. data/lib/aspose_cells_cloud/models/ooxml_save_options.rb +5 -5
  90. data/lib/aspose_cells_cloud/models/page_setup.rb +34 -34
  91. data/lib/aspose_cells_cloud/models/password_request.rb +1 -1
  92. data/lib/aspose_cells_cloud/models/paste_options.rb +4 -4
  93. data/lib/aspose_cells_cloud/models/pattern_fill.rb +7 -7
  94. data/lib/aspose_cells_cloud/models/pdf_save_options.rb +19 -19
  95. data/lib/aspose_cells_cloud/models/pic_format_option.rb +6 -6
  96. data/lib/aspose_cells_cloud/models/picture.rb +5 -5
  97. data/lib/aspose_cells_cloud/models/pivot_globalization_settings.rb +198 -0
  98. data/lib/aspose_cells_cloud/models/pivot_table_field_request.rb +1 -1
  99. data/lib/aspose_cells_cloud/models/plot_area.rb +4 -4
  100. data/lib/aspose_cells_cloud/models/{protect_workbook_requst.rb → protect_workbook_request.rb} +18 -18
  101. data/lib/aspose_cells_cloud/models/protection.rb +17 -17
  102. data/lib/aspose_cells_cloud/models/query_table.rb +258 -0
  103. data/lib/aspose_cells_cloud/models/radio_button.rb +3 -3
  104. data/lib/aspose_cells_cloud/models/range.rb +9 -9
  105. data/lib/aspose_cells_cloud/models/range_copy_request.rb +4 -4
  106. data/lib/aspose_cells_cloud/models/range_set_outline_border_request.rb +4 -4
  107. data/lib/aspose_cells_cloud/models/range_set_style_request.rb +2 -2
  108. data/lib/aspose_cells_cloud/models/range_sort_request.rb +222 -0
  109. data/lib/aspose_cells_cloud/models/row.rb +7 -7
  110. data/lib/aspose_cells_cloud/models/save_options.rb +4 -4
  111. data/lib/aspose_cells_cloud/models/scroll_bar.rb +7 -7
  112. data/lib/aspose_cells_cloud/models/series.rb +47 -47
  113. data/lib/aspose_cells_cloud/models/shadow_effect.rb +7 -7
  114. data/lib/aspose_cells_cloud/models/shape.rb +36 -36
  115. data/lib/aspose_cells_cloud/models/solid_fill.rb +3 -3
  116. data/lib/aspose_cells_cloud/models/sparkline.rb +3 -3
  117. data/lib/aspose_cells_cloud/models/sparkline_group.rb +27 -27
  118. data/lib/aspose_cells_cloud/models/spinner.rb +5 -5
  119. data/lib/aspose_cells_cloud/models/split_result_response.rb +1 -1
  120. data/lib/aspose_cells_cloud/models/split_workbook_task_parameter.rb +3 -3
  121. data/lib/aspose_cells_cloud/models/sql_script_save_options.rb +14 -14
  122. data/lib/aspose_cells_cloud/models/style.rb +22 -22
  123. data/lib/aspose_cells_cloud/models/svg_save_options.rb +1 -1
  124. data/lib/aspose_cells_cloud/models/table_total_request.rb +3 -3
  125. data/lib/aspose_cells_cloud/models/text_format_condition.rb +1 -1
  126. data/lib/aspose_cells_cloud/models/text_water_marker_request.rb +4 -4
  127. data/lib/aspose_cells_cloud/models/texture_fill.rb +5 -5
  128. data/lib/aspose_cells_cloud/models/theme_color.rb +2 -2
  129. data/lib/aspose_cells_cloud/models/tick_labels.rb +11 -11
  130. data/lib/aspose_cells_cloud/models/tile_pic_option.rb +6 -6
  131. data/lib/aspose_cells_cloud/models/time_period_format_condition.rb +1 -1
  132. data/lib/aspose_cells_cloud/models/title.rb +2 -2
  133. data/lib/aspose_cells_cloud/models/top10.rb +3 -3
  134. data/lib/aspose_cells_cloud/models/top10_filter.rb +4 -4
  135. data/lib/aspose_cells_cloud/models/trendline.rb +12 -12
  136. data/lib/aspose_cells_cloud/models/txt_save_options.rb +4 -4
  137. data/lib/aspose_cells_cloud/models/validation.rb +16 -16
  138. data/lib/aspose_cells_cloud/models/vertical_page_break.rb +3 -3
  139. data/lib/aspose_cells_cloud/models/walls.rb +5 -5
  140. data/lib/aspose_cells_cloud/models/workbook.rb +4 -4
  141. data/lib/aspose_cells_cloud/models/workbook_protection_request.rb +1 -1
  142. data/lib/aspose_cells_cloud/models/workbook_settings.rb +263 -47
  143. data/lib/aspose_cells_cloud/models/worksheet.rb +29 -29
  144. data/lib/aspose_cells_cloud/models/worksheet_operate_parameter.rb +1 -1
  145. data/lib/aspose_cells_cloud/models/write_protection.rb +246 -0
  146. data/lib/aspose_cells_cloud/models/xml_data_binding.rb +210 -0
  147. data/lib/aspose_cells_cloud/models/xml_map.rb +234 -0
  148. data/lib/aspose_cells_cloud/requests/delete_un_protect_workbook_request.rb +9 -9
  149. data/lib/aspose_cells_cloud/requests/post_protect_request.rb +9 -9
  150. data/lib/aspose_cells_cloud/requests/post_protect_workbook_request.rb +9 -9
  151. data/lib/aspose_cells_cloud/requests/post_worksheet_cells_range_sort_request.rb +138 -0
  152. data/lib/aspose_cells_cloud/requests/{post_worksheet_cells_ranges_request.rb → post_worksheet_cells_ranges_copy_request.rb} +8 -8
  153. data/lib/aspose_cells_cloud/requests/post_worksheet_list_object_insert_slicer_request.rb +159 -0
  154. data/lib/aspose_cells_cloud/requests/post_worksheet_list_object_remove_duplicates_request.rb +137 -0
  155. data/lib/aspose_cells_cloud/version.rb +1 -1
  156. data/lib/aspose_cells_cloud.rb +28 -16
  157. data/spec/api/list_objects_controller_spec.rb +36 -0
  158. data/spec/api/pivot_tables_controller_spec.rb +3 -3
  159. data/spec/api/ranges_controller_spec.rb +24 -3
  160. data/spec/api/workbook_controller_spec.rb +3 -4
  161. data/spec/document/light_cells_spec.rb +17 -3
  162. data/spec/{onecase_spec.rb → one_case_spec.rb} +3 -5
  163. metadata +20 -8
  164. data/lib/aspose_cells_cloud/models/spreadsheet_m_l2003_save_options.rb +0 -330
@@ -33,67 +33,67 @@ module AsposeCellsCloud
33
33
  class Worksheet
34
34
  #
35
35
  attr_accessor :links
36
- #Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.
36
+ #Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.
37
37
  attr_accessor :display_right_to_left
38
- #True if zero values are displayed.
38
+ #True if zero values are displayed.
39
39
  attr_accessor :display_zeros
40
- #Represents first visible column index.
40
+ #Represents first visible column index.
41
41
  attr_accessor :first_visible_column
42
- #Represents first visible row index.
42
+ #Represents first visible row index.
43
43
  attr_accessor :first_visible_row
44
- #Gets or sets the name of the worksheet.
44
+ #Gets or sets the name of the worksheet.
45
45
  attr_accessor :name
46
- #Gets the index of sheet in the worksheets collection.
46
+ #Gets the index of sheet in the worksheet collection.
47
47
  attr_accessor :index
48
- #Gets or sets a value indicating whether the gridelines are visible.Default is true.
48
+ #Gets or sets a value indicating whether the gridlines are visible.Default is true.
49
49
  attr_accessor :is_gridlines_visible
50
- #Indicates whether show outline.
50
+ #Indicates whether to show outline.
51
51
  attr_accessor :is_outline_shown
52
- #Indications the specified worksheet is shown in normal view or page break preview.
52
+ #Indicates whether the specified worksheet is shown in normal view or page break preview.
53
53
  attr_accessor :is_page_break_preview
54
- #Represents if the worksheet is visible.
54
+ #Represents if the worksheet is visible.
55
55
  attr_accessor :is_visible
56
- #Indicates if the worksheet is protected.
56
+ #Indicates if the worksheet is protected.
57
57
  attr_accessor :is_protected
58
- #Gets or sets a value indicating whether the worksheet will display row and column headers.Default is true.
58
+ #Gets or sets a value indicating whether the worksheet will display row and column headers. Default is true.
59
59
  attr_accessor :is_row_column_headers_visible
60
- #Indicates whether the ruler is visible. Only apply for page break preview.
60
+ #Indicates whether the ruler is visible. This property is only applied for page break preview.
61
61
  attr_accessor :is_ruler_visible
62
- #Indicates whether this worksheet is selected when the workbook is opened.
62
+ #Indicates whether this worksheet is selected when the workbook is opened.
63
63
  attr_accessor :is_selected
64
- #Represents worksheet tab color.
64
+ #Represents worksheet tab color.
65
65
  attr_accessor :tab_color
66
- #Flag indicating whether the Transition Formula Entry (Lotus compatibility) option is enabled.
66
+ #Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled.
67
67
  attr_accessor :transition_entry
68
- #Flag indicating whether the Transition Formula Evaluation (Lotus compatibility) option is enabled.
68
+ #Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled.
69
69
  attr_accessor :transition_evaluation
70
- #Represents worksheet type
70
+ #Represents worksheet type.
71
71
  attr_accessor :type
72
- #Gets and sets the view type.
72
+ #Gets and sets the view type.
73
73
  attr_accessor :view_type
74
- #Indicates the state for this sheet visibility
74
+ #Indicates the visible state for this sheet.
75
75
  attr_accessor :visibility_type
76
- #Represents the scaling factor in percent. It should be btween 10 and 400.
76
+ #Represents the scaling factor in percentage. It should be between 10 and 400.
77
77
  attr_accessor :zoom
78
- #
78
+ #Gets the collection.
79
79
  attr_accessor :cells
80
- #
80
+ #Gets a collection
81
81
  attr_accessor :charts
82
82
  #
83
83
  attr_accessor :auto_shapes
84
- #
84
+ #Represents a collection of in a worksheet.
85
85
  attr_accessor :ole_objects
86
- #
86
+ #Gets the collection.
87
87
  attr_accessor :comments
88
- #
88
+ #Gets a collection.
89
89
  attr_accessor :pictures
90
90
  #
91
91
  attr_accessor :merged_cells
92
- #
92
+ #Gets the data validation setting collection in the worksheet.
93
93
  attr_accessor :validations
94
- #
94
+ #Gets the ConditionalFormattings in the worksheet.
95
95
  attr_accessor :conditional_formattings
96
- #
96
+ #Gets the collection.
97
97
  attr_accessor :hyperlinks
98
98
 
99
99
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -35,7 +35,7 @@ module AsposeCellsCloud
35
35
  attr_accessor :name
36
36
  #
37
37
  attr_accessor :sheet_type
38
- #
38
+ #rename worksheet name
39
39
  attr_accessor :new_name
40
40
  #
41
41
  attr_accessor :moving_request
@@ -0,0 +1,246 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ <copyright company="Aspose" file="WriteProtectionrb.cs">
4
+ Copyright (c) 2023 Aspose.Cells Cloud
5
+ </copyright>
6
+ <summary>
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
24
+ </summary>
25
+ --------------------------------------------------------------------------------------------------------------------
26
+ =end
27
+
28
+
29
+ require 'date'
30
+
31
+ module AsposeCellsCloud
32
+
33
+ class WriteProtection
34
+ #Gets and sets the author.
35
+ attr_accessor :author
36
+ #Indicates if the Read Only Recommended option is selected.
37
+ attr_accessor :recommend_read_only
38
+ #Indicates whether this workbook is write protected.
39
+ attr_accessor :is_write_protected
40
+ #Sets the protected password to modify the file.
41
+ attr_accessor :password
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'author' => :'Author',
47
+ :'recommend_read_only' => :'RecommendReadOnly',
48
+ :'is_write_protected' => :'IsWriteProtected',
49
+ :'password' => :'Password'
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ :'author' => :'String',
57
+ :'recommend_read_only' => :'BOOLEAN',
58
+ :'is_write_protected' => :'BOOLEAN',
59
+ :'password' => :'String'
60
+ }
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ return unless attributes.is_a?(Hash)
67
+
68
+ # convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
70
+
71
+ if attributes.has_key?(:'Author')
72
+ self.author = attributes[:'Author']
73
+ end
74
+ if attributes.has_key?(:'RecommendReadOnly')
75
+ self.recommend_read_only = attributes[:'RecommendReadOnly']
76
+ end
77
+ if attributes.has_key?(:'IsWriteProtected')
78
+ self.is_write_protected = attributes[:'IsWriteProtected']
79
+ end
80
+ if attributes.has_key?(:'Password')
81
+ self.password = attributes[:'Password']
82
+ end
83
+
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properies with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ if @author.nil?
91
+ invalid_properties.push("invalid value for 'author', author cannot be nil.")
92
+ end
93
+ if @recommend_read_only.nil?
94
+ invalid_properties.push("invalid value for 'recommend_read_only', recommend_read_only cannot be nil.")
95
+ end
96
+ if @is_write_protected.nil?
97
+ invalid_properties.push("invalid value for 'is_write_protected', is_write_protected cannot be nil.")
98
+ end
99
+ if @password.nil?
100
+ invalid_properties.push("invalid value for 'password', password cannot be nil.")
101
+ end
102
+
103
+ return invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ return false if @author.nil?
110
+ return false if @recommend_read_only.nil?
111
+ return false if @is_write_protected.nil?
112
+ return false if @password.nil?
113
+ return true
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ author == o.author &&
122
+ recommend_read_only == o.recommend_read_only &&
123
+ is_write_protected == o.is_write_protected &&
124
+ password == o.password
125
+ std_dev == o.std_dev
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Fixnum] Hash code
136
+ def hash
137
+ [ author , recommend_read_only , is_write_protected , password ].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ self.class.swagger_types.each_pair do |key, type|
146
+ if type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :DateTime
167
+ DateTime.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :BOOLEAN
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ temp_model = AsposeCellsCloud.const_get(type).new
198
+ temp_model.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ next if value.nil?
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map{ |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+
244
+ end
245
+
246
+ end
@@ -0,0 +1,210 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ <copyright company="Aspose" file="XmlDataBindingrb.cs">
4
+ Copyright (c) 2023 Aspose.Cells Cloud
5
+ </copyright>
6
+ <summary>
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
24
+ </summary>
25
+ --------------------------------------------------------------------------------------------------------------------
26
+ =end
27
+
28
+
29
+ require 'date'
30
+
31
+ module AsposeCellsCloud
32
+
33
+ class XmlDataBinding
34
+ #Gets source url of this data binding.
35
+ attr_accessor :url
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'url' => :'Url'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'url' => :'String'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
58
+
59
+ if attributes.has_key?(:'Url')
60
+ self.url = attributes[:'Url']
61
+ end
62
+
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properies with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ if @url.nil?
70
+ invalid_properties.push("invalid value for 'url', url cannot be nil.")
71
+ end
72
+
73
+ return invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if @url.nil?
80
+ return true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ url == o.url
89
+ std_dev == o.std_dev
90
+ end
91
+
92
+ # @see the `==` method
93
+ # @param [Object] Object to be compared
94
+ def eql?(o)
95
+ self == o
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Fixnum] Hash code
100
+ def hash
101
+ [ url ].hash
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.swagger_types.each_pair do |key, type|
110
+ if type =~ /\AArray<(.*)>/i
111
+ # check to ensure the input is an array given that the the attribute
112
+ # is documented as an array but the input is not
113
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
114
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
115
+ end
116
+ elsif !attributes[self.class.attribute_map[key]].nil?
117
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
119
+ end
120
+
121
+ self
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def _deserialize(type, value)
129
+ case type.to_sym
130
+ when :DateTime
131
+ DateTime.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :BOOLEAN
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ temp_model = AsposeCellsCloud.const_get(type).new
162
+ temp_model.build_from_hash(value)
163
+ end
164
+ end
165
+
166
+ # Returns the string representation of the object
167
+ # @return [String] String presentation of the object
168
+ def to_s
169
+ to_hash.to_s
170
+ end
171
+
172
+ # to_body is an alias to to_hash (backward compatibility)
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_body
175
+ to_hash
176
+ end
177
+
178
+ # Returns the object in the form of hash
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_hash
181
+ hash = {}
182
+ self.class.attribute_map.each_pair do |attr, param|
183
+ value = self.send(attr)
184
+ next if value.nil?
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map{ |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+
208
+ end
209
+
210
+ end