aspose_slides_cloud 20.2.0 → 20.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/TestData/ChartTest.pptx +0 -0
  4. data/lib/aspose_slides_cloud.rb +13 -3
  5. data/lib/aspose_slides_cloud/api/slides_api.rb +3254 -1024
  6. data/lib/aspose_slides_cloud/api/slides_api_requests.rb +970 -137
  7. data/lib/aspose_slides_cloud/api_client.rb +8 -5
  8. data/lib/aspose_slides_cloud/models/add_layout_slide.rb +31 -48
  9. data/lib/aspose_slides_cloud/models/add_master_slide.rb +31 -48
  10. data/lib/aspose_slides_cloud/models/add_shape.rb +31 -48
  11. data/lib/aspose_slides_cloud/models/add_slide.rb +31 -48
  12. data/lib/aspose_slides_cloud/models/api_info.rb +22 -10
  13. data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +22 -10
  14. data/lib/aspose_slides_cloud/models/audio_frame.rb +32 -244
  15. data/lib/aspose_slides_cloud/models/axes.rb +22 -10
  16. data/lib/aspose_slides_cloud/models/axis.rb +22 -10
  17. data/lib/aspose_slides_cloud/models/base64_input_file.rb +31 -57
  18. data/lib/aspose_slides_cloud/models/blur_effect.rb +22 -10
  19. data/lib/aspose_slides_cloud/models/box_and_whisker_series.rb +299 -0
  20. data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +30 -48
  21. data/lib/aspose_slides_cloud/models/bubble_series.rb +31 -211
  22. data/lib/aspose_slides_cloud/models/chart.rb +35 -221
  23. data/lib/aspose_slides_cloud/models/chart_category.rb +261 -0
  24. data/lib/aspose_slides_cloud/models/chart_title.rb +22 -10
  25. data/lib/aspose_slides_cloud/models/chart_wall.rb +22 -10
  26. data/lib/aspose_slides_cloud/models/color_scheme.rb +30 -40
  27. data/lib/aspose_slides_cloud/models/common_slide_view_properties.rb +217 -0
  28. data/lib/aspose_slides_cloud/models/connector.rb +31 -242
  29. data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +22 -10
  30. data/lib/aspose_slides_cloud/models/disc_usage.rb +22 -10
  31. data/lib/aspose_slides_cloud/models/document.rb +41 -41
  32. data/lib/aspose_slides_cloud/models/document_properties.rb +30 -40
  33. data/lib/aspose_slides_cloud/models/document_property.rb +30 -40
  34. data/lib/aspose_slides_cloud/models/document_replace_result.rb +32 -86
  35. data/lib/aspose_slides_cloud/models/effect.rb +22 -10
  36. data/lib/aspose_slides_cloud/models/effect_format.rb +22 -10
  37. data/lib/aspose_slides_cloud/models/entity_exists.rb +212 -0
  38. data/lib/aspose_slides_cloud/models/error.rb +22 -10
  39. data/lib/aspose_slides_cloud/models/error_details.rb +22 -10
  40. data/lib/aspose_slides_cloud/models/export_format.rb +1 -0
  41. data/lib/aspose_slides_cloud/models/export_options.rb +33 -11
  42. data/lib/aspose_slides_cloud/models/file_version.rb +30 -75
  43. data/lib/aspose_slides_cloud/models/file_versions.rb +22 -10
  44. data/lib/aspose_slides_cloud/models/files_list.rb +22 -10
  45. data/lib/aspose_slides_cloud/models/files_upload_result.rb +22 -10
  46. data/lib/aspose_slides_cloud/models/fill_format.rb +22 -10
  47. data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +22 -10
  48. data/lib/aspose_slides_cloud/models/font_scheme.rb +30 -40
  49. data/lib/aspose_slides_cloud/models/font_set.rb +22 -10
  50. data/lib/aspose_slides_cloud/models/format_scheme.rb +30 -40
  51. data/lib/aspose_slides_cloud/models/geometry_shape.rb +30 -208
  52. data/lib/aspose_slides_cloud/models/glow_effect.rb +22 -10
  53. data/lib/aspose_slides_cloud/models/gradient_fill.rb +31 -48
  54. data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +22 -10
  55. data/lib/aspose_slides_cloud/models/graphical_object.rb +31 -217
  56. data/lib/aspose_slides_cloud/models/group_shape.rb +31 -217
  57. data/lib/aspose_slides_cloud/models/html_export_options.rb +33 -32
  58. data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +22 -10
  59. data/lib/aspose_slides_cloud/models/image.rb +30 -40
  60. data/lib/aspose_slides_cloud/models/image_export_options.rb +33 -32
  61. data/lib/aspose_slides_cloud/models/images.rb +30 -40
  62. data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +22 -10
  63. data/lib/aspose_slides_cloud/models/input.rb +22 -10
  64. data/lib/aspose_slides_cloud/models/input_file.rb +22 -10
  65. data/lib/aspose_slides_cloud/models/interactive_sequence.rb +22 -10
  66. data/lib/aspose_slides_cloud/models/layout_slide.rb +30 -40
  67. data/lib/aspose_slides_cloud/models/layout_slides.rb +30 -40
  68. data/lib/aspose_slides_cloud/models/legend.rb +22 -10
  69. data/lib/aspose_slides_cloud/models/line_format.rb +22 -10
  70. data/lib/aspose_slides_cloud/models/master_slide.rb +30 -40
  71. data/lib/aspose_slides_cloud/models/master_slides.rb +30 -40
  72. data/lib/aspose_slides_cloud/models/merge.rb +31 -48
  73. data/lib/aspose_slides_cloud/models/merging_source.rb +22 -10
  74. data/lib/aspose_slides_cloud/models/no_fill.rb +29 -46
  75. data/lib/aspose_slides_cloud/models/normal_view_restored_properties.rb +217 -0
  76. data/lib/aspose_slides_cloud/models/notes_slide.rb +30 -40
  77. data/lib/aspose_slides_cloud/models/object_exist.rb +22 -10
  78. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +32 -218
  79. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +30 -20
  80. data/lib/aspose_slides_cloud/models/one_value_series.rb +31 -211
  81. data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +22 -10
  82. data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +22 -10
  83. data/lib/aspose_slides_cloud/models/output_file.rb +22 -10
  84. data/lib/aspose_slides_cloud/models/paragraph.rb +30 -40
  85. data/lib/aspose_slides_cloud/models/paragraphs.rb +30 -40
  86. data/lib/aspose_slides_cloud/models/path_input_file.rb +31 -57
  87. data/lib/aspose_slides_cloud/models/path_output_file.rb +31 -48
  88. data/lib/aspose_slides_cloud/models/pattern_fill.rb +31 -48
  89. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +63 -35
  90. data/lib/aspose_slides_cloud/models/picture_fill.rb +31 -48
  91. data/lib/aspose_slides_cloud/models/picture_frame.rb +32 -244
  92. data/lib/aspose_slides_cloud/models/pipeline.rb +22 -10
  93. data/lib/aspose_slides_cloud/models/placeholder.rb +30 -40
  94. data/lib/aspose_slides_cloud/models/placeholders.rb +30 -40
  95. data/lib/aspose_slides_cloud/models/plot_area.rb +22 -10
  96. data/lib/aspose_slides_cloud/models/portion.rb +30 -40
  97. data/lib/aspose_slides_cloud/models/portions.rb +36 -46
  98. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +33 -32
  99. data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +22 -10
  100. data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +22 -10
  101. data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +22 -10
  102. data/lib/aspose_slides_cloud/models/reflection_effect.rb +22 -10
  103. data/lib/aspose_slides_cloud/models/remove_shape.rb +31 -48
  104. data/lib/aspose_slides_cloud/models/remove_slide.rb +31 -48
  105. data/lib/aspose_slides_cloud/models/reorder_slide.rb +31 -48
  106. data/lib/aspose_slides_cloud/models/replace_text.rb +31 -48
  107. data/lib/aspose_slides_cloud/models/request_input_file.rb +31 -57
  108. data/lib/aspose_slides_cloud/models/reset_slide.rb +31 -48
  109. data/lib/aspose_slides_cloud/models/resource_base.rb +22 -10
  110. data/lib/aspose_slides_cloud/models/resource_uri.rb +22 -10
  111. data/lib/aspose_slides_cloud/models/resource_uri_element.rb +22 -10
  112. data/lib/aspose_slides_cloud/models/response_output_file.rb +29 -46
  113. data/lib/aspose_slides_cloud/models/save.rb +33 -50
  114. data/lib/aspose_slides_cloud/models/save_shape.rb +31 -48
  115. data/lib/aspose_slides_cloud/models/save_slide.rb +33 -50
  116. data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +30 -20
  117. data/lib/aspose_slides_cloud/models/scatter_series.rb +31 -211
  118. data/lib/aspose_slides_cloud/models/series.rb +47 -14
  119. data/lib/aspose_slides_cloud/models/series_marker.rb +22 -10
  120. data/lib/aspose_slides_cloud/models/shape.rb +31 -242
  121. data/lib/aspose_slides_cloud/models/shape_base.rb +30 -40
  122. data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +22 -10
  123. data/lib/aspose_slides_cloud/models/shapes.rb +30 -40
  124. data/lib/aspose_slides_cloud/models/slide.rb +30 -40
  125. data/lib/aspose_slides_cloud/models/slide_animation.rb +30 -40
  126. data/lib/aspose_slides_cloud/models/slide_background.rb +30 -40
  127. data/lib/aspose_slides_cloud/models/slide_comment.rb +22 -10
  128. data/lib/aspose_slides_cloud/models/slide_comments.rb +30 -40
  129. data/lib/aspose_slides_cloud/models/slide_export_format.rb +1 -0
  130. data/lib/aspose_slides_cloud/models/slide_replace_result.rb +30 -154
  131. data/lib/aspose_slides_cloud/models/slides.rb +30 -40
  132. data/lib/aspose_slides_cloud/models/smart_art.rb +32 -218
  133. data/lib/aspose_slides_cloud/models/smart_art_node.rb +22 -10
  134. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +31 -217
  135. data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +22 -10
  136. data/lib/aspose_slides_cloud/models/solid_fill.rb +31 -48
  137. data/lib/aspose_slides_cloud/models/split_document_result.rb +30 -40
  138. data/lib/aspose_slides_cloud/models/storage_exist.rb +22 -10
  139. data/lib/aspose_slides_cloud/models/storage_file.rb +22 -10
  140. data/lib/aspose_slides_cloud/models/svg_export_options.rb +33 -32
  141. data/lib/aspose_slides_cloud/models/swf_export_options.rb +33 -32
  142. data/lib/aspose_slides_cloud/models/table.rb +32 -218
  143. data/lib/aspose_slides_cloud/models/table_cell.rb +22 -10
  144. data/lib/aspose_slides_cloud/models/table_column.rb +22 -10
  145. data/lib/aspose_slides_cloud/models/table_row.rb +22 -10
  146. data/lib/aspose_slides_cloud/models/task.rb +22 -10
  147. data/lib/aspose_slides_cloud/models/text_item.rb +22 -10
  148. data/lib/aspose_slides_cloud/models/text_items.rb +30 -40
  149. data/lib/aspose_slides_cloud/models/theme.rb +30 -40
  150. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +33 -32
  151. data/lib/aspose_slides_cloud/models/update_background.rb +31 -48
  152. data/lib/aspose_slides_cloud/models/update_shape.rb +31 -48
  153. data/lib/aspose_slides_cloud/models/video_frame.rb +32 -244
  154. data/lib/aspose_slides_cloud/models/view_properties.rb +357 -0
  155. data/lib/aspose_slides_cloud/models/waterfall_series.rb +247 -0
  156. data/lib/aspose_slides_cloud/models/xps_export_options.rb +33 -32
  157. data/lib/aspose_slides_cloud/type_registry.rb +313 -0
  158. data/lib/aspose_slides_cloud/version.rb +1 -1
  159. data/spec/api/slides_api_spec.rb +20595 -14073
  160. data/spec/extra/extra_spec.rb +155 -20
  161. data/spec/spec_utils.rb +8 -1
  162. data/testRules.json +111 -8
  163. metadata +11 -2
