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,202 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="svg_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
+ # Represents information about image in PNG format.
31
+ class SvgProperties
32
+ # Gets or sets the color type for SVG image.
33
+ attr_accessor :color_type
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'color_type' => :'ColorType'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'color_type' => :'String'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'ColorType')
58
+ self.color_type = attributes[:'ColorType']
59
+ end
60
+ end
61
+
62
+ # Show invalid properties with the reasons. Usually used together with valid?
63
+ # @return Array for valid properties with the reasons
64
+ def list_invalid_properties
65
+ invalid_properties = Array.new
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(o)
78
+ return true if self.equal?(o)
79
+ self.class == o.class &&
80
+ color_type == o.color_type
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(o)
86
+ self == o
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Fixnum] Hash code
91
+ def hash
92
+ [color_type].hash
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def build_from_hash(attributes)
99
+ return nil unless attributes.is_a?(Hash)
100
+ self.class.swagger_types.each_pair do |key, type|
101
+ attribute_key = self.class.attribute_map[key]
102
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
103
+ if type =~ /\AArray<(.*)>/i
104
+ # check to ensure the input is an array given that the the attribute
105
+ # is documented as an array but the input is not
106
+ if attributes[attribute_key].is_a?(Array)
107
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
108
+ end
109
+ elsif !attributes[attribute_key].nil?
110
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
111
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
112
+ end
113
+
114
+ self
115
+ end
116
+
117
+ # Deserializes the data based on type
118
+ # @param string type Data type
119
+ # @param string value Value to be deserialized
120
+ # @return [Object] Deserialized data
121
+ def _deserialize(type, value)
122
+ case type.to_sym
123
+ when :DateTime
124
+ DateTime.parse(value)
125
+ when :Date
126
+ Date.parse(value)
127
+ when :String
128
+ value.to_s
129
+ when :Integer
130
+ value.to_i
131
+ when :Float
132
+ value.to_f
133
+ when :BOOLEAN
134
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
135
+ true
136
+ else
137
+ false
138
+ end
139
+ when :Object
140
+ # generic object (usually a Hash), return directly
141
+ value
142
+ when /\AArray<(?<inner_type>.+)>\z/
143
+ inner_type = Regexp.last_match[:inner_type]
144
+ value.map { |v| _deserialize(inner_type, v) }
145
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
146
+ k_type = Regexp.last_match[:k_type]
147
+ v_type = Regexp.last_match[:v_type]
148
+ {}.tap do |hash|
149
+ value.each do |k, v|
150
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
151
+ end
152
+ end
153
+ else # model
154
+ temp_model = AsposeImagingCloud.const_get(type).new
155
+ temp_model.build_from_hash(value)
156
+ end
157
+ end
158
+
159
+ # Returns the string representation of the object
160
+ # @return [String] String presentation of the object
161
+ def to_s
162
+ to_hash.to_s
163
+ end
164
+
165
+ # to_body is an alias to to_hash (backward compatibility)
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_body
168
+ to_hash
169
+ end
170
+
171
+ # Returns the object in the form of hash
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_hash
174
+ hash = {}
175
+ self.class.attribute_map.each_pair do |attr, param|
176
+ value = self.send(attr)
177
+ next if value.nil?
178
+ hash[param] = _to_hash(value)
179
+ end
180
+ hash
181
+ end
182
+
183
+ # Outputs non-array value in the form of hash
184
+ # For object, use to_hash. Otherwise, just return the value
185
+ # @param [Object] value Any valid value
186
+ # @return [Hash] Returns the value in the form of hash
187
+ def _to_hash(value)
188
+ if value.is_a?(Array)
189
+ value.compact.map { |v| _to_hash(v) }
190
+ elsif value.is_a?(Hash)
191
+ {}.tap do |hash|
192
+ value.each { |k, v| hash[k] = _to_hash(v) }
193
+ end
194
+ elsif value.respond_to? :to_hash
195
+ value.to_hash
196
+ else
197
+ value
198
+ end
199
+ end
200
+
201
+ end
202
+ end
@@ -0,0 +1,242 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="tiff_frame.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
+ # Represents information about TIFF frame.
31
+ class TiffFrame
32
+ # Gets or sets options for the frame.
33
+ attr_accessor :frame_options
34
+
35
+ # Gets or sets the frame height.
36
+ attr_accessor :height
37
+
38
+ # Gets or sets the frame width.
39
+ attr_accessor :width
40
+
41
+ # Gets or sets the EXIF data.
42
+ attr_accessor :exif_data
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'frame_options' => :'FrameOptions',
48
+ :'height' => :'Height',
49
+ :'width' => :'Width',
50
+ :'exif_data' => :'ExifData'
51
+ }
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.swagger_types
56
+ {
57
+ :'frame_options' => :'TiffOptions',
58
+ :'height' => :'Integer',
59
+ :'width' => :'Integer',
60
+ :'exif_data' => :'ExifData'
61
+ }
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ return unless attributes.is_a?(Hash)
68
+
69
+ # convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
71
+
72
+ if attributes.has_key?(:'FrameOptions')
73
+ self.frame_options = attributes[:'FrameOptions']
74
+ end
75
+
76
+ if attributes.has_key?(:'Height')
77
+ self.height = attributes[:'Height']
78
+ end
79
+
80
+ if attributes.has_key?(:'Width')
81
+ self.width = attributes[:'Width']
82
+ end
83
+
84
+ if attributes.has_key?(:'ExifData')
85
+ self.exif_data = attributes[:'ExifData']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ if @height.nil?
94
+ invalid_properties.push('invalid value for "height", height cannot be nil.')
95
+ end
96
+
97
+ if @width.nil?
98
+ invalid_properties.push('invalid value for "width", width cannot be nil.')
99
+ end
100
+
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ return false if @height.nil?
108
+ return false if @width.nil?
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ frame_options == o.frame_options &&
118
+ height == o.height &&
119
+ width == o.width &&
120
+ exif_data == o.exif_data
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Fixnum] Hash code
131
+ def hash
132
+ [frame_options, height, width, exif_data].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ self.class.swagger_types.each_pair do |key, type|
141
+ attribute_key = self.class.attribute_map[key]
142
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
143
+ if type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[attribute_key].is_a?(Array)
147
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
148
+ end
149
+ elsif !attributes[attribute_key].nil?
150
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
151
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
152
+ end
153
+
154
+ self
155
+ end
156
+
157
+ # Deserializes the data based on type
158
+ # @param string type Data type
159
+ # @param string value Value to be deserialized
160
+ # @return [Object] Deserialized data
161
+ def _deserialize(type, value)
162
+ case type.to_sym
163
+ when :DateTime
164
+ DateTime.parse(value)
165
+ when :Date
166
+ Date.parse(value)
167
+ when :String
168
+ value.to_s
169
+ when :Integer
170
+ value.to_i
171
+ when :Float
172
+ value.to_f
173
+ when :BOOLEAN
174
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
+ true
176
+ else
177
+ false
178
+ end
179
+ when :Object
180
+ # generic object (usually a Hash), return directly
181
+ value
182
+ when /\AArray<(?<inner_type>.+)>\z/
183
+ inner_type = Regexp.last_match[:inner_type]
184
+ value.map { |v| _deserialize(inner_type, v) }
185
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
+ k_type = Regexp.last_match[:k_type]
187
+ v_type = Regexp.last_match[:v_type]
188
+ {}.tap do |hash|
189
+ value.each do |k, v|
190
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
+ end
192
+ end
193
+ else # model
194
+ temp_model = AsposeImagingCloud.const_get(type).new
195
+ temp_model.build_from_hash(value)
196
+ end
197
+ end
198
+
199
+ # Returns the string representation of the object
200
+ # @return [String] String presentation of the object
201
+ def to_s
202
+ to_hash.to_s
203
+ end
204
+
205
+ # to_body is an alias to to_hash (backward compatibility)
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_body
208
+ to_hash
209
+ end
210
+
211
+ # Returns the object in the form of hash
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_hash
214
+ hash = {}
215
+ self.class.attribute_map.each_pair do |attr, param|
216
+ value = self.send(attr)
217
+ next if value.nil?
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+
241
+ end
242
+ end
@@ -0,0 +1,734 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="tiff_options.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
+ # Represents options for TIFF frame.
31
+ class TiffOptions
32
+ # Gets or sets a value indicating whether TIFF image has valid data.
33
+ attr_accessor :is_valid
34
+
35
+ # Gets or sets the artist.
36
+ attr_accessor :artist
37
+
38
+ # Gets or sets the byte order.
39
+ attr_accessor :byte_order
40
+
41
+ # Gets or sets the bits per sample.
42
+ attr_accessor :bits_per_sample
43
+
44
+ # Gets or sets the compression.
45
+ attr_accessor :compression
46
+
47
+ # Gets or sets the copyright info.
48
+ attr_accessor :copyright
49
+
50
+ # Gets or sets the color map.
51
+ attr_accessor :color_map
52
+
53
+ # Gets or sets the date and time.
54
+ attr_accessor :date_time
55
+
56
+ # Gets or sets the document name.
57
+ attr_accessor :document_name
58
+
59
+ # Gets or sets the alpha storage.
60
+ attr_accessor :alpha_storage
61
+
62
+ # Gets or sets the fill order.
63
+ attr_accessor :fill_order
64
+
65
+ # Gets or sets the half-tone hints.
66
+ attr_accessor :half_tone_hints
67
+
68
+ # Gets or sets the image description.
69
+ attr_accessor :image_description
70
+
71
+ # Gets or sets the ink names.
72
+ attr_accessor :ink_names
73
+
74
+ # Gets or sets the scanner manufacturer.
75
+ attr_accessor :scanner_manufacturer
76
+
77
+ # Gets or sets the max sample value.
78
+ attr_accessor :max_sample_value
79
+
80
+ # Gets or sets the min sample value.
81
+ attr_accessor :min_sample_value
82
+
83
+ # Gets or sets the scanner model.
84
+ attr_accessor :scanner_model
85
+
86
+ # Gets or sets the page name.
87
+ attr_accessor :page_name
88
+
89
+ # Gets or sets the orientation.
90
+ attr_accessor :orientation
91
+
92
+ # Gets or sets the page number.
93
+ attr_accessor :page_number
94
+
95
+ # Gets or sets the photometric interpretation.
96
+ attr_accessor :photometric
97
+
98
+ # Gets or sets the planar configuration.
99
+ attr_accessor :planar_configuration
100
+
101
+ # Gets or sets the resolution unit.
102
+ attr_accessor :resolution_unit
103
+
104
+ # Gets or sets the rows per strip.
105
+ attr_accessor :rows_per_strip
106
+
107
+ # Gets or sets the sample format.
108
+ attr_accessor :sample_format
109
+
110
+ # Gets or sets the samples per pixel.
111
+ attr_accessor :samples_per_pixel
112
+
113
+ # Gets or sets the Smax sample value.
114
+ attr_accessor :smax_sample_value
115
+
116
+ # Gets or sets the Smin sample value.
117
+ attr_accessor :smin_sample_value
118
+
119
+ # Gets or sets the software type.
120
+ attr_accessor :software_type
121
+
122
+ # Gets or sets the strip byte counts.
123
+ attr_accessor :strip_byte_counts
124
+
125
+ # Gets or sets the strip offsets.
126
+ attr_accessor :strip_offsets
127
+
128
+ # Gets or sets the subfile type.
129
+ attr_accessor :sub_file_type
130
+
131
+ # Gets or sets the target printer.
132
+ attr_accessor :target_printer
133
+
134
+ # Gets or sets the threshholding.
135
+ attr_accessor :threshholding
136
+
137
+ # Gets or sets the total pages count.
138
+ attr_accessor :total_pages
139
+
140
+ # Gets or sets the X position.
141
+ attr_accessor :xposition
142
+
143
+ # Gets or sets the X resolution.
144
+ attr_accessor :xresolution
145
+
146
+ # Gets or sets the Y position.
147
+ attr_accessor :yposition
148
+
149
+ # Gets or sets the Y resolution.
150
+ attr_accessor :yresolution
151
+
152
+ # Gets or sets the FaxT4 Options.
153
+ attr_accessor :fax_t4_options
154
+
155
+ # Gets or sets the predictor (a mathematical operator that is applied to the image data before an encoding scheme is applied).
156
+ attr_accessor :predictor
157
+
158
+ # Gets or sets the image length.
159
+ attr_accessor :image_length
160
+
161
+ # Gets or sets the image width.
162
+ attr_accessor :image_width
163
+
164
+ # Gets or sets the valid tag count.
165
+ attr_accessor :valid_tag_count
166
+
167
+ # Gets or sets the bits per pixel.
168
+ attr_accessor :bits_per_pixel
169
+
170
+ # Attribute mapping from ruby-style variable name to JSON key.
171
+ def self.attribute_map
172
+ {
173
+ :'is_valid' => :'IsValid',
174
+ :'artist' => :'Artist',
175
+ :'byte_order' => :'ByteOrder',
176
+ :'bits_per_sample' => :'BitsPerSample',
177
+ :'compression' => :'Compression',
178
+ :'copyright' => :'Copyright',
179
+ :'color_map' => :'ColorMap',
180
+ :'date_time' => :'DateTime',
181
+ :'document_name' => :'DocumentName',
182
+ :'alpha_storage' => :'AlphaStorage',
183
+ :'fill_order' => :'FillOrder',
184
+ :'half_tone_hints' => :'HalfToneHints',
185
+ :'image_description' => :'ImageDescription',
186
+ :'ink_names' => :'InkNames',
187
+ :'scanner_manufacturer' => :'ScannerManufacturer',
188
+ :'max_sample_value' => :'MaxSampleValue',
189
+ :'min_sample_value' => :'MinSampleValue',
190
+ :'scanner_model' => :'ScannerModel',
191
+ :'page_name' => :'PageName',
192
+ :'orientation' => :'Orientation',
193
+ :'page_number' => :'PageNumber',
194
+ :'photometric' => :'Photometric',
195
+ :'planar_configuration' => :'PlanarConfiguration',
196
+ :'resolution_unit' => :'ResolutionUnit',
197
+ :'rows_per_strip' => :'RowsPerStrip',
198
+ :'sample_format' => :'SampleFormat',
199
+ :'samples_per_pixel' => :'SamplesPerPixel',
200
+ :'smax_sample_value' => :'SmaxSampleValue',
201
+ :'smin_sample_value' => :'SminSampleValue',
202
+ :'software_type' => :'SoftwareType',
203
+ :'strip_byte_counts' => :'StripByteCounts',
204
+ :'strip_offsets' => :'StripOffsets',
205
+ :'sub_file_type' => :'SubFileType',
206
+ :'target_printer' => :'TargetPrinter',
207
+ :'threshholding' => :'Threshholding',
208
+ :'total_pages' => :'TotalPages',
209
+ :'xposition' => :'Xposition',
210
+ :'xresolution' => :'Xresolution',
211
+ :'yposition' => :'Yposition',
212
+ :'yresolution' => :'Yresolution',
213
+ :'fax_t4_options' => :'FaxT4Options',
214
+ :'predictor' => :'Predictor',
215
+ :'image_length' => :'ImageLength',
216
+ :'image_width' => :'ImageWidth',
217
+ :'valid_tag_count' => :'ValidTagCount',
218
+ :'bits_per_pixel' => :'BitsPerPixel'
219
+ }
220
+ end
221
+
222
+ # Attribute type mapping.
223
+ def self.swagger_types
224
+ {
225
+ :'is_valid' => :'BOOLEAN',
226
+ :'artist' => :'String',
227
+ :'byte_order' => :'String',
228
+ :'bits_per_sample' => :'Array<Integer>',
229
+ :'compression' => :'String',
230
+ :'copyright' => :'String',
231
+ :'color_map' => :'Array<Integer>',
232
+ :'date_time' => :'String',
233
+ :'document_name' => :'String',
234
+ :'alpha_storage' => :'String',
235
+ :'fill_order' => :'String',
236
+ :'half_tone_hints' => :'Array<Integer>',
237
+ :'image_description' => :'String',
238
+ :'ink_names' => :'String',
239
+ :'scanner_manufacturer' => :'String',
240
+ :'max_sample_value' => :'Array<Integer>',
241
+ :'min_sample_value' => :'Array<Integer>',
242
+ :'scanner_model' => :'String',
243
+ :'page_name' => :'String',
244
+ :'orientation' => :'String',
245
+ :'page_number' => :'Array<Integer>',
246
+ :'photometric' => :'String',
247
+ :'planar_configuration' => :'String',
248
+ :'resolution_unit' => :'String',
249
+ :'rows_per_strip' => :'Integer',
250
+ :'sample_format' => :'Array<String>',
251
+ :'samples_per_pixel' => :'Integer',
252
+ :'smax_sample_value' => :'Array<Integer>',
253
+ :'smin_sample_value' => :'Array<Integer>',
254
+ :'software_type' => :'String',
255
+ :'strip_byte_counts' => :'Array<Integer>',
256
+ :'strip_offsets' => :'Array<Integer>',
257
+ :'sub_file_type' => :'String',
258
+ :'target_printer' => :'String',
259
+ :'threshholding' => :'String',
260
+ :'total_pages' => :'Integer',
261
+ :'xposition' => :'Float',
262
+ :'xresolution' => :'Float',
263
+ :'yposition' => :'Float',
264
+ :'yresolution' => :'Float',
265
+ :'fax_t4_options' => :'String',
266
+ :'predictor' => :'String',
267
+ :'image_length' => :'Integer',
268
+ :'image_width' => :'Integer',
269
+ :'valid_tag_count' => :'Integer',
270
+ :'bits_per_pixel' => :'Integer'
271
+ }
272
+ end
273
+
274
+ # Initializes the object
275
+ # @param [Hash] attributes Model attributes in the form of hash
276
+ def initialize(attributes = {})
277
+ return unless attributes.is_a?(Hash)
278
+
279
+ # convert string to symbol for hash key
280
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
281
+
282
+ if attributes.has_key?(:'IsValid')
283
+ self.is_valid = attributes[:'IsValid']
284
+ end
285
+
286
+ if attributes.has_key?(:'Artist')
287
+ self.artist = attributes[:'Artist']
288
+ end
289
+
290
+ if attributes.has_key?(:'ByteOrder')
291
+ self.byte_order = attributes[:'ByteOrder']
292
+ end
293
+
294
+ if attributes.has_key?(:'BitsPerSample')
295
+ if (value = attributes[:'BitsPerSample']).is_a?(Array)
296
+ self.bits_per_sample = value
297
+ end
298
+ end
299
+
300
+ if attributes.has_key?(:'Compression')
301
+ self.compression = attributes[:'Compression']
302
+ end
303
+
304
+ if attributes.has_key?(:'Copyright')
305
+ self.copyright = attributes[:'Copyright']
306
+ end
307
+
308
+ if attributes.has_key?(:'ColorMap')
309
+ if (value = attributes[:'ColorMap']).is_a?(Array)
310
+ self.color_map = value
311
+ end
312
+ end
313
+
314
+ if attributes.has_key?(:'DateTime')
315
+ self.date_time = attributes[:'DateTime']
316
+ end
317
+
318
+ if attributes.has_key?(:'DocumentName')
319
+ self.document_name = attributes[:'DocumentName']
320
+ end
321
+
322
+ if attributes.has_key?(:'AlphaStorage')
323
+ self.alpha_storage = attributes[:'AlphaStorage']
324
+ end
325
+
326
+ if attributes.has_key?(:'FillOrder')
327
+ self.fill_order = attributes[:'FillOrder']
328
+ end
329
+
330
+ if attributes.has_key?(:'HalfToneHints')
331
+ if (value = attributes[:'HalfToneHints']).is_a?(Array)
332
+ self.half_tone_hints = value
333
+ end
334
+ end
335
+
336
+ if attributes.has_key?(:'ImageDescription')
337
+ self.image_description = attributes[:'ImageDescription']
338
+ end
339
+
340
+ if attributes.has_key?(:'InkNames')
341
+ self.ink_names = attributes[:'InkNames']
342
+ end
343
+
344
+ if attributes.has_key?(:'ScannerManufacturer')
345
+ self.scanner_manufacturer = attributes[:'ScannerManufacturer']
346
+ end
347
+
348
+ if attributes.has_key?(:'MaxSampleValue')
349
+ if (value = attributes[:'MaxSampleValue']).is_a?(Array)
350
+ self.max_sample_value = value
351
+ end
352
+ end
353
+
354
+ if attributes.has_key?(:'MinSampleValue')
355
+ if (value = attributes[:'MinSampleValue']).is_a?(Array)
356
+ self.min_sample_value = value
357
+ end
358
+ end
359
+
360
+ if attributes.has_key?(:'ScannerModel')
361
+ self.scanner_model = attributes[:'ScannerModel']
362
+ end
363
+
364
+ if attributes.has_key?(:'PageName')
365
+ self.page_name = attributes[:'PageName']
366
+ end
367
+
368
+ if attributes.has_key?(:'Orientation')
369
+ self.orientation = attributes[:'Orientation']
370
+ end
371
+
372
+ if attributes.has_key?(:'PageNumber')
373
+ if (value = attributes[:'PageNumber']).is_a?(Array)
374
+ self.page_number = value
375
+ end
376
+ end
377
+
378
+ if attributes.has_key?(:'Photometric')
379
+ self.photometric = attributes[:'Photometric']
380
+ end
381
+
382
+ if attributes.has_key?(:'PlanarConfiguration')
383
+ self.planar_configuration = attributes[:'PlanarConfiguration']
384
+ end
385
+
386
+ if attributes.has_key?(:'ResolutionUnit')
387
+ self.resolution_unit = attributes[:'ResolutionUnit']
388
+ end
389
+
390
+ if attributes.has_key?(:'RowsPerStrip')
391
+ self.rows_per_strip = attributes[:'RowsPerStrip']
392
+ end
393
+
394
+ if attributes.has_key?(:'SampleFormat')
395
+ if (value = attributes[:'SampleFormat']).is_a?(Array)
396
+ self.sample_format = value
397
+ end
398
+ end
399
+
400
+ if attributes.has_key?(:'SamplesPerPixel')
401
+ self.samples_per_pixel = attributes[:'SamplesPerPixel']
402
+ end
403
+
404
+ if attributes.has_key?(:'SmaxSampleValue')
405
+ if (value = attributes[:'SmaxSampleValue']).is_a?(Array)
406
+ self.smax_sample_value = value
407
+ end
408
+ end
409
+
410
+ if attributes.has_key?(:'SminSampleValue')
411
+ if (value = attributes[:'SminSampleValue']).is_a?(Array)
412
+ self.smin_sample_value = value
413
+ end
414
+ end
415
+
416
+ if attributes.has_key?(:'SoftwareType')
417
+ self.software_type = attributes[:'SoftwareType']
418
+ end
419
+
420
+ if attributes.has_key?(:'StripByteCounts')
421
+ if (value = attributes[:'StripByteCounts']).is_a?(Array)
422
+ self.strip_byte_counts = value
423
+ end
424
+ end
425
+
426
+ if attributes.has_key?(:'StripOffsets')
427
+ if (value = attributes[:'StripOffsets']).is_a?(Array)
428
+ self.strip_offsets = value
429
+ end
430
+ end
431
+
432
+ if attributes.has_key?(:'SubFileType')
433
+ self.sub_file_type = attributes[:'SubFileType']
434
+ end
435
+
436
+ if attributes.has_key?(:'TargetPrinter')
437
+ self.target_printer = attributes[:'TargetPrinter']
438
+ end
439
+
440
+ if attributes.has_key?(:'Threshholding')
441
+ self.threshholding = attributes[:'Threshholding']
442
+ end
443
+
444
+ if attributes.has_key?(:'TotalPages')
445
+ self.total_pages = attributes[:'TotalPages']
446
+ end
447
+
448
+ if attributes.has_key?(:'Xposition')
449
+ self.xposition = attributes[:'Xposition']
450
+ end
451
+
452
+ if attributes.has_key?(:'Xresolution')
453
+ self.xresolution = attributes[:'Xresolution']
454
+ end
455
+
456
+ if attributes.has_key?(:'Yposition')
457
+ self.yposition = attributes[:'Yposition']
458
+ end
459
+
460
+ if attributes.has_key?(:'Yresolution')
461
+ self.yresolution = attributes[:'Yresolution']
462
+ end
463
+
464
+ if attributes.has_key?(:'FaxT4Options')
465
+ self.fax_t4_options = attributes[:'FaxT4Options']
466
+ end
467
+
468
+ if attributes.has_key?(:'Predictor')
469
+ self.predictor = attributes[:'Predictor']
470
+ end
471
+
472
+ if attributes.has_key?(:'ImageLength')
473
+ self.image_length = attributes[:'ImageLength']
474
+ end
475
+
476
+ if attributes.has_key?(:'ImageWidth')
477
+ self.image_width = attributes[:'ImageWidth']
478
+ end
479
+
480
+ if attributes.has_key?(:'ValidTagCount')
481
+ self.valid_tag_count = attributes[:'ValidTagCount']
482
+ end
483
+
484
+ if attributes.has_key?(:'BitsPerPixel')
485
+ self.bits_per_pixel = attributes[:'BitsPerPixel']
486
+ end
487
+ end
488
+
489
+ # Show invalid properties with the reasons. Usually used together with valid?
490
+ # @return Array for valid properties with the reasons
491
+ def list_invalid_properties
492
+ invalid_properties = Array.new
493
+ if @is_valid.nil?
494
+ invalid_properties.push('invalid value for "is_valid", is_valid cannot be nil.')
495
+ end
496
+
497
+ if @rows_per_strip.nil?
498
+ invalid_properties.push('invalid value for "rows_per_strip", rows_per_strip cannot be nil.')
499
+ end
500
+
501
+ if @samples_per_pixel.nil?
502
+ invalid_properties.push('invalid value for "samples_per_pixel", samples_per_pixel cannot be nil.')
503
+ end
504
+
505
+ if @total_pages.nil?
506
+ invalid_properties.push('invalid value for "total_pages", total_pages cannot be nil.')
507
+ end
508
+
509
+ if @xposition.nil?
510
+ invalid_properties.push('invalid value for "xposition", xposition cannot be nil.')
511
+ end
512
+
513
+ if @xresolution.nil?
514
+ invalid_properties.push('invalid value for "xresolution", xresolution cannot be nil.')
515
+ end
516
+
517
+ if @yposition.nil?
518
+ invalid_properties.push('invalid value for "yposition", yposition cannot be nil.')
519
+ end
520
+
521
+ if @yresolution.nil?
522
+ invalid_properties.push('invalid value for "yresolution", yresolution cannot be nil.')
523
+ end
524
+
525
+ if @image_length.nil?
526
+ invalid_properties.push('invalid value for "image_length", image_length cannot be nil.')
527
+ end
528
+
529
+ if @image_width.nil?
530
+ invalid_properties.push('invalid value for "image_width", image_width cannot be nil.')
531
+ end
532
+
533
+ if @valid_tag_count.nil?
534
+ invalid_properties.push('invalid value for "valid_tag_count", valid_tag_count cannot be nil.')
535
+ end
536
+
537
+ if @bits_per_pixel.nil?
538
+ invalid_properties.push('invalid value for "bits_per_pixel", bits_per_pixel cannot be nil.')
539
+ end
540
+
541
+ invalid_properties
542
+ end
543
+
544
+ # Check to see if the all the properties in the model are valid
545
+ # @return true if the model is valid
546
+ def valid?
547
+ return false if @is_valid.nil?
548
+ return false if @rows_per_strip.nil?
549
+ return false if @samples_per_pixel.nil?
550
+ return false if @total_pages.nil?
551
+ return false if @xposition.nil?
552
+ return false if @xresolution.nil?
553
+ return false if @yposition.nil?
554
+ return false if @yresolution.nil?
555
+ return false if @image_length.nil?
556
+ return false if @image_width.nil?
557
+ return false if @valid_tag_count.nil?
558
+ return false if @bits_per_pixel.nil?
559
+ true
560
+ end
561
+
562
+ # Checks equality by comparing each attribute.
563
+ # @param [Object] Object to be compared
564
+ def ==(o)
565
+ return true if self.equal?(o)
566
+ self.class == o.class &&
567
+ is_valid == o.is_valid &&
568
+ artist == o.artist &&
569
+ byte_order == o.byte_order &&
570
+ bits_per_sample == o.bits_per_sample &&
571
+ compression == o.compression &&
572
+ copyright == o.copyright &&
573
+ color_map == o.color_map &&
574
+ date_time == o.date_time &&
575
+ document_name == o.document_name &&
576
+ alpha_storage == o.alpha_storage &&
577
+ fill_order == o.fill_order &&
578
+ half_tone_hints == o.half_tone_hints &&
579
+ image_description == o.image_description &&
580
+ ink_names == o.ink_names &&
581
+ scanner_manufacturer == o.scanner_manufacturer &&
582
+ max_sample_value == o.max_sample_value &&
583
+ min_sample_value == o.min_sample_value &&
584
+ scanner_model == o.scanner_model &&
585
+ page_name == o.page_name &&
586
+ orientation == o.orientation &&
587
+ page_number == o.page_number &&
588
+ photometric == o.photometric &&
589
+ planar_configuration == o.planar_configuration &&
590
+ resolution_unit == o.resolution_unit &&
591
+ rows_per_strip == o.rows_per_strip &&
592
+ sample_format == o.sample_format &&
593
+ samples_per_pixel == o.samples_per_pixel &&
594
+ smax_sample_value == o.smax_sample_value &&
595
+ smin_sample_value == o.smin_sample_value &&
596
+ software_type == o.software_type &&
597
+ strip_byte_counts == o.strip_byte_counts &&
598
+ strip_offsets == o.strip_offsets &&
599
+ sub_file_type == o.sub_file_type &&
600
+ target_printer == o.target_printer &&
601
+ threshholding == o.threshholding &&
602
+ total_pages == o.total_pages &&
603
+ xposition == o.xposition &&
604
+ xresolution == o.xresolution &&
605
+ yposition == o.yposition &&
606
+ yresolution == o.yresolution &&
607
+ fax_t4_options == o.fax_t4_options &&
608
+ predictor == o.predictor &&
609
+ image_length == o.image_length &&
610
+ image_width == o.image_width &&
611
+ valid_tag_count == o.valid_tag_count &&
612
+ bits_per_pixel == o.bits_per_pixel
613
+ end
614
+
615
+ # @see the `==` method
616
+ # @param [Object] Object to be compared
617
+ def eql?(o)
618
+ self == o
619
+ end
620
+
621
+ # Calculates hash code according to all attributes.
622
+ # @return [Fixnum] Hash code
623
+ def hash
624
+ [is_valid, artist, byte_order, bits_per_sample, compression, copyright, color_map, date_time, document_name, alpha_storage, fill_order, half_tone_hints, image_description, ink_names, scanner_manufacturer, max_sample_value, min_sample_value, scanner_model, page_name, orientation, page_number, photometric, planar_configuration, resolution_unit, rows_per_strip, sample_format, samples_per_pixel, smax_sample_value, smin_sample_value, software_type, strip_byte_counts, strip_offsets, sub_file_type, target_printer, threshholding, total_pages, xposition, xresolution, yposition, yresolution, fax_t4_options, predictor, image_length, image_width, valid_tag_count, bits_per_pixel].hash
625
+ end
626
+
627
+ # Builds the object from hash
628
+ # @param [Hash] attributes Model attributes in the form of hash
629
+ # @return [Object] Returns the model itself
630
+ def build_from_hash(attributes)
631
+ return nil unless attributes.is_a?(Hash)
632
+ self.class.swagger_types.each_pair do |key, type|
633
+ attribute_key = self.class.attribute_map[key]
634
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
635
+ if type =~ /\AArray<(.*)>/i
636
+ # check to ensure the input is an array given that the the attribute
637
+ # is documented as an array but the input is not
638
+ if attributes[attribute_key].is_a?(Array)
639
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
640
+ end
641
+ elsif !attributes[attribute_key].nil?
642
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
643
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
644
+ end
645
+
646
+ self
647
+ end
648
+
649
+ # Deserializes the data based on type
650
+ # @param string type Data type
651
+ # @param string value Value to be deserialized
652
+ # @return [Object] Deserialized data
653
+ def _deserialize(type, value)
654
+ case type.to_sym
655
+ when :DateTime
656
+ DateTime.parse(value)
657
+ when :Date
658
+ Date.parse(value)
659
+ when :String
660
+ value.to_s
661
+ when :Integer
662
+ value.to_i
663
+ when :Float
664
+ value.to_f
665
+ when :BOOLEAN
666
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
667
+ true
668
+ else
669
+ false
670
+ end
671
+ when :Object
672
+ # generic object (usually a Hash), return directly
673
+ value
674
+ when /\AArray<(?<inner_type>.+)>\z/
675
+ inner_type = Regexp.last_match[:inner_type]
676
+ value.map { |v| _deserialize(inner_type, v) }
677
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
678
+ k_type = Regexp.last_match[:k_type]
679
+ v_type = Regexp.last_match[:v_type]
680
+ {}.tap do |hash|
681
+ value.each do |k, v|
682
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
683
+ end
684
+ end
685
+ else # model
686
+ temp_model = AsposeImagingCloud.const_get(type).new
687
+ temp_model.build_from_hash(value)
688
+ end
689
+ end
690
+
691
+ # Returns the string representation of the object
692
+ # @return [String] String presentation of the object
693
+ def to_s
694
+ to_hash.to_s
695
+ end
696
+
697
+ # to_body is an alias to to_hash (backward compatibility)
698
+ # @return [Hash] Returns the object in the form of hash
699
+ def to_body
700
+ to_hash
701
+ end
702
+
703
+ # Returns the object in the form of hash
704
+ # @return [Hash] Returns the object in the form of hash
705
+ def to_hash
706
+ hash = {}
707
+ self.class.attribute_map.each_pair do |attr, param|
708
+ value = self.send(attr)
709
+ next if value.nil?
710
+ hash[param] = _to_hash(value)
711
+ end
712
+ hash
713
+ end
714
+
715
+ # Outputs non-array value in the form of hash
716
+ # For object, use to_hash. Otherwise, just return the value
717
+ # @param [Object] value Any valid value
718
+ # @return [Hash] Returns the value in the form of hash
719
+ def _to_hash(value)
720
+ if value.is_a?(Array)
721
+ value.compact.map { |v| _to_hash(v) }
722
+ elsif value.is_a?(Hash)
723
+ {}.tap do |hash|
724
+ value.each { |k, v| hash[k] = _to_hash(v) }
725
+ end
726
+ elsif value.respond_to? :to_hash
727
+ value.to_hash
728
+ else
729
+ value
730
+ end
731
+ end
732
+
733
+ end
734
+ end