aspose_imaging_cloud 1.0.0 → 19.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +224 -61
  3. data/lib/aspose-imaging-cloud.rb +161 -0
  4. data/lib/aspose-imaging-cloud/api/imaging_api.rb +684 -0
  5. data/lib/aspose-imaging-cloud/api_client.rb +357 -0
  6. data/lib/aspose-imaging-cloud/api_error.rb +42 -0
  7. data/lib/{aspose_imaging_cloud → aspose-imaging-cloud}/configuration.rb +236 -166
  8. data/lib/aspose-imaging-cloud/models/big_rectangular_filter_properties.rb +206 -0
  9. data/lib/aspose-imaging-cloud/models/bilateral_smoothing_filter_properties.rb +281 -0
  10. data/lib/aspose-imaging-cloud/models/bmp_properties.rb +202 -0
  11. data/lib/aspose-imaging-cloud/models/convolution_filter_properties.rb +236 -0
  12. data/lib/aspose-imaging-cloud/models/deconvolution_filter_properties.rb +266 -0
  13. data/lib/aspose-imaging-cloud/models/dicom_properties.rb +584 -0
  14. data/lib/aspose-imaging-cloud/models/disc_usage.rb +222 -0
  15. data/lib/aspose-imaging-cloud/models/djvu_properties.rb +232 -0
  16. data/lib/aspose-imaging-cloud/models/dng_properties.rb +329 -0
  17. data/lib/aspose-imaging-cloud/models/error.rb +232 -0
  18. data/lib/aspose-imaging-cloud/models/error_details.rb +217 -0
  19. data/lib/aspose-imaging-cloud/models/exif_data.rb +1560 -0
  20. data/lib/aspose-imaging-cloud/models/file_version.rb +277 -0
  21. data/lib/aspose-imaging-cloud/models/file_versions.rb +204 -0
  22. data/lib/aspose-imaging-cloud/models/files_list.rb +204 -0
  23. data/lib/aspose-imaging-cloud/models/files_upload_result.rb +216 -0
  24. data/lib/aspose-imaging-cloud/models/filter_properties_base.rb +206 -0
  25. data/lib/aspose-imaging-cloud/models/gauss_wiener_filter_properties.rb +296 -0
  26. data/lib/aspose-imaging-cloud/models/gaussian_blur_filter_properties.rb +266 -0
  27. data/lib/aspose-imaging-cloud/models/gif_properties.rb +247 -0
  28. data/lib/aspose-imaging-cloud/models/image_duplicates.rb +204 -0
  29. data/lib/aspose-imaging-cloud/models/image_duplicates_set.rb +204 -0
  30. data/lib/aspose-imaging-cloud/models/image_features.rb +257 -0
  31. data/lib/aspose-imaging-cloud/models/imaging_response.rb +412 -0
  32. data/lib/aspose-imaging-cloud/models/jfif_data.rb +247 -0
  33. data/lib/aspose-imaging-cloud/models/jpeg2000_properties.rb +214 -0
  34. data/lib/aspose-imaging-cloud/models/jpeg_exif_data.rb +1738 -0
  35. data/lib/aspose-imaging-cloud/models/jpeg_properties.rb +222 -0
  36. data/lib/aspose-imaging-cloud/models/median_filter_properties.rb +221 -0
  37. data/lib/aspose-imaging-cloud/models/motion_wiener_filter_properties.rb +311 -0
  38. data/lib/aspose-imaging-cloud/models/object_exist.rb +222 -0
  39. data/lib/aspose-imaging-cloud/models/odg_metadata.rb +372 -0
  40. data/lib/aspose-imaging-cloud/models/odg_page.rb +222 -0
  41. data/lib/aspose-imaging-cloud/models/odg_properties.rb +229 -0
  42. data/lib/aspose-imaging-cloud/models/png_properties.rb +192 -0
  43. data/lib/aspose-imaging-cloud/models/psd_properties.rb +242 -0
  44. data/lib/aspose-imaging-cloud/models/requests/add_search_image_request.rb +91 -0
  45. data/lib/aspose-imaging-cloud/models/requests/append_tiff_request.rb +88 -0
  46. data/lib/aspose-imaging-cloud/models/requests/compare_images_request.rb +94 -0
  47. data/lib/aspose-imaging-cloud/models/requests/convert_tiff_to_fax_request.rb +80 -0
  48. data/lib/aspose-imaging-cloud/models/requests/copy_file_request.rb +91 -0
  49. data/lib/aspose-imaging-cloud/models/requests/copy_folder_request.rb +88 -0
  50. data/lib/aspose-imaging-cloud/models/requests/create_cropped_image_request.rb +121 -0
  51. data/lib/aspose-imaging-cloud/models/requests/create_folder_request.rb +77 -0
  52. data/lib/aspose-imaging-cloud/models/requests/create_image_features_request.rb +89 -0
  53. data/lib/aspose-imaging-cloud/models/requests/create_image_frame_request.rb +112 -0
  54. data/lib/aspose-imaging-cloud/models/requests/create_image_search_request.rb +79 -0
  55. data/lib/aspose-imaging-cloud/models/requests/create_image_tag_request.rb +96 -0
  56. data/lib/aspose-imaging-cloud/models/requests/create_modified_bmp_request.rb +108 -0
  57. data/lib/aspose-imaging-cloud/models/requests/create_modified_emf_request.rb +127 -0
  58. data/lib/aspose-imaging-cloud/models/requests/create_modified_gif_request.rb +102 -0
  59. data/lib/aspose-imaging-cloud/models/requests/create_modified_jpeg2000_request.rb +95 -0
  60. data/lib/aspose-imaging-cloud/models/requests/create_modified_jpeg_request.rb +90 -0
  61. data/lib/aspose-imaging-cloud/models/requests/create_modified_psd_request.rb +90 -0
  62. data/lib/aspose-imaging-cloud/models/requests/create_modified_svg_request.rb +114 -0
  63. data/lib/aspose-imaging-cloud/models/requests/create_modified_tiff_request.rb +104 -0
  64. data/lib/aspose-imaging-cloud/models/requests/create_modified_web_p_request.rb +116 -0
  65. data/lib/aspose-imaging-cloud/models/requests/create_modified_wmf_request.rb +127 -0
  66. data/lib/aspose-imaging-cloud/models/requests/create_resized_image_request.rb +105 -0
  67. data/lib/aspose-imaging-cloud/models/requests/create_rotate_flipped_image_request.rb +97 -0
  68. data/lib/aspose-imaging-cloud/models/requests/create_saved_image_as_request.rb +89 -0
  69. data/lib/aspose-imaging-cloud/models/requests/create_updated_image_request.rb +145 -0
  70. data/lib/aspose-imaging-cloud/models/requests/create_web_site_image_features_request.rb +88 -0
  71. data/lib/aspose-imaging-cloud/models/requests/crop_image_request.rb +120 -0
  72. data/lib/aspose-imaging-cloud/models/requests/delete_file_request.rb +80 -0
  73. data/lib/aspose-imaging-cloud/models/requests/delete_folder_request.rb +80 -0
  74. data/lib/aspose-imaging-cloud/models/requests/delete_image_features_request.rb +88 -0
  75. data/lib/aspose-imaging-cloud/models/requests/delete_image_search_request.rb +80 -0
  76. data/lib/aspose-imaging-cloud/models/requests/delete_search_image_request.rb +88 -0
  77. data/lib/aspose-imaging-cloud/models/requests/download_file_request.rb +80 -0
  78. data/lib/aspose-imaging-cloud/models/requests/extract_image_features_request.rb +91 -0
  79. data/lib/aspose-imaging-cloud/models/requests/extract_image_frame_properties_request.rb +82 -0
  80. data/lib/aspose-imaging-cloud/models/requests/extract_image_properties_request.rb +75 -0
  81. data/lib/aspose-imaging-cloud/models/requests/filter_effect_image_request.rb +103 -0
  82. data/lib/aspose-imaging-cloud/models/requests/find_image_duplicates_request.rb +88 -0
  83. data/lib/aspose-imaging-cloud/models/requests/find_images_by_tags_request.rb +104 -0
  84. data/lib/aspose-imaging-cloud/models/requests/find_similar_images_request.rb +102 -0
  85. data/lib/aspose-imaging-cloud/models/requests/get_disc_usage_request.rb +70 -0
  86. data/lib/aspose-imaging-cloud/models/requests/get_file_versions_request.rb +77 -0
  87. data/lib/aspose-imaging-cloud/models/requests/get_files_list_request.rb +77 -0
  88. data/lib/aspose-imaging-cloud/models/requests/get_image_features_request.rb +88 -0
  89. data/lib/aspose-imaging-cloud/models/requests/get_image_frame_properties_request.rb +87 -0
  90. data/lib/aspose-imaging-cloud/models/requests/get_image_frame_request.rb +111 -0
  91. data/lib/aspose-imaging-cloud/models/requests/get_image_properties_request.rb +80 -0
  92. data/lib/aspose-imaging-cloud/models/requests/get_image_search_status_request.rb +80 -0
  93. data/lib/aspose-imaging-cloud/models/requests/get_search_image_request.rb +88 -0
  94. data/lib/aspose-imaging-cloud/models/requests/http_request.rb +50 -0
  95. data/lib/aspose-imaging-cloud/models/requests/imaging_request.rb +101 -0
  96. data/lib/aspose-imaging-cloud/models/requests/modify_bmp_request.rb +107 -0
  97. data/lib/aspose-imaging-cloud/models/requests/modify_emf_request.rb +126 -0
  98. data/lib/aspose-imaging-cloud/models/requests/modify_gif_request.rb +101 -0
  99. data/lib/aspose-imaging-cloud/models/requests/modify_jpeg2000_request.rb +94 -0
  100. data/lib/aspose-imaging-cloud/models/requests/modify_jpeg_request.rb +89 -0
  101. data/lib/aspose-imaging-cloud/models/requests/modify_psd_request.rb +89 -0
  102. data/lib/aspose-imaging-cloud/models/requests/modify_svg_request.rb +113 -0
  103. data/lib/aspose-imaging-cloud/models/requests/modify_tiff_request.rb +103 -0
  104. data/lib/aspose-imaging-cloud/models/requests/modify_web_p_request.rb +115 -0
  105. data/lib/aspose-imaging-cloud/models/requests/modify_wmf_request.rb +126 -0
  106. data/lib/aspose-imaging-cloud/models/requests/move_file_request.rb +91 -0
  107. data/lib/aspose-imaging-cloud/models/requests/move_folder_request.rb +88 -0
  108. data/lib/aspose-imaging-cloud/models/requests/object_exists_request.rb +80 -0
  109. data/lib/aspose-imaging-cloud/models/requests/resize_image_request.rb +104 -0
  110. data/lib/aspose-imaging-cloud/models/requests/rotate_flip_image_request.rb +96 -0
  111. data/lib/aspose-imaging-cloud/models/requests/save_image_as_request.rb +88 -0
  112. data/lib/aspose-imaging-cloud/models/requests/storage_exists_request.rb +74 -0
  113. data/lib/aspose-imaging-cloud/models/requests/update_image_features_request.rb +91 -0
  114. data/lib/aspose-imaging-cloud/models/requests/update_image_request.rb +144 -0
  115. data/lib/aspose-imaging-cloud/models/requests/update_search_image_request.rb +91 -0
  116. data/lib/aspose-imaging-cloud/models/requests/upload_file_request.rb +86 -0
  117. data/lib/aspose-imaging-cloud/models/search_context_status.rb +212 -0
  118. data/lib/aspose-imaging-cloud/models/search_result.rb +217 -0
  119. data/lib/aspose-imaging-cloud/models/search_results_set.rb +204 -0
  120. data/lib/aspose-imaging-cloud/models/sharpen_filter_properties.rb +266 -0
  121. data/lib/aspose-imaging-cloud/models/small_rectangular_filter_properties.rb +206 -0
  122. data/lib/aspose-imaging-cloud/models/storage_exist.rb +207 -0
  123. data/lib/aspose-imaging-cloud/models/storage_file.rb +252 -0
  124. data/lib/aspose-imaging-cloud/models/svg_properties.rb +202 -0
  125. data/lib/aspose-imaging-cloud/models/tiff_frame.rb +242 -0
  126. data/lib/aspose-imaging-cloud/models/tiff_options.rb +734 -0
  127. data/lib/aspose-imaging-cloud/models/tiff_properties.rb +224 -0
  128. data/lib/aspose-imaging-cloud/models/web_p_properties.rb +252 -0
  129. data/lib/aspose-imaging-cloud/version.rb +15 -0
  130. metadata +149 -129
  131. data/LICENSE +0 -22
  132. data/aspose_imaging_cloud.gemspec +0 -26
  133. data/lib/aspose_imaging_cloud.rb +0 -43
  134. data/lib/aspose_imaging_cloud/api/imaging_api.rb +0 -1776
  135. data/lib/aspose_imaging_cloud/api_client.rb +0 -335
  136. data/lib/aspose_imaging_cloud/api_error.rb +0 -24
  137. data/lib/aspose_imaging_cloud/models/base_object.rb +0 -86
  138. data/lib/aspose_imaging_cloud/models/base_response.rb +0 -53
  139. data/lib/aspose_imaging_cloud/models/bmp_properties.rb +0 -37
  140. data/lib/aspose_imaging_cloud/models/exif_data.rb +0 -855
  141. data/lib/aspose_imaging_cloud/models/gif_properties.rb +0 -53
  142. data/lib/aspose_imaging_cloud/models/imaging_response.rb +0 -149
  143. data/lib/aspose_imaging_cloud/models/jfif_data.rb +0 -61
  144. data/lib/aspose_imaging_cloud/models/jpeg_exif_data.rb +0 -991
  145. data/lib/aspose_imaging_cloud/models/jpeg_properties.rb +0 -53
  146. data/lib/aspose_imaging_cloud/models/psd_properties.rb +0 -61
  147. data/lib/aspose_imaging_cloud/models/tiff_frame.rb +0 -61
  148. data/lib/aspose_imaging_cloud/models/tiff_options.rb +0 -419
  149. data/lib/aspose_imaging_cloud/models/tiff_properties.rb +0 -55
  150. data/lib/aspose_imaging_cloud/version.rb +0 -3
  151. data/test/data/TestDemo.tif +0 -0
  152. data/test/data/aspose.jpg +0 -0
  153. data/test/data/aspose_imaging_for_cloud.png +0 -0
  154. data/test/data/demo.tif +0 -0
  155. data/test/data/sample-multi.tif +0 -0
  156. data/test/data/sample.bmp +0 -0
  157. data/test/data/sample.gif +0 -0
  158. data/test/data/sample.psd +0 -0
  159. data/test/data/sample.tif +0 -0
  160. data/test/data/test.bmp +0 -0
  161. data/test/imaging_tests.rb +0 -291