@@ -147,6 +147,7 @@ module AsposeSlidesCloud
147
147
  opts[:query_params][key] = opts[:query_params][key].join[","]
148
148
  end
149
149
  end
150
+ req.options.timeout = 200
150
151
  req.url path.sub(/^\/+/, '')
151
152
  req.headers = opts[:header_params]
152
153
  req.params = opts[:query_params]
@@ -159,10 +160,9 @@ module AsposeSlidesCloud
159
160
  end
160
161
 
161
162
  def set_headers(headers)
162
- headers['x-aspose-client'] = 'ruby sdk'
163
- headers['x-aspose-version'] = AsposeSlidesCloud::VERSION
163
+ headers['x-aspose-client'] = "ruby sdk v#{AsposeSlidesCloud::VERSION}"
164
164
  if @config.timeout > 0
165
- headers['x-aspose-timeout'] = @config.timeout
165
+ headers['x-aspose-timeout'] = @config.timeout.to_s
166
166
  end
167
167
  @config.custom_headers.each do |key, value|
168
168
  headers[key] = value
@@ -273,8 +273,11 @@ module AsposeSlidesCloud
273
273
  data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
274
274
  end
275
275
  else
276
- # models, e.g. Pet
277
- AsposeSlidesCloud.const_get(return_type).new.tap do |model|
276
+ type = AsposeSlidesCloud::TypeRegistry.get_type(return_type, data)
277
+ if !type
278
+ type = return_type
279
+ end
280
+ AsposeSlidesCloud.const_get(type).new.tap do |model|
278
281
  model.build_from_hash data
