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="small_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
+ # Small rectangular filter options
31
+ class SmallRectangularFilterProperties
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,207 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="storage_exist.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
+ # Storage exists
31
+ class StorageExist
32
+ # Shows that the storage exists.
33
+ attr_accessor :exists
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'exists' => :'Exists'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'exists' => :'BOOLEAN'
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?(:'Exists')
58
+ self.exists = attributes[:'Exists']
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
+ if @exists.nil?
67
+ invalid_properties.push('invalid value for "exists", exists cannot be nil.')
68
+ end
69
+
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ return false if @exists.nil?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ exists == o.exists
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(o)
91
+ self == o
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Fixnum] Hash code
96
+ def hash
97
+ [exists].hash
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def build_from_hash(attributes)
104
+ return nil unless attributes.is_a?(Hash)
105
+ self.class.swagger_types.each_pair do |key, type|
106
+ attribute_key = self.class.attribute_map[key]
107
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
108
+ if type =~ /\AArray<(.*)>/i
109
+ # check to ensure the input is an array given that the the attribute
110
+ # is documented as an array but the input is not
111
+ if attributes[attribute_key].is_a?(Array)
112
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
113
+ end
114
+ elsif !attributes[attribute_key].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
116
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
117
+ end
118
+
119
+ self
120
+ end
121
+
122
+ # Deserializes the data based on type
123
+ # @param string type Data type
124
+ # @param string value Value to be deserialized
125
+ # @return [Object] Deserialized data
126
+ def _deserialize(type, value)
127
+ case type.to_sym
128
+ when :DateTime
129
+ DateTime.parse(value)
130
+ when :Date
131
+ Date.parse(value)
132
+ when :String
133
+ value.to_s
134
+ when :Integer
135
+ value.to_i
136
+ when :Float
137
+ value.to_f
138
+ when :BOOLEAN
139
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
140
+ true
141
+ else
142
+ false
143
+ end
144
+ when :Object
145
+ # generic object (usually a Hash), return directly
146
+ value
147
+ when /\AArray<(?<inner_type>.+)>\z/
148
+ inner_type = Regexp.last_match[:inner_type]
149
+ value.map { |v| _deserialize(inner_type, v) }
150
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
151
+ k_type = Regexp.last_match[:k_type]
152
+ v_type = Regexp.last_match[:v_type]
153
+ {}.tap do |hash|
154
+ value.each do |k, v|
155
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
156
+ end
157
+ end
158
+ else # model
159
+ temp_model = AsposeImagingCloud.const_get(type).new
160
+ temp_model.build_from_hash(value)
161
+ end
162
+ end
163
+
164
+ # Returns the string representation of the object
165
+ # @return [String] String presentation of the object
166
+ def to_s
167
+ to_hash.to_s
168
+ end
169
+
170
+ # to_body is an alias to to_hash (backward compatibility)
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_body
173
+ to_hash
174
+ end
175
+
176
+ # Returns the object in the form of hash
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_hash
179
+ hash = {}
180
+ self.class.attribute_map.each_pair do |attr, param|
181
+ value = self.send(attr)
182
+ next if value.nil?
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map { |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+
206
+ end
207
+ end
@@ -0,0 +1,252 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="storage_file.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
+ # File or folder information
31
+ class StorageFile
32
+ # File or folder name.
33
+ attr_accessor :name
34
+
35
+ # True if it is a folder.
36
+ attr_accessor :is_folder
37
+
38
+ # File or folder last modified DateTime.
39
+ attr_accessor :modified_date
40
+
41
+ # File or folder size.
42
+ attr_accessor :size
43
+
44
+ # File or folder path.
45
+ attr_accessor :path
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'name' => :'Name',
51
+ :'is_folder' => :'IsFolder',
52
+ :'modified_date' => :'ModifiedDate',
53
+ :'size' => :'Size',
54
+ :'path' => :'Path'
55
+ }
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.swagger_types
60
+ {
61
+ :'name' => :'String',
62
+ :'is_folder' => :'BOOLEAN',
63
+ :'modified_date' => :'DateTime',
64
+ :'size' => :'Integer',
65
+ :'path' => :'String'
66
+ }
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ return unless attributes.is_a?(Hash)
73
+
74
+ # convert string to symbol for hash key
75
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
76
+
77
+ if attributes.has_key?(:'Name')
78
+ self.name = attributes[:'Name']
79
+ end
80
+
81
+ if attributes.has_key?(:'IsFolder')
82
+ self.is_folder = attributes[:'IsFolder']
83
+ end
84
+
85
+ if attributes.has_key?(:'ModifiedDate')
86
+ self.modified_date = attributes[:'ModifiedDate']
87
+ end
88
+
89
+ if attributes.has_key?(:'Size')
90
+ self.size = attributes[:'Size']
91
+ end
92
+
93
+ if attributes.has_key?(:'Path')
94
+ self.path = attributes[:'Path']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ invalid_properties = Array.new
102
+ if @is_folder.nil?
103
+ invalid_properties.push('invalid value for "is_folder", is_folder cannot be nil.')
104
+ end
105
+
106
+ if @size.nil?
107
+ invalid_properties.push('invalid value for "size", size cannot be nil.')
108
+ end
109
+
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ return false if @is_folder.nil?
117
+ return false if @size.nil?
118
+ true
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ name == o.name &&
127
+ is_folder == o.is_folder &&
128
+ modified_date == o.modified_date &&
129
+ size == o.size &&
130
+ path == o.path
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Fixnum] Hash code
141
+ def hash
142
+ [name, is_folder, modified_date, size, path].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ self.class.swagger_types.each_pair do |key, type|
151
+ attribute_key = self.class.attribute_map[key]
152
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
153
+ if type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[attribute_key].is_a?(Array)
157
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
158
+ end
159
+ elsif !attributes[attribute_key].nil?
160
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
161
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
162
+ end
163
+
164
+ self
165
+ end
166
+
167
+ # Deserializes the data based on type
168
+ # @param string type Data type
169
+ # @param string value Value to be deserialized
170
+ # @return [Object] Deserialized data
171
+ def _deserialize(type, value)
172
+ case type.to_sym
173
+ when :DateTime
174
+ DateTime.parse(value)
175
+ when :Date
176
+ Date.parse(value)
177
+ when :String
178
+ value.to_s
179
+ when :Integer
180
+ value.to_i
181
+ when :Float
182
+ value.to_f
183
+ when :BOOLEAN
184
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
185
+ true
186
+ else
187
+ false
188
+ end
189
+ when :Object
190
+ # generic object (usually a Hash), return directly
191
+ value
192
+ when /\AArray<(?<inner_type>.+)>\z/
193
+ inner_type = Regexp.last_match[:inner_type]
194
+ value.map { |v| _deserialize(inner_type, v) }
195
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
196
+ k_type = Regexp.last_match[:k_type]
197
+ v_type = Regexp.last_match[:v_type]
198
+ {}.tap do |hash|
199
+ value.each do |k, v|
200
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
201
+ end
202
+ end
203
+ else # model
204
+ temp_model = AsposeImagingCloud.const_get(type).new
205
+ temp_model.build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ next if value.nil?
228
+ hash[param] = _to_hash(value)
229
+ end
230
+ hash
231
+ end
232
+
233
+ # Outputs non-array value in the form of hash
234
+ # For object, use to_hash. Otherwise, just return the value
235
+ # @param [Object] value Any valid value
236
+ # @return [Hash] Returns the value in the form of hash
237
+ def _to_hash(value)
238
+ if value.is_a?(Array)
239
+ value.compact.map { |v| _to_hash(v) }
240
+ elsif value.is_a?(Hash)
241
+ {}.tap do |hash|
242
+ value.each { |k, v| hash[k] = _to_hash(v) }
243
+ end
244
+ elsif value.respond_to? :to_hash
245
+ value.to_hash
246
+ else
247
+ value
248
+ end
249
+ end
250
+
251
+ end
252
+ end