@@ -0,0 +1,206 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="big_rectangular_filter_properties.rb">
3
+ # Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
4
+ # </copyright>
5
+ # <summary>
6
+ # Permission is hereby granted, free of charge, to any person obtaining a
7
+ # copy of this software and associated documentation files (the "Software"),
8
+ # to deal in the Software without restriction, including without limitation
9
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ # and/or sell copies of the Software, and to permit persons to whom the
11
+ # Software is furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ # DEALINGS IN THE SOFTWARE.
23
+ # </summary>
24
+ # ----------------------------------------------------------------------------
25
+
26
+
27
+ require 'date'
28
+
29
+ module AsposeImagingCloud
30
+ # Big Rectangular Filter Options
31
+ class BigRectangularFilterProperties
32
+ attr_accessor :discriminator
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'discriminator' => :'discriminator'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'discriminator' => :'String'
45
+ }
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ return unless attributes.is_a?(Hash)
52
+
53
+ # convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
55
+
56
+ if attributes.has_key?(:'discriminator')
57
+ self.discriminator = attributes[:'discriminator']
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ if @discriminator.nil?
66
+ invalid_properties.push('invalid value for "discriminator", discriminator cannot be nil.')
67
+ end
68
+
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ return false if @discriminator.nil?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ discriminator == o.discriminator
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Fixnum] Hash code
95
+ def hash
96
+ [discriminator].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def build_from_hash(attributes)
103
+ return nil unless attributes.is_a?(Hash)
104
+ self.class.swagger_types.each_pair do |key, type|
105
+ attribute_key = self.class.attribute_map[key]
106
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
107
+ if type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[attribute_key].is_a?(Array)
111
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
112
+ end
113
+ elsif !attributes[attribute_key].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
115
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :BOOLEAN
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ temp_model = AsposeImagingCloud.const_get(type).new
159
+ temp_model.build_from_hash(value)
160
+ end
161
+ end
162
+
163
+ # Returns the string representation of the object
164
+ # @return [String] String presentation of the object
165
+ def to_s
166
+ to_hash.to_s
167
+ end
168
+
169
+ # to_body is an alias to to_hash (backward compatibility)
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_body
172
+ to_hash
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ next if value.nil?
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ # Outputs non-array value in the form of hash
188
+ # For object, use to_hash. Otherwise, just return the value
189
+ # @param [Object] value Any valid value
190
+ # @return [Hash] Returns the value in the form of hash
191
+ def _to_hash(value)
192
+ if value.is_a?(Array)
193
+ value.compact.map { |v| _to_hash(v) }
194
+ elsif value.is_a?(Hash)
195
+ {}.tap do |hash|
196
+ value.each { |k, v| hash[k] = _to_hash(v) }
197
+ end
198
+ elsif value.respond_to? :to_hash
199
+ value.to_hash
200
+ else
201
+ value
202
+ end
203
+ end
204
+
205
+ end
206
+ end
@@ -0,0 +1,281 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="bilateral_smoothing_filter_properties.rb">
3
+ # Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
4
+ # </copyright>
5
+ # <summary>
6
+ # Permission is hereby granted, free of charge, to any person obtaining a
7
+ # copy of this software and associated documentation files (the "Software"),
8
+ # to deal in the Software without restriction, including without limitation
9
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ # and/or sell copies of the Software, and to permit persons to whom the
11
+ # Software is furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ # DEALINGS IN THE SOFTWARE.
23
+ # </summary>
24
+ # ----------------------------------------------------------------------------
25
+
26
+
27
+ require 'date'
28
+
29
+ module AsposeImagingCloud
30
+ # The Bilateral Smoothing Filter Options.
31
+ class BilateralSmoothingFilterProperties
32
+ attr_accessor :discriminator
33
+
34
+ # Gets or sets the size of the kernel.
35
+ attr_accessor :size
36
+
37
+ # Gets or sets the spatial factor.
38
+ attr_accessor :spatial_factor
39
+
40
+ # Gets or sets the spatial power.
41
+ attr_accessor :spatial_power
42
+
43
+ # Gets or sets the color factor.
44
+ attr_accessor :color_factor
45
+
46
+ # Gets or sets the color power.
47
+ attr_accessor :color_power
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'discriminator' => :'discriminator',
53
+ :'size' => :'Size',
54
+ :'spatial_factor' => :'SpatialFactor',
55
+ :'spatial_power' => :'SpatialPower',
56
+ :'color_factor' => :'ColorFactor',
57
+ :'color_power' => :'ColorPower'
58
+ }
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.swagger_types
63
+ {
64
+ :'discriminator' => :'String',
65
+ :'size' => :'Integer',
66
+ :'spatial_factor' => :'Float',
67
+ :'spatial_power' => :'Float',
68
+ :'color_factor' => :'Float',
69
+ :'color_power' => :'Float'
70
+ }
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ return unless attributes.is_a?(Hash)
77
+
78
+ # convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
80
+
81
+ if attributes.has_key?(:'discriminator')
82
+ self.discriminator = attributes[:'discriminator']
83
+ end
84
+
85
+ if attributes.has_key?(:'Size')
86
+ self.size = attributes[:'Size']
87
+ end
88
+
89
+ if attributes.has_key?(:'SpatialFactor')
90
+ self.spatial_factor = attributes[:'SpatialFactor']
91
+ end
92
+
93
+ if attributes.has_key?(:'SpatialPower')
94
+ self.spatial_power = attributes[:'SpatialPower']
95
+ end
96
+
97
+ if attributes.has_key?(:'ColorFactor')
98
+ self.color_factor = attributes[:'ColorFactor']
99
+ end
100
+
101
+ if attributes.has_key?(:'ColorPower')
102
+ self.color_power = attributes[:'ColorPower']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ if @discriminator.nil?
111
+ invalid_properties.push('invalid value for "discriminator", discriminator cannot be nil.')
112
+ end
113
+
114
+ if @size.nil?
115
+ invalid_properties.push('invalid value for "size", size cannot be nil.')
116
+ end
117
+
118
+ if @spatial_factor.nil?
119
+ invalid_properties.push('invalid value for "spatial_factor", spatial_factor cannot be nil.')
120
+ end
121
+
122
+ if @spatial_power.nil?
123
+ invalid_properties.push('invalid value for "spatial_power", spatial_power cannot be nil.')
124
+ end
125
+
126
+ if @color_factor.nil?
127
+ invalid_properties.push('invalid value for "color_factor", color_factor cannot be nil.')
128
+ end
129
+
130
+ if @color_power.nil?
131
+ invalid_properties.push('invalid value for "color_power", color_power cannot be nil.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ return false if @discriminator.nil?
141
+ return false if @size.nil?
142
+ return false if @spatial_factor.nil?
143
+ return false if @spatial_power.nil?
144
+ return false if @color_factor.nil?
145
+ return false if @color_power.nil?
146
+ true
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ discriminator == o.discriminator &&
155
+ size == o.size &&
156
+ spatial_factor == o.spatial_factor &&
157
+ spatial_power == o.spatial_power &&
158
+ color_factor == o.color_factor &&
159
+ color_power == o.color_power
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Fixnum] Hash code
170
+ def hash
171
+ [discriminator, size, spatial_factor, spatial_power, color_factor, color_power].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ self.class.swagger_types.each_pair do |key, type|
180
+ attribute_key = self.class.attribute_map[key]
181
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
182
+ if type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[attribute_key].is_a?(Array)
186
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
187
+ end
188
+ elsif !attributes[attribute_key].nil?
189
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
190
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
191
+ end
192
+
193
+ self
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def _deserialize(type, value)
201
+ case type.to_sym
202
+ when :DateTime
203
+ DateTime.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :BOOLEAN
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ temp_model = AsposeImagingCloud.const_get(type).new
234
+ temp_model.build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ next if value.nil?
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map { |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+
280
+ end
281
+ end