279
282
  end
280
283
  end
@@ -24,10 +24,7 @@ require 'date'
24
24
 
25
25
  module AsposeSlidesCloud
26
26
  # Add layout slide task.
27
- class AddLayoutSlide
28
- # Task type.
29
- attr_accessor :type
30
-
27
+ class AddLayoutSlide < Task
31
28
  # Source file.
32
29
  attr_accessor :clone_from_file
33
30
 
@@ -58,35 +55,24 @@ module AsposeSlidesCloud
58
55
 
59
56
  # Attribute mapping from ruby-style variable name to JSON key.
60
57
  def self.attribute_map
61
- {
62
- :'type' => :'Type',
58
+ super.merge({
63
59
  :'clone_from_file' => :'CloneFromFile',
64
- :'clone_from_position' => :'CloneFromPosition'
65
- }
60
+ :'clone_from_position' => :'CloneFromPosition',
61
+ })
66
62
  end
67
63
 
68
64
  # Attribute type mapping.
69
65
  def self.swagger_types
70
- {
71
- :'type' => :'String',
66
+ super.merge({
72
67
  :'clone_from_file' => :'InputFile',
73
- :'clone_from_position' => :'Integer'
74
- }
68
+ :'clone_from_position' => :'Integer',
69
+ })
75
70
  end
