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.
- checksums.yaml +5 -5
- data/README.md +224 -61
- data/lib/aspose-imaging-cloud.rb +161 -0
- data/lib/aspose-imaging-cloud/api/imaging_api.rb +684 -0
- data/lib/aspose-imaging-cloud/api_client.rb +357 -0
- data/lib/aspose-imaging-cloud/api_error.rb +42 -0
- data/lib/{aspose_imaging_cloud → aspose-imaging-cloud}/configuration.rb +236 -166
- data/lib/aspose-imaging-cloud/models/big_rectangular_filter_properties.rb +206 -0
- data/lib/aspose-imaging-cloud/models/bilateral_smoothing_filter_properties.rb +281 -0
- data/lib/aspose-imaging-cloud/models/bmp_properties.rb +202 -0
- data/lib/aspose-imaging-cloud/models/convolution_filter_properties.rb +236 -0
- data/lib/aspose-imaging-cloud/models/deconvolution_filter_properties.rb +266 -0
- data/lib/aspose-imaging-cloud/models/dicom_properties.rb +584 -0
- data/lib/aspose-imaging-cloud/models/disc_usage.rb +222 -0
- data/lib/aspose-imaging-cloud/models/djvu_properties.rb +232 -0
- data/lib/aspose-imaging-cloud/models/dng_properties.rb +329 -0
- data/lib/aspose-imaging-cloud/models/error.rb +232 -0
- data/lib/aspose-imaging-cloud/models/error_details.rb +217 -0
- data/lib/aspose-imaging-cloud/models/exif_data.rb +1560 -0
- data/lib/aspose-imaging-cloud/models/file_version.rb +277 -0
- data/lib/aspose-imaging-cloud/models/file_versions.rb +204 -0
- data/lib/aspose-imaging-cloud/models/files_list.rb +204 -0
- data/lib/aspose-imaging-cloud/models/files_upload_result.rb +216 -0
- data/lib/aspose-imaging-cloud/models/filter_properties_base.rb +206 -0
- data/lib/aspose-imaging-cloud/models/gauss_wiener_filter_properties.rb +296 -0
- data/lib/aspose-imaging-cloud/models/gaussian_blur_filter_properties.rb +266 -0
- data/lib/aspose-imaging-cloud/models/gif_properties.rb +247 -0
- data/lib/aspose-imaging-cloud/models/image_duplicates.rb +204 -0
- data/lib/aspose-imaging-cloud/models/image_duplicates_set.rb +204 -0
- data/lib/aspose-imaging-cloud/models/image_features.rb +257 -0
- data/lib/aspose-imaging-cloud/models/imaging_response.rb +412 -0
- data/lib/aspose-imaging-cloud/models/jfif_data.rb +247 -0
- data/lib/aspose-imaging-cloud/models/jpeg2000_properties.rb +214 -0
- data/lib/aspose-imaging-cloud/models/jpeg_exif_data.rb +1738 -0
- data/lib/aspose-imaging-cloud/models/jpeg_properties.rb +222 -0
- data/lib/aspose-imaging-cloud/models/median_filter_properties.rb +221 -0
- data/lib/aspose-imaging-cloud/models/motion_wiener_filter_properties.rb +311 -0
- data/lib/aspose-imaging-cloud/models/object_exist.rb +222 -0
- data/lib/aspose-imaging-cloud/models/odg_metadata.rb +372 -0
- data/lib/aspose-imaging-cloud/models/odg_page.rb +222 -0
- data/lib/aspose-imaging-cloud/models/odg_properties.rb +229 -0
- data/lib/aspose-imaging-cloud/models/png_properties.rb +192 -0
- data/lib/aspose-imaging-cloud/models/psd_properties.rb +242 -0
- data/lib/aspose-imaging-cloud/models/requests/add_search_image_request.rb +91 -0
- data/lib/aspose-imaging-cloud/models/requests/append_tiff_request.rb +88 -0
- data/lib/aspose-imaging-cloud/models/requests/compare_images_request.rb +94 -0
- data/lib/aspose-imaging-cloud/models/requests/convert_tiff_to_fax_request.rb +80 -0
- data/lib/aspose-imaging-cloud/models/requests/copy_file_request.rb +91 -0
- data/lib/aspose-imaging-cloud/models/requests/copy_folder_request.rb +88 -0
- data/lib/aspose-imaging-cloud/models/requests/create_cropped_image_request.rb +121 -0
- data/lib/aspose-imaging-cloud/models/requests/create_folder_request.rb +77 -0
- data/lib/aspose-imaging-cloud/models/requests/create_image_features_request.rb +89 -0
- data/lib/aspose-imaging-cloud/models/requests/create_image_frame_request.rb +112 -0
- data/lib/aspose-imaging-cloud/models/requests/create_image_search_request.rb +79 -0
- data/lib/aspose-imaging-cloud/models/requests/create_image_tag_request.rb +96 -0
- data/lib/aspose-imaging-cloud/models/requests/create_modified_bmp_request.rb +108 -0
- data/lib/aspose-imaging-cloud/models/requests/create_modified_emf_request.rb +127 -0
- data/lib/aspose-imaging-cloud/models/requests/create_modified_gif_request.rb +102 -0
- data/lib/aspose-imaging-cloud/models/requests/create_modified_jpeg2000_request.rb +95 -0
- data/lib/aspose-imaging-cloud/models/requests/create_modified_jpeg_request.rb +90 -0
- data/lib/aspose-imaging-cloud/models/requests/create_modified_psd_request.rb +90 -0
- data/lib/aspose-imaging-cloud/models/requests/create_modified_svg_request.rb +114 -0
- data/lib/aspose-imaging-cloud/models/requests/create_modified_tiff_request.rb +104 -0
- data/lib/aspose-imaging-cloud/models/requests/create_modified_web_p_request.rb +116 -0
- data/lib/aspose-imaging-cloud/models/requests/create_modified_wmf_request.rb +127 -0
- data/lib/aspose-imaging-cloud/models/requests/create_resized_image_request.rb +105 -0
- data/lib/aspose-imaging-cloud/models/requests/create_rotate_flipped_image_request.rb +97 -0
- data/lib/aspose-imaging-cloud/models/requests/create_saved_image_as_request.rb +89 -0
- data/lib/aspose-imaging-cloud/models/requests/create_updated_image_request.rb +145 -0
- data/lib/aspose-imaging-cloud/models/requests/create_web_site_image_features_request.rb +88 -0
- data/lib/aspose-imaging-cloud/models/requests/crop_image_request.rb +120 -0
- data/lib/aspose-imaging-cloud/models/requests/delete_file_request.rb +80 -0
- data/lib/aspose-imaging-cloud/models/requests/delete_folder_request.rb +80 -0
- data/lib/aspose-imaging-cloud/models/requests/delete_image_features_request.rb +88 -0
- data/lib/aspose-imaging-cloud/models/requests/delete_image_search_request.rb +80 -0
- data/lib/aspose-imaging-cloud/models/requests/delete_search_image_request.rb +88 -0
- data/lib/aspose-imaging-cloud/models/requests/download_file_request.rb +80 -0
- data/lib/aspose-imaging-cloud/models/requests/extract_image_features_request.rb +91 -0
- data/lib/aspose-imaging-cloud/models/requests/extract_image_frame_properties_request.rb +82 -0
- data/lib/aspose-imaging-cloud/models/requests/extract_image_properties_request.rb +75 -0
- data/lib/aspose-imaging-cloud/models/requests/filter_effect_image_request.rb +103 -0
- data/lib/aspose-imaging-cloud/models/requests/find_image_duplicates_request.rb +88 -0
- data/lib/aspose-imaging-cloud/models/requests/find_images_by_tags_request.rb +104 -0
- data/lib/aspose-imaging-cloud/models/requests/find_similar_images_request.rb +102 -0
- data/lib/aspose-imaging-cloud/models/requests/get_disc_usage_request.rb +70 -0
- data/lib/aspose-imaging-cloud/models/requests/get_file_versions_request.rb +77 -0
- data/lib/aspose-imaging-cloud/models/requests/get_files_list_request.rb +77 -0
- data/lib/aspose-imaging-cloud/models/requests/get_image_features_request.rb +88 -0
- data/lib/aspose-imaging-cloud/models/requests/get_image_frame_properties_request.rb +87 -0
- data/lib/aspose-imaging-cloud/models/requests/get_image_frame_request.rb +111 -0
- data/lib/aspose-imaging-cloud/models/requests/get_image_properties_request.rb +80 -0
- data/lib/aspose-imaging-cloud/models/requests/get_image_search_status_request.rb +80 -0
- data/lib/aspose-imaging-cloud/models/requests/get_search_image_request.rb +88 -0
- data/lib/aspose-imaging-cloud/models/requests/http_request.rb +50 -0
- data/lib/aspose-imaging-cloud/models/requests/imaging_request.rb +101 -0
- data/lib/aspose-imaging-cloud/models/requests/modify_bmp_request.rb +107 -0
- data/lib/aspose-imaging-cloud/models/requests/modify_emf_request.rb +126 -0
- data/lib/aspose-imaging-cloud/models/requests/modify_gif_request.rb +101 -0
- data/lib/aspose-imaging-cloud/models/requests/modify_jpeg2000_request.rb +94 -0
- data/lib/aspose-imaging-cloud/models/requests/modify_jpeg_request.rb +89 -0
- data/lib/aspose-imaging-cloud/models/requests/modify_psd_request.rb +89 -0
- data/lib/aspose-imaging-cloud/models/requests/modify_svg_request.rb +113 -0
- data/lib/aspose-imaging-cloud/models/requests/modify_tiff_request.rb +103 -0
- data/lib/aspose-imaging-cloud/models/requests/modify_web_p_request.rb +115 -0
- data/lib/aspose-imaging-cloud/models/requests/modify_wmf_request.rb +126 -0
- data/lib/aspose-imaging-cloud/models/requests/move_file_request.rb +91 -0
- data/lib/aspose-imaging-cloud/models/requests/move_folder_request.rb +88 -0
- data/lib/aspose-imaging-cloud/models/requests/object_exists_request.rb +80 -0
- data/lib/aspose-imaging-cloud/models/requests/resize_image_request.rb +104 -0
- data/lib/aspose-imaging-cloud/models/requests/rotate_flip_image_request.rb +96 -0
- data/lib/aspose-imaging-cloud/models/requests/save_image_as_request.rb +88 -0
- data/lib/aspose-imaging-cloud/models/requests/storage_exists_request.rb +74 -0
- data/lib/aspose-imaging-cloud/models/requests/update_image_features_request.rb +91 -0
- data/lib/aspose-imaging-cloud/models/requests/update_image_request.rb +144 -0
- data/lib/aspose-imaging-cloud/models/requests/update_search_image_request.rb +91 -0
- data/lib/aspose-imaging-cloud/models/requests/upload_file_request.rb +86 -0
- data/lib/aspose-imaging-cloud/models/search_context_status.rb +212 -0
- data/lib/aspose-imaging-cloud/models/search_result.rb +217 -0
- data/lib/aspose-imaging-cloud/models/search_results_set.rb +204 -0
- data/lib/aspose-imaging-cloud/models/sharpen_filter_properties.rb +266 -0
- data/lib/aspose-imaging-cloud/models/small_rectangular_filter_properties.rb +206 -0
- data/lib/aspose-imaging-cloud/models/storage_exist.rb +207 -0
- data/lib/aspose-imaging-cloud/models/storage_file.rb +252 -0
- data/lib/aspose-imaging-cloud/models/svg_properties.rb +202 -0
- data/lib/aspose-imaging-cloud/models/tiff_frame.rb +242 -0
- data/lib/aspose-imaging-cloud/models/tiff_options.rb +734 -0
- data/lib/aspose-imaging-cloud/models/tiff_properties.rb +224 -0
- data/lib/aspose-imaging-cloud/models/web_p_properties.rb +252 -0
- data/lib/aspose-imaging-cloud/version.rb +15 -0
- metadata +149 -129
- data/LICENSE +0 -22
- data/aspose_imaging_cloud.gemspec +0 -26
- data/lib/aspose_imaging_cloud.rb +0 -43
- data/lib/aspose_imaging_cloud/api/imaging_api.rb +0 -1776
- data/lib/aspose_imaging_cloud/api_client.rb +0 -335
- data/lib/aspose_imaging_cloud/api_error.rb +0 -24
- data/lib/aspose_imaging_cloud/models/base_object.rb +0 -86
- data/lib/aspose_imaging_cloud/models/base_response.rb +0 -53
- data/lib/aspose_imaging_cloud/models/bmp_properties.rb +0 -37
- data/lib/aspose_imaging_cloud/models/exif_data.rb +0 -855
- data/lib/aspose_imaging_cloud/models/gif_properties.rb +0 -53
- data/lib/aspose_imaging_cloud/models/imaging_response.rb +0 -149
- data/lib/aspose_imaging_cloud/models/jfif_data.rb +0 -61
- data/lib/aspose_imaging_cloud/models/jpeg_exif_data.rb +0 -991
- data/lib/aspose_imaging_cloud/models/jpeg_properties.rb +0 -53
- data/lib/aspose_imaging_cloud/models/psd_properties.rb +0 -61
- data/lib/aspose_imaging_cloud/models/tiff_frame.rb +0 -61
- data/lib/aspose_imaging_cloud/models/tiff_options.rb +0 -419
- data/lib/aspose_imaging_cloud/models/tiff_properties.rb +0 -55
- data/lib/aspose_imaging_cloud/version.rb +0 -3
- data/test/data/TestDemo.tif +0 -0
- data/test/data/aspose.jpg +0 -0
- data/test/data/aspose_imaging_for_cloud.png +0 -0
- data/test/data/demo.tif +0 -0
- data/test/data/sample-multi.tif +0 -0
- data/test/data/sample.bmp +0 -0
- data/test/data/sample.gif +0 -0
- data/test/data/sample.psd +0 -0
- data/test/data/sample.tif +0 -0
- data/test/data/test.bmp +0 -0
- data/test/imaging_tests.rb +0 -291
@@ -0,0 +1,204 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="image_duplicates_set.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
|
+
# Duplicate images set.
|
31
|
+
class ImageDuplicatesSet
|
32
|
+
# Gets the duplicate images.
|
33
|
+
attr_accessor :duplicates
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'duplicates' => :'Duplicates'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.swagger_types
|
44
|
+
{
|
45
|
+
:'duplicates' => :'Array<ImageDuplicates>'
|
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?(:'Duplicates')
|
58
|
+
if (value = attributes[:'Duplicates']).is_a?(Array)
|
59
|
+
self.duplicates = value
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
65
|
+
# @return Array for valid properties with the reasons
|
66
|
+
def list_invalid_properties
|
67
|
+
invalid_properties = Array.new
|
68
|
+
invalid_properties
|
69
|
+
end
|
70
|
+
|
71
|
+
# Check to see if the all the properties in the model are valid
|
72
|
+
# @return true if the model is valid
|
73
|
+
def valid?
|
74
|
+
true
|
75
|
+
end
|
76
|
+
|
77
|
+
# Checks equality by comparing each attribute.
|
78
|
+
# @param [Object] Object to be compared
|
79
|
+
def ==(o)
|
80
|
+
return true if self.equal?(o)
|
81
|
+
self.class == o.class &&
|
82
|
+
duplicates == o.duplicates
|
83
|
+
end
|
84
|
+
|
85
|
+
# @see the `==` method
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def eql?(o)
|
88
|
+
self == o
|
89
|
+
end
|
90
|
+
|
91
|
+
# Calculates hash code according to all attributes.
|
92
|
+
# @return [Fixnum] Hash code
|
93
|
+
def hash
|
94
|
+
[duplicates].hash
|
95
|
+
end
|
96
|
+
|
97
|
+
# Builds the object from hash
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
# @return [Object] Returns the model itself
|
100
|
+
def build_from_hash(attributes)
|
101
|
+
return nil unless attributes.is_a?(Hash)
|
102
|
+
self.class.swagger_types.each_pair do |key, type|
|
103
|
+
attribute_key = self.class.attribute_map[key]
|
104
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
105
|
+
if type =~ /\AArray<(.*)>/i
|
106
|
+
# check to ensure the input is an array given that the the attribute
|
107
|
+
# is documented as an array but the input is not
|
108
|
+
if attributes[attribute_key].is_a?(Array)
|
109
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
110
|
+
end
|
111
|
+
elsif !attributes[attribute_key].nil?
|
112
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
113
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
114
|
+
end
|
115
|
+
|
116
|
+
self
|
117
|
+
end
|
118
|
+
|
119
|
+
# Deserializes the data based on type
|
120
|
+
# @param string type Data type
|
121
|
+
# @param string value Value to be deserialized
|
122
|
+
# @return [Object] Deserialized data
|
123
|
+
def _deserialize(type, value)
|
124
|
+
case type.to_sym
|
125
|
+
when :DateTime
|
126
|
+
DateTime.parse(value)
|
127
|
+
when :Date
|
128
|
+
Date.parse(value)
|
129
|
+
when :String
|
130
|
+
value.to_s
|
131
|
+
when :Integer
|
132
|
+
value.to_i
|
133
|
+
when :Float
|
134
|
+
value.to_f
|
135
|
+
when :BOOLEAN
|
136
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
137
|
+
true
|
138
|
+
else
|
139
|
+
false
|
140
|
+
end
|
141
|
+
when :Object
|
142
|
+
# generic object (usually a Hash), return directly
|
143
|
+
value
|
144
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
145
|
+
inner_type = Regexp.last_match[:inner_type]
|
146
|
+
value.map { |v| _deserialize(inner_type, v) }
|
147
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
148
|
+
k_type = Regexp.last_match[:k_type]
|
149
|
+
v_type = Regexp.last_match[:v_type]
|
150
|
+
{}.tap do |hash|
|
151
|
+
value.each do |k, v|
|
152
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
else # model
|
156
|
+
temp_model = AsposeImagingCloud.const_get(type).new
|
157
|
+
temp_model.build_from_hash(value)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Returns the string representation of the object
|
162
|
+
# @return [String] String presentation of the object
|
163
|
+
def to_s
|
164
|
+
to_hash.to_s
|
165
|
+
end
|
166
|
+
|
167
|
+
# to_body is an alias to to_hash (backward compatibility)
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
169
|
+
def to_body
|
170
|
+
to_hash
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the object in the form of hash
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_hash
|
176
|
+
hash = {}
|
177
|
+
self.class.attribute_map.each_pair do |attr, param|
|
178
|
+
value = self.send(attr)
|
179
|
+
next if value.nil?
|
180
|
+
hash[param] = _to_hash(value)
|
181
|
+
end
|
182
|
+
hash
|
183
|
+
end
|
184
|
+
|
185
|
+
# Outputs non-array value in the form of hash
|
186
|
+
# For object, use to_hash. Otherwise, just return the value
|
187
|
+
# @param [Object] value Any valid value
|
188
|
+
# @return [Hash] Returns the value in the form of hash
|
189
|
+
def _to_hash(value)
|
190
|
+
if value.is_a?(Array)
|
191
|
+
value.compact.map { |v| _to_hash(v) }
|
192
|
+
elsif value.is_a?(Hash)
|
193
|
+
{}.tap do |hash|
|
194
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
195
|
+
end
|
196
|
+
elsif value.respond_to? :to_hash
|
197
|
+
value.to_hash
|
198
|
+
else
|
199
|
+
value
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
end
|
204
|
+
end
|
@@ -0,0 +1,257 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="image_features.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
|
+
# Image features.
|
31
|
+
class ImageFeatures
|
32
|
+
# Gets the image identifier.
|
33
|
+
attr_accessor :image_id
|
34
|
+
|
35
|
+
# Gets the features count.
|
36
|
+
attr_accessor :features_count
|
37
|
+
|
38
|
+
# Gets the feature length in bits.
|
39
|
+
attr_accessor :feature_length_in_bits
|
40
|
+
|
41
|
+
# Gets the features.
|
42
|
+
attr_accessor :features
|
43
|
+
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
45
|
+
def self.attribute_map
|
46
|
+
{
|
47
|
+
:'image_id' => :'ImageId',
|
48
|
+
:'features_count' => :'FeaturesCount',
|
49
|
+
:'feature_length_in_bits' => :'FeatureLengthInBits',
|
50
|
+
:'features' => :'Features'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Attribute type mapping.
|
55
|
+
def self.swagger_types
|
56
|
+
{
|
57
|
+
:'image_id' => :'String',
|
58
|
+
:'features_count' => :'Integer',
|
59
|
+
:'feature_length_in_bits' => :'Integer',
|
60
|
+
:'features' => :'String'
|
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?(:'ImageId')
|
73
|
+
self.image_id = attributes[:'ImageId']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.has_key?(:'FeaturesCount')
|
77
|
+
self.features_count = attributes[:'FeaturesCount']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.has_key?(:'FeatureLengthInBits')
|
81
|
+
self.feature_length_in_bits = attributes[:'FeatureLengthInBits']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.has_key?(:'Features')
|
85
|
+
self.features = attributes[:'Features']
|
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 @features_count.nil?
|
94
|
+
invalid_properties.push('invalid value for "features_count", features_count cannot be nil.')
|
95
|
+
end
|
96
|
+
|
97
|
+
if @feature_length_in_bits.nil?
|
98
|
+
invalid_properties.push('invalid value for "feature_length_in_bits", feature_length_in_bits cannot be nil.')
|
99
|
+
end
|
100
|
+
|
101
|
+
if !@features.nil? && @features !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
|
102
|
+
invalid_properties.push('invalid value for "features", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.')
|
103
|
+
end
|
104
|
+
|
105
|
+
invalid_properties
|
106
|
+
end
|
107
|
+
|
108
|
+
# Check to see if the all the properties in the model are valid
|
109
|
+
# @return true if the model is valid
|
110
|
+
def valid?
|
111
|
+
return false if @features_count.nil?
|
112
|
+
return false if @feature_length_in_bits.nil?
|
113
|
+
return false if !@features.nil? && @features !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
|
114
|
+
true
|
115
|
+
end
|
116
|
+
|
117
|
+
# Custom attribute writer method with validation
|
118
|
+
# @param [Object] features Value to be assigned
|
119
|
+
def features=(features)
|
120
|
+
if !features.nil? && features !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
|
121
|
+
fail ArgumentError, 'invalid value for "features", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.'
|
122
|
+
end
|
123
|
+
|
124
|
+
@features = features
|
125
|
+
end
|
126
|
+
|
127
|
+
# Checks equality by comparing each attribute.
|
128
|
+
# @param [Object] Object to be compared
|
129
|
+
def ==(o)
|
130
|
+
return true if self.equal?(o)
|
131
|
+
self.class == o.class &&
|
132
|
+
image_id == o.image_id &&
|
133
|
+
features_count == o.features_count &&
|
134
|
+
feature_length_in_bits == o.feature_length_in_bits &&
|
135
|
+
features == o.features
|
136
|
+
end
|
137
|
+
|
138
|
+
# @see the `==` method
|
139
|
+
# @param [Object] Object to be compared
|
140
|
+
def eql?(o)
|
141
|
+
self == o
|
142
|
+
end
|
143
|
+
|
144
|
+
# Calculates hash code according to all attributes.
|
145
|
+
# @return [Fixnum] Hash code
|
146
|
+
def hash
|
147
|
+
[image_id, features_count, feature_length_in_bits, features].hash
|
148
|
+
end
|
149
|
+
|
150
|
+
# Builds the object from hash
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
152
|
+
# @return [Object] Returns the model itself
|
153
|
+
def build_from_hash(attributes)
|
154
|
+
return nil unless attributes.is_a?(Hash)
|
155
|
+
self.class.swagger_types.each_pair do |key, type|
|
156
|
+
attribute_key = self.class.attribute_map[key]
|
157
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
158
|
+
if type =~ /\AArray<(.*)>/i
|
159
|
+
# check to ensure the input is an array given that the the attribute
|
160
|
+
# is documented as an array but the input is not
|
161
|
+
if attributes[attribute_key].is_a?(Array)
|
162
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
163
|
+
end
|
164
|
+
elsif !attributes[attribute_key].nil?
|
165
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
166
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
167
|
+
end
|
168
|
+
|
169
|
+
self
|
170
|
+
end
|
171
|
+
|
172
|
+
# Deserializes the data based on type
|
173
|
+
# @param string type Data type
|
174
|
+
# @param string value Value to be deserialized
|
175
|
+
# @return [Object] Deserialized data
|
176
|
+
def _deserialize(type, value)
|
177
|
+
case type.to_sym
|
178
|
+
when :DateTime
|
179
|
+
DateTime.parse(value)
|
180
|
+
when :Date
|
181
|
+
Date.parse(value)
|
182
|
+
when :String
|
183
|
+
value.to_s
|
184
|
+
when :Integer
|
185
|
+
value.to_i
|
186
|
+
when :Float
|
187
|
+
value.to_f
|
188
|
+
when :BOOLEAN
|
189
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
190
|
+
true
|
191
|
+
else
|
192
|
+
false
|
193
|
+
end
|
194
|
+
when :Object
|
195
|
+
# generic object (usually a Hash), return directly
|
196
|
+
value
|
197
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
198
|
+
inner_type = Regexp.last_match[:inner_type]
|
199
|
+
value.map { |v| _deserialize(inner_type, v) }
|
200
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
201
|
+
k_type = Regexp.last_match[:k_type]
|
202
|
+
v_type = Regexp.last_match[:v_type]
|
203
|
+
{}.tap do |hash|
|
204
|
+
value.each do |k, v|
|
205
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
else # model
|
209
|
+
temp_model = AsposeImagingCloud.const_get(type).new
|
210
|
+
temp_model.build_from_hash(value)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
# Returns the string representation of the object
|
215
|
+
# @return [String] String presentation of the object
|
216
|
+
def to_s
|
217
|
+
to_hash.to_s
|
218
|
+
end
|
219
|
+
|
220
|
+
# to_body is an alias to to_hash (backward compatibility)
|
221
|
+
# @return [Hash] Returns the object in the form of hash
|
222
|
+
def to_body
|
223
|
+
to_hash
|
224
|
+
end
|
225
|
+
|
226
|
+
# Returns the object in the form of hash
|
227
|
+
# @return [Hash] Returns the object in the form of hash
|
228
|
+
def to_hash
|
229
|
+
hash = {}
|
230
|
+
self.class.attribute_map.each_pair do |attr, param|
|
231
|
+
value = self.send(attr)
|
232
|
+
next if value.nil?
|
233
|
+
hash[param] = _to_hash(value)
|
234
|
+
end
|
235
|
+
hash
|
236
|
+
end
|
237
|
+
|
238
|
+
# Outputs non-array value in the form of hash
|
239
|
+
# For object, use to_hash. Otherwise, just return the value
|
240
|
+
# @param [Object] value Any valid value
|
241
|
+
# @return [Hash] Returns the value in the form of hash
|
242
|
+
def _to_hash(value)
|
243
|
+
if value.is_a?(Array)
|
244
|
+
value.compact.map { |v| _to_hash(v) }
|
245
|
+
elsif value.is_a?(Hash)
|
246
|
+
{}.tap do |hash|
|
247
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
248
|
+
end
|
249
|
+
elsif value.respond_to? :to_hash
|
250
|
+
value.to_hash
|
251
|
+
else
|
252
|
+
value
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
end
|
257
|
+
end
|