76
71
 
77
72
  # Initializes the object
78
73
  # @param [Hash] attributes Model attributes in the form of hash
79
74
  def initialize(attributes = {})
80
- return unless attributes.is_a?(Hash)
81
-
82
- # convert string to symbol for hash key
83
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
84
-
85
- if attributes.has_key?(:'Type')
86
- self.type = attributes[:'Type']
87
- else
88
- self.type = "AddLayoutSlide"
89
- end
75
+ super
90
76
 
91
77
  if attributes.has_key?(:'CloneFromFile')
92
78
  self.clone_from_file = attributes[:'CloneFromFile']
@@ -95,16 +81,13 @@ module AsposeSlidesCloud
95
81
  if attributes.has_key?(:'CloneFromPosition')
96
82
  self.clone_from_position = attributes[:'CloneFromPosition']
97
83
  end
84
+ self.type = "AddLayoutSlide"
98
85
  end
99
86
 
100
87
  # Show invalid properties with the reasons. Usually used together with valid?
101
88
  # @return Array for valid properties with the reasons
102
89
  def list_invalid_properties
103
- invalid_properties = Array.new
104
- if @type.nil?
105
- invalid_properties.push('invalid value for "type", type cannot be nil.')
106
- end
107
-
90
+ invalid_properties = super
108
91
  if @clone_from_position.nil?
109
92
  invalid_properties.push('invalid value for "clone_from_position", clone_from_position cannot be nil.')
110
93
  end
@@ -115,23 +98,11 @@ module AsposeSlidesCloud
115
98
  # Check to see if the all the properties in the model are valid
116
99
  # @return true if the model is valid
117
100
  def valid?
118
- return false if @type.nil?
119
- type_validator = EnumAttributeValidator.new('String', ['Save', 'SaveSlide', 'SaveShape', 'AddSlide', 'AddMasterSlide', 'AddLayoutSlide', 'RemoveSlide', 'ReoderSlide', 'Merge', 'UpdateBackground', 'ResetSlide', 'AddShape', 'RemoveShape', 'UpdateShape', 'ReplaceText'])
120
- return false unless type_validator.valid?(@type)
101
+ return false if !super
121
102
  return false if @clone_from_position.nil?
122
103
  true
123
104
  end
124
105
 
125
- # Custom attribute writer method checking allowed values (enum).
126
- # @param [Object] type Object to be assigned
127
- def type=(type)
128
- validator = EnumAttributeValidator.new('String', ['Save', 'SaveSlide', 'SaveShape', 'AddSlide', 'AddMasterSlide', 'AddLayoutSlide', 'RemoveSlide', 'ReoderSlide', 'Merge', 'UpdateBackground', 'ResetSlide', 'AddShape', 'RemoveShape', 'UpdateShape', 'ReplaceText'])
129
- unless validator.valid?(type)
130
- fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
131
- end
132
- @type = type
133
- end
134
-
135
106
  # Checks equality by comparing each attribute.
136
107
  # @param [Object] Object to be compared
137
108
  def ==(o)
@@ -160,15 +131,27 @@ module AsposeSlidesCloud
160
131
  def build_from_hash(attributes)
161
132
  return nil unless attributes.is_a?(Hash)
162
133
  self.class.swagger_types.each_pair do |key, type|
163
- if type =~ /\AArray<(.*)>/i
164
- # check to ensure the input is an array given that the the attribute
165
- # is documented as an array but the input is not
166
- if attributes[self.class.attribute_map[key]].is_a?(Array)
167
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
+ mapKey = self.class.attribute_map[key]
135
+ if !mapKey.nil?
136
+ val = attributes[mapKey]
137
+ if val.nil?
138
+ mapKeyString = mapKey.to_s
139
+ mapKeyString[0] = mapKeyString[0].downcase
140
+ mapKey = mapKeyString.to_sym
141
+ val = attributes[mapKey]
142
+ end
143
+ if !val.nil?
144
+ if type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the the attribute
146
+ # is documented as an array but the input is not
147
+ if val.is_a?(Array)
148
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
149
+ end
150
+ else
151
+ self.send("#{key}=", _deserialize(type, val))
152
+ end
168
153
  end
169
- elsif !attributes[self.class.attribute_map[key]].nil?
170
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
171
- end # or else data not found in attributes(hash), not an issue as the data can be optional
154
+ end
172
155
  end
173
156
 
174
157
  self
@@ -24,10 +24,7 @@ require 'date'
24
24
 
25
25
  module AsposeSlidesCloud
26
26
  # Add master slide task.
27
- class AddMasterSlide
28
- # Task type.
29
- attr_accessor :type
30
-
27
+ class AddMasterSlide < Task
31
28
  # Source presentation clone from.
32
29
  attr_accessor :clone_from_file
33
30
 
@@ -61,37 +58,26 @@ module AsposeSlidesCloud
61
58
 
62
59
  # Attribute mapping from ruby-style variable name to JSON key.
63
60
  def self.attribute_map
64
- {
65
- :'type' => :'Type',
61
+ super.merge({
66
62
  :'clone_from_file' => :'CloneFromFile',
67
63
  :'clone_from_position' => :'CloneFromPosition',
68
- :'apply_to_all' => :'ApplyToAll'
69
- }
64
+ :'apply_to_all' => :'ApplyToAll',
65
+ })
70
66
  end
71
67
 
72
68
  # Attribute type mapping.
73
69
  def self.swagger_types
74
- {
75
- :'type' => :'String',
70
+ super.merge({
76
71
  :'clone_from_file' => :'InputFile',
77
72
  :'clone_from_position' => :'Integer',
78
- :'apply_to_all' => :'BOOLEAN'
79
- }
73
+ :'apply_to_all' => :'BOOLEAN',
74
+ })
80
75
  end
81
76
 
82
77
  # Initializes the object
83
78
  # @param [Hash] attributes Model attributes in the form of hash
84
79
  def initialize(attributes = {})
85
- return unless attributes.is_a?(Hash)
86
-
87
- # convert string to symbol for hash key
88
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
89
-
90
- if attributes.has_key?(:'Type')
91
- self.type = attributes[:'Type']
92
- else
93
- self.type = "AddMasterSlide"
94
- end
80
+ super
95
81
 
96
82
  if attributes.has_key?(:'CloneFromFile')
97
83
  self.clone_from_file = attributes[:'CloneFromFile']
@@ -104,16 +90,13 @@ module AsposeSlidesCloud
104
90
  if attributes.has_key?(:'ApplyToAll')
105
91
  self.apply_to_all = attributes[:'ApplyToAll']
106
92
  end
93
+ self.type = "AddMasterSlide"
107
94
  end
108
95
 
109
96
  # Show invalid properties with the reasons. Usually used together with valid?
110
97
  # @return Array for valid properties with the reasons
111
98
  def list_invalid_properties
112
- invalid_properties = Array.new
113
- if @type.nil?
114
- invalid_properties.push('invalid value for "type", type cannot be nil.')
115
- end
116
-
99
+ invalid_properties = super
117
100
  if @clone_from_position.nil?
118
101
  invalid_properties.push('invalid value for "clone_from_position", clone_from_position cannot be nil.')
119
102
  end
@@ -128,24 +111,12 @@ module AsposeSlidesCloud
128
111
  # Check to see if the all the properties in the model are valid
129
112
  # @return true if the model is valid
130
113
  def valid?
131
- return false if @type.nil?
132
- type_validator = EnumAttributeValidator.new('String', ['Save', 'SaveSlide', 'SaveShape', 'AddSlide', 'AddMasterSlide', 'AddLayoutSlide', 'RemoveSlide', 'ReoderSlide', 'Merge', 'UpdateBackground', 'ResetSlide', 'AddShape', 'RemoveShape', 'UpdateShape', 'ReplaceText'])
133
- return false unless type_validator.valid?(@type)
114
+ return false if !super
134
115
  return false if @clone_from_position.nil?
135
116
  return false if @apply_to_all.nil?
136
117
  true
137
118
  end
138
119
 
139
- # Custom attribute writer method checking allowed values (enum).
140
- # @param [Object] type Object to be assigned
141
- def type=(type)
142
- validator = EnumAttributeValidator.new('String', ['Save', 'SaveSlide', 'SaveShape', 'AddSlide', 'AddMasterSlide', 'AddLayoutSlide', 'RemoveSlide', 'ReoderSlide', 'Merge', 'UpdateBackground', 'ResetSlide', 'AddShape', 'RemoveShape', 'UpdateShape', 'ReplaceText'])
143
- unless validator.valid?(type)
144
- fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
145
- end
146
- @type = type
147
- end
148
-
149
120
  # Checks equality by comparing each attribute.
150
121
  # @param [Object] Object to be compared
151
122
  def ==(o)
@@ -175,15 +146,27 @@ module AsposeSlidesCloud
175
146
  def build_from_hash(attributes)
176
147
  return nil unless attributes.is_a?(Hash)
177
148
  self.class.swagger_types.each_pair do |key, type|
178
- if type =~ /\AArray<(.*)>/i
179
- # check to ensure the input is an array given that the the attribute
180
- # is documented as an array but the input is not
181
- if attributes[self.class.attribute_map[key]].is_a?(Array)
182
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ mapKey = self.class.attribute_map[key]
150
+ if !mapKey.nil?
151
+ val = attributes[mapKey]
152
+ if val.nil?
153
+ mapKeyString = mapKey.to_s
154
+ mapKeyString[0] = mapKeyString[0].downcase
155
+ mapKey = mapKeyString.to_sym
156
+ val = attributes[mapKey]
157
+ end
158
+ if !val.nil?
159
+ if type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the the attribute
161
+ # is documented as an array but the input is not
162
+ if val.is_a?(Array)
163
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
164
+ end
165
+ else
166
+ self.send("#{key}=", _deserialize(type, val))
167
+ end
183
168
  end
184
- elsif !attributes[self.class.attribute_map[key]].nil?
185
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
- end # or else data not found in attributes(hash), not an issue as the data can be optional
169
+ end
187
170
  end
188
171
 
189
172
  self
@@ -24,10 +24,7 @@ require 'date'
24
24
 
25
25
  module AsposeSlidesCloud
26
26
  # Add shape task.
27
- class AddShape
28
- # Task type.
29
- attr_accessor :type
30
-
27
+ class AddShape < Task
31
28
  # Shape DTO.
32
29
  attr_accessor :shape
33
30
 
@@ -58,35 +55,24 @@ module AsposeSlidesCloud
58
55
 
59
56
  # Attribute mapping from ruby-style variable name to JSON key.
60
57
  def self.attribute_map
61
- {
62
- :'type' => :'Type',
58
+ super.merge({
63
59
  :'shape' => :'Shape',
64
- :'shape_path' => :'ShapePath'
65
- }
60
+ :'shape_path' => :'ShapePath',
61
+ })
66
62
  end
67
63
 
68
64
  # Attribute type mapping.
69
65
  def self.swagger_types
70
- {
71
- :'type' => :'String',
66
+ super.merge({
72
67
  :'shape' => :'ShapeBase',
73
- :'shape_path' => :'String'
74
- }
68
+ :'shape_path' => :'String',
69
+ })
75
70
  end
76
71
 
77
72
  # Initializes the object
78
73
  # @param [Hash] attributes Model attributes in the form of hash
79
74
  def initialize(attributes = {})
80
- return unless attributes.is_a?(Hash)
81
-
82
- # convert string to symbol for hash key
83
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
84
-
85
- if attributes.has_key?(:'Type')
86
- self.type = attributes[:'Type']
87
- else
88
- self.type = "AddShape"
89
- end
75
+ super
90
76
 
91
77
  if attributes.has_key?(:'Shape')
92
78
  self.shape = attributes[:'Shape']
@@ -95,38 +81,23 @@ module AsposeSlidesCloud
95
81
  if attributes.has_key?(:'ShapePath')
96
82
  self.shape_path = attributes[:'ShapePath']
97
83
  end
84
+ self.type = "AddShape"
98
85
  end
99
86
 
100
87
  # Show invalid properties with the reasons. Usually used together with valid?
101
88
  # @return Array for valid properties with the reasons
102
89
  def list_invalid_properties
103
- invalid_properties = Array.new
104
- if @type.nil?
105
- invalid_properties.push('invalid value for "type", type cannot be nil.')
106
- end
107
-
90
+ invalid_properties = super
108
91
  invalid_properties
109
92
  end
110
93
 
111
94
  # Check to see if the all the properties in the model are valid
112
95
  # @return true if the model is valid
113
96
  def valid?
114
- return false if @type.nil?
115
- type_validator = EnumAttributeValidator.new('String', ['Save', 'SaveSlide', 'SaveShape', 'AddSlide', 'AddMasterSlide', 'AddLayoutSlide', 'RemoveSlide', 'ReoderSlide', 'Merge', 'UpdateBackground', 'ResetSlide', 'AddShape', 'RemoveShape', 'UpdateShape', 'ReplaceText'])
116
- return false unless type_validator.valid?(@type)
97
+ return false if !super
117
98
  true
118
99
  end
119
100
 
120
- # Custom attribute writer method checking allowed values (enum).
121
- # @param [Object] type Object to be assigned
122
- def type=(type)
123
- validator = EnumAttributeValidator.new('String', ['Save', 'SaveSlide', 'SaveShape', 'AddSlide', 'AddMasterSlide', 'AddLayoutSlide', 'RemoveSlide', 'ReoderSlide', 'Merge', 'UpdateBackground', 'ResetSlide', 'AddShape', 'RemoveShape', 'UpdateShape', 'ReplaceText'])
124
- unless validator.valid?(type)
125
- fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
126
- end
127
- @type = type
128
- end
129
-
130
101
  # Checks equality by comparing each attribute.
131
102
  # @param [Object] Object to be compared
132
103
  def ==(o)
@@ -155,15 +126,27 @@ module AsposeSlidesCloud
155
126
  def build_from_hash(attributes)
156
127
  return nil unless attributes.is_a?(Hash)
157
128
  self.class.swagger_types.each_pair do |key, type|
158
- if type =~ /\AArray<(.*)>/i
159
- # check to ensure the input is an array given that the the attribute
160
- # is documented as an array but the input is not
161
- if attributes[self.class.attribute_map[key]].is_a?(Array)
162
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ mapKey = self.class.attribute_map[key]
130
+ if !mapKey.nil?
131
+ val = attributes[mapKey]
132
+ if val.nil?
133
+ mapKeyString = mapKey.to_s
134
+ mapKeyString[0] = mapKeyString[0].downcase
135
+ mapKey = mapKeyString.to_sym
136
+ val = attributes[mapKey]
137
+ end
138
+ if !val.nil?
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the the attribute
141
+ # is documented as an array but the input is not
142
+ if val.is_a?(Array)
143
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
144
+ end
145
+ else
146
+ self.send("#{key}=", _deserialize(type, val))
147
+ end
163
148
  end
164
- elsif !attributes[self.class.attribute_map[key]].nil?
165
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
- end # or else data not found in attributes(hash), not an issue as the data can be optional
149
+ end
167
150
  end
168
151
 
169
152
  self
@@ -24,10 +24,7 @@ require 'date'
24
24
 
25
25
  module AsposeSlidesCloud
26
26
  # Add slide task.
27
- class AddSlide
28
- # Task type.
29
- attr_accessor :type
30
-
27
+ class AddSlide < Task
31
28
  # File to clone a slide from.
32
29
  attr_accessor :clone_from_file
33
30
 
@@ -64,39 +61,28 @@ module AsposeSlidesCloud
64
61
 
65
62
  # Attribute mapping from ruby-style variable name to JSON key.
66
63
  def self.attribute_map
67
- {
68
- :'type' => :'Type',
64
+ super.merge({
69
65
  :'clone_from_file' => :'CloneFromFile',
70
66
  :'clone_from_position' => :'CloneFromPosition',
71
67
  :'position' => :'Position',
72
- :'layout_alias' => :'LayoutAlias'
73
- }
68
+ :'layout_alias' => :'LayoutAlias',
69
+ })
74
70
  end
75
71
 
76
72
  # Attribute type mapping.
77
73
  def self.swagger_types
78
- {
79
- :'type' => :'String',
74
+ super.merge({
80
75
  :'clone_from_file' => :'InputFile',
81
76
  :'clone_from_position' => :'Integer',
82
77
  :'position' => :'Integer',
83
- :'layout_alias' => :'String'
84
- }
78
+ :'layout_alias' => :'String',
79
+ })
85
80
  end
86
81
 
87
82
  # Initializes the object
88
83
  # @param [Hash] attributes Model attributes in the form of hash
89
84
  def initialize(attributes = {})
90
- return unless attributes.is_a?(Hash)
91
-
92
- # convert string to symbol for hash key
93
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
94
-
95
- if attributes.has_key?(:'Type')
96
- self.type = attributes[:'Type']
97
- else
98
- self.type = "AddSlide"
99
- end
85
+ super
100
86
 
101
87
  if attributes.has_key?(:'CloneFromFile')
102
88
  self.clone_from_file = attributes[:'CloneFromFile']
@@ -113,16 +99,13 @@ module AsposeSlidesCloud
113
99
  if attributes.has_key?(:'LayoutAlias')
114
100
  self.layout_alias = attributes[:'LayoutAlias']
115
101
  end
102
+ self.type = "AddSlide"
116
103
  end
117
104
 
118
105
  # Show invalid properties with the reasons. Usually used together with valid?
119
106
  # @return Array for valid properties with the reasons
120
107
  def list_invalid_properties
121
- invalid_properties = Array.new
122
- if @type.nil?
123
- invalid_properties.push('invalid value for "type", type cannot be nil.')
124
- end
125
-
108
+ invalid_properties = super
126
109
  if @clone_from_position.nil?
127
110
  invalid_properties.push('invalid value for "clone_from_position", clone_from_position cannot be nil.')
128
111
  end
@@ -137,24 +120,12 @@ module AsposeSlidesCloud
137
120
  # Check to see if the all the properties in the model are valid
138
121
  # @return true if the model is valid
139
122
  def valid?
140
- return false if @type.nil?
141
- type_validator = EnumAttributeValidator.new('String', ['Save', 'SaveSlide', 'SaveShape', 'AddSlide', 'AddMasterSlide', 'AddLayoutSlide', 'RemoveSlide', 'ReoderSlide', 'Merge', 'UpdateBackground', 'ResetSlide', 'AddShape', 'RemoveShape', 'UpdateShape', 'ReplaceText'])
142
- return false unless type_validator.valid?(@type)
123
+ return false if !super
143
124
  return false if @clone_from_position.nil?
144
125
  return false if @position.nil?
145
126
  true
146
127
  end
147
128
 
148
- # Custom attribute writer method checking allowed values (enum).
149
- # @param [Object] type Object to be assigned
150
- def type=(type)
151
- validator = EnumAttributeValidator.new('String', ['Save', 'SaveSlide', 'SaveShape', 'AddSlide', 'AddMasterSlide', 'AddLayoutSlide', 'RemoveSlide', 'ReoderSlide', 'Merge', 'UpdateBackground', 'ResetSlide', 'AddShape', 'RemoveShape', 'UpdateShape', 'ReplaceText'])
152
- unless validator.valid?(type)
153
- fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
154
- end
155
- @type = type
156
- end
157
-
158
129
  # Checks equality by comparing each attribute.
159
130
  # @param [Object] Object to be compared
160
131
  def ==(o)
@@ -185,15 +156,27 @@ module AsposeSlidesCloud
185
156
  def build_from_hash(attributes)
186
157
  return nil unless attributes.is_a?(Hash)
187
158
  self.class.swagger_types.each_pair do |key, type|
188
- if type =~ /\AArray<(.*)>/i
189
- # check to ensure the input is an array given that the the attribute
190
- # is documented as an array but the input is not
191
- if attributes[self.class.attribute_map[key]].is_a?(Array)
192
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ mapKey = self.class.attribute_map[key]
160
+ if !mapKey.nil?
161
+ val = attributes[mapKey]
162
+ if val.nil?
163
+ mapKeyString = mapKey.to_s
164
+ mapKeyString[0] = mapKeyString[0].downcase
165
+ mapKey = mapKeyString.to_sym
166
+ val = attributes[mapKey]
167
+ end
168
+ if !val.nil?
169
+ if type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the the attribute
171
+ # is documented as an array but the input is not
172
+ if val.is_a?(Array)
173
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
174
+ end
175
+ else
176
+ self.send("#{key}=", _deserialize(type, val))
177
+ end
193
178
  end
194
- elsif !attributes[self.class.attribute_map[key]].nil?
195
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
196
- end # or else data not found in attributes(hash), not an issue as the data can be optional
179
+ end
197
180
  end
198
181
 
199
182
  self