aspose_imaging_cloud 19.12 → 20.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -12
- data/lib/aspose-imaging-cloud.rb +75 -59
- data/lib/aspose-imaging-cloud/api/imaging_api.rb +93 -5
- data/lib/aspose-imaging-cloud/api_client.rb +2 -2
- data/lib/aspose-imaging-cloud/api_error.rb +2 -2
- data/lib/aspose-imaging-cloud/configuration.rb +1 -1
- data/lib/aspose-imaging-cloud/models/big_rectangular_filter_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/bilateral_smoothing_filter_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/bmp_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/convolution_filter_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/deconvolution_filter_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/detected_object.rb +228 -0
- data/lib/aspose-imaging-cloud/models/detected_object_list.rb +204 -0
- data/lib/aspose-imaging-cloud/models/dicom_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/disc_usage.rb +1 -1
- data/lib/aspose-imaging-cloud/models/djvu_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/dng_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/error.rb +1 -1
- data/lib/aspose-imaging-cloud/models/error_details.rb +1 -1
- data/lib/aspose-imaging-cloud/models/exif_data.rb +1 -1
- data/lib/aspose-imaging-cloud/models/file_version.rb +1 -1
- data/lib/aspose-imaging-cloud/models/file_versions.rb +1 -1
- data/lib/aspose-imaging-cloud/models/files_list.rb +1 -1
- data/lib/aspose-imaging-cloud/models/files_upload_result.rb +1 -1
- data/lib/aspose-imaging-cloud/models/filter_properties_base.rb +1 -1
- data/lib/aspose-imaging-cloud/models/gauss_wiener_filter_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/gaussian_blur_filter_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/gif_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/image_duplicates.rb +1 -1
- data/lib/aspose-imaging-cloud/models/image_duplicates_set.rb +1 -1
- data/lib/aspose-imaging-cloud/models/image_features.rb +1 -1
- data/lib/aspose-imaging-cloud/models/imaging_response.rb +1 -1
- data/lib/aspose-imaging-cloud/models/jfif_data.rb +1 -1
- data/lib/aspose-imaging-cloud/models/jpeg2000_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/jpeg_exif_data.rb +1 -1
- data/lib/aspose-imaging-cloud/models/jpeg_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/median_filter_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/motion_wiener_filter_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/object_exist.rb +1 -1
- data/lib/aspose-imaging-cloud/models/odg_metadata.rb +1 -1
- data/lib/aspose-imaging-cloud/models/odg_page.rb +1 -1
- data/lib/aspose-imaging-cloud/models/odg_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/png_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/psd_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/rectangle.rb +247 -0
- data/lib/aspose-imaging-cloud/models/requests/add_search_image_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/append_tiff_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/compare_images_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/convert_tiff_to_fax_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/copy_file_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/copy_folder_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_cropped_image_request.rb +5 -10
- data/lib/aspose-imaging-cloud/models/requests/create_deskewed_image_request.rb +92 -0
- data/lib/aspose-imaging-cloud/models/requests/create_fax_tiff_request.rb +81 -0
- data/lib/aspose-imaging-cloud/models/requests/create_folder_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_grayscaled_image_request.rb +81 -0
- data/lib/aspose-imaging-cloud/models/requests/create_image_features_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_image_frame_range_request.rb +121 -0
- data/lib/aspose-imaging-cloud/models/requests/create_image_frame_request.rb +2 -2
- data/lib/aspose-imaging-cloud/models/requests/create_image_search_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_image_tag_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_modified_bmp_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_modified_emf_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_modified_gif_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_modified_jpeg2000_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_modified_jpeg_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_modified_psd_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_modified_svg_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_modified_tiff_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_modified_web_p_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_modified_wmf_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_object_bounds_request.rb +93 -0
- data/lib/aspose-imaging-cloud/models/requests/create_resized_image_request.rb +5 -10
- data/lib/aspose-imaging-cloud/models/requests/create_rotate_flipped_image_request.rb +5 -10
- data/lib/aspose-imaging-cloud/models/requests/create_saved_image_as_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/create_updated_image_request.rb +5 -10
- data/lib/aspose-imaging-cloud/models/requests/create_visual_object_bounds_request.rb +96 -0
- data/lib/aspose-imaging-cloud/models/requests/create_web_site_image_features_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/crop_image_request.rb +5 -10
- data/lib/aspose-imaging-cloud/models/requests/delete_file_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/delete_folder_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/delete_image_features_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/delete_image_search_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/delete_search_image_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/deskew_image_request.rb +91 -0
- data/lib/aspose-imaging-cloud/models/requests/download_file_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/extract_image_features_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/extract_image_frame_properties_request.rb +2 -2
- data/lib/aspose-imaging-cloud/models/requests/extract_image_properties_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/filter_effect_image_request.rb +5 -10
- data/lib/aspose-imaging-cloud/models/requests/find_image_duplicates_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/find_images_by_tags_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/find_similar_images_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/get_disc_usage_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/get_file_versions_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/get_files_list_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/get_image_features_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/get_image_frame_properties_request.rb +2 -2
- data/lib/aspose-imaging-cloud/models/requests/get_image_frame_range_request.rb +120 -0
- data/lib/aspose-imaging-cloud/models/requests/get_image_frame_request.rb +2 -2
- data/lib/aspose-imaging-cloud/models/requests/get_image_properties_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/get_image_search_status_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/get_object_bounds_request.rb +92 -0
- data/lib/aspose-imaging-cloud/models/requests/get_search_image_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/get_visual_object_bounds_request.rb +95 -0
- data/lib/aspose-imaging-cloud/models/requests/grayscale_image_request.rb +80 -0
- data/lib/aspose-imaging-cloud/models/requests/http_request.rb +2 -1
- data/lib/aspose-imaging-cloud/models/requests/imaging_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/modify_bmp_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/modify_emf_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/modify_gif_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/modify_jpeg2000_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/modify_jpeg_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/modify_psd_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/modify_svg_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/modify_tiff_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/modify_web_p_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/modify_wmf_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/move_file_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/move_folder_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/object_bounds_request.rb +93 -0
- data/lib/aspose-imaging-cloud/models/requests/object_exists_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/resize_image_request.rb +5 -10
- data/lib/aspose-imaging-cloud/models/requests/rotate_flip_image_request.rb +5 -10
- data/lib/aspose-imaging-cloud/models/requests/save_image_as_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/storage_exists_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/update_image_features_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/update_image_request.rb +5 -10
- data/lib/aspose-imaging-cloud/models/requests/update_search_image_request.rb +1 -1
- data/lib/aspose-imaging-cloud/models/requests/upload_file_request.rb +1 -2
- data/lib/aspose-imaging-cloud/models/requests/visual_object_bounds_request.rb +94 -0
- data/lib/aspose-imaging-cloud/models/search_context_status.rb +1 -1
- data/lib/aspose-imaging-cloud/models/search_result.rb +1 -1
- data/lib/aspose-imaging-cloud/models/search_results_set.rb +1 -1
- data/lib/aspose-imaging-cloud/models/sharpen_filter_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/small_rectangular_filter_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/storage_exist.rb +1 -1
- data/lib/aspose-imaging-cloud/models/storage_file.rb +1 -1
- data/lib/aspose-imaging-cloud/models/svg_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/tiff_frame.rb +1 -1
- data/lib/aspose-imaging-cloud/models/tiff_options.rb +1 -1
- data/lib/aspose-imaging-cloud/models/tiff_properties.rb +1 -1
- data/lib/aspose-imaging-cloud/models/web_p_properties.rb +1 -1
- metadata +23 -5
@@ -1,6 +1,6 @@
|
|
1
1
|
# ----------------------------------------------------------------------------
|
2
2
|
# <copyright company="Aspose" file="api_client.rb">
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
|
4
4
|
# </copyright>
|
5
5
|
# <summary>
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
@@ -54,7 +54,7 @@ module AsposeImagingCloud
|
|
54
54
|
@config = Configuration.new(app_key, app_sid, base_url, api_version, debug)
|
55
55
|
@default_headers = {
|
56
56
|
'x-aspose-client' => 'ruby sdk',
|
57
|
-
'x-aspose-version' => '
|
57
|
+
'x-aspose-version' => '20.5'
|
58
58
|
}
|
59
59
|
end
|
60
60
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# ----------------------------------------------------------------------------
|
2
2
|
# <copyright company="Aspose" file="api_error.rb">
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
|
4
4
|
# </copyright>
|
5
5
|
# <summary>
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
@@ -39,4 +39,4 @@ module AsposeImagingCloud
|
|
39
39
|
@error = error
|
40
40
|
end
|
41
41
|
end
|
42
|
-
end
|
42
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# ----------------------------------------------------------------------------
|
2
2
|
# <copyright company="Aspose" file="configuration.rb">
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
|
4
4
|
# </copyright>
|
5
5
|
# <summary>
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# ----------------------------------------------------------------------------
|
2
2
|
# <copyright company="Aspose" file="big_rectangular_filter_properties.rb">
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
|
4
4
|
# </copyright>
|
5
5
|
# <summary>
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# ----------------------------------------------------------------------------
|
2
2
|
# <copyright company="Aspose" file="bilateral_smoothing_filter_properties.rb">
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
|
4
4
|
# </copyright>
|
5
5
|
# <summary>
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# ----------------------------------------------------------------------------
|
2
2
|
# <copyright company="Aspose" file="bmp_properties.rb">
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
|
4
4
|
# </copyright>
|
5
5
|
# <summary>
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# ----------------------------------------------------------------------------
|
2
2
|
# <copyright company="Aspose" file="convolution_filter_properties.rb">
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
|
4
4
|
# </copyright>
|
5
5
|
# <summary>
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# ----------------------------------------------------------------------------
|
2
2
|
# <copyright company="Aspose" file="deconvolution_filter_properties.rb">
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
|
4
4
|
# </copyright>
|
5
5
|
# <summary>
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
@@ -0,0 +1,228 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="detected_object.rb">
|
3
|
+
# Copyright (c) 2018-2020 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
|
+
class DetectedObject
|
31
|
+
attr_accessor :label
|
32
|
+
|
33
|
+
attr_accessor :score
|
34
|
+
|
35
|
+
attr_accessor :bounds
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
:'label' => :'Label',
|
41
|
+
:'score' => :'Score',
|
42
|
+
:'bounds' => :'Bounds'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute type mapping.
|
47
|
+
def self.swagger_types
|
48
|
+
{
|
49
|
+
:'label' => :'String',
|
50
|
+
:'score' => :'Float',
|
51
|
+
:'bounds' => :'Rectangle'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
return unless attributes.is_a?(Hash)
|
59
|
+
|
60
|
+
# convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
62
|
+
|
63
|
+
if attributes.has_key?(:'Label')
|
64
|
+
self.label = attributes[:'Label']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'Score')
|
68
|
+
self.score = attributes[:'Score']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'Bounds')
|
72
|
+
self.bounds = attributes[:'Bounds']
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
77
|
+
# @return Array for valid properties with the reasons
|
78
|
+
def list_invalid_properties
|
79
|
+
invalid_properties = Array.new
|
80
|
+
if @score.nil?
|
81
|
+
invalid_properties.push('invalid value for "score", score cannot be nil.')
|
82
|
+
end
|
83
|
+
|
84
|
+
if @bounds.nil?
|
85
|
+
invalid_properties.push('invalid value for "bounds", bounds cannot be nil.')
|
86
|
+
end
|
87
|
+
|
88
|
+
invalid_properties
|
89
|
+
end
|
90
|
+
|
91
|
+
# Check to see if the all the properties in the model are valid
|
92
|
+
# @return true if the model is valid
|
93
|
+
def valid?
|
94
|
+
return false if @score.nil?
|
95
|
+
return false if @bounds.nil?
|
96
|
+
true
|
97
|
+
end
|
98
|
+
|
99
|
+
# Checks equality by comparing each attribute.
|
100
|
+
# @param [Object] Object to be compared
|
101
|
+
def ==(o)
|
102
|
+
return true if self.equal?(o)
|
103
|
+
self.class == o.class &&
|
104
|
+
label == o.label &&
|
105
|
+
score == o.score &&
|
106
|
+
bounds == o.bounds
|
107
|
+
end
|
108
|
+
|
109
|
+
# @see the `==` method
|
110
|
+
# @param [Object] Object to be compared
|
111
|
+
def eql?(o)
|
112
|
+
self == o
|
113
|
+
end
|
114
|
+
|
115
|
+
# Calculates hash code according to all attributes.
|
116
|
+
# @return [Fixnum] Hash code
|
117
|
+
def hash
|
118
|
+
[label, score, bounds].hash
|
119
|
+
end
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
self.class.swagger_types.each_pair do |key, type|
|
127
|
+
attribute_key = self.class.attribute_map[key]
|
128
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
129
|
+
if type =~ /\AArray<(.*)>/i
|
130
|
+
# check to ensure the input is an array given that the the attribute
|
131
|
+
# is documented as an array but the input is not
|
132
|
+
if attributes[attribute_key].is_a?(Array)
|
133
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
134
|
+
end
|
135
|
+
elsif !attributes[attribute_key].nil?
|
136
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
137
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
138
|
+
end
|
139
|
+
|
140
|
+
self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserializes the data based on type
|
144
|
+
# @param string type Data type
|
145
|
+
# @param string value Value to be deserialized
|
146
|
+
# @return [Object] Deserialized data
|
147
|
+
def _deserialize(type, value)
|
148
|
+
case type.to_sym
|
149
|
+
when :DateTime
|
150
|
+
DateTime.parse(value)
|
151
|
+
when :Date
|
152
|
+
Date.parse(value)
|
153
|
+
when :String
|
154
|
+
value.to_s
|
155
|
+
when :Integer
|
156
|
+
value.to_i
|
157
|
+
when :Float
|
158
|
+
value.to_f
|
159
|
+
when :BOOLEAN
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
|
+
true
|
162
|
+
else
|
163
|
+
false
|
164
|
+
end
|
165
|
+
when :Object
|
166
|
+
# generic object (usually a Hash), return directly
|
167
|
+
value
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each do |k, v|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
else # model
|
180
|
+
temp_model = AsposeImagingCloud.const_get(type).new
|
181
|
+
temp_model.build_from_hash(value)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
# Returns the string representation of the object
|
186
|
+
# @return [String] String presentation of the object
|
187
|
+
def to_s
|
188
|
+
to_hash.to_s
|
189
|
+
end
|
190
|
+
|
191
|
+
# to_body is an alias to to_hash (backward compatibility)
|
192
|
+
# @return [Hash] Returns the object in the form of hash
|
193
|
+
def to_body
|
194
|
+
to_hash
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the object in the form of hash
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
199
|
+
def to_hash
|
200
|
+
hash = {}
|
201
|
+
self.class.attribute_map.each_pair do |attr, param|
|
202
|
+
value = self.send(attr)
|
203
|
+
next if value.nil?
|
204
|
+
hash[param] = _to_hash(value)
|
205
|
+
end
|
206
|
+
hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Outputs non-array value in the form of hash
|
210
|
+
# For object, use to_hash. Otherwise, just return the value
|
211
|
+
# @param [Object] value Any valid value
|
212
|
+
# @return [Hash] Returns the value in the form of hash
|
213
|
+
def _to_hash(value)
|
214
|
+
if value.is_a?(Array)
|
215
|
+
value.compact.map { |v| _to_hash(v) }
|
216
|
+
elsif value.is_a?(Hash)
|
217
|
+
{}.tap do |hash|
|
218
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
219
|
+
end
|
220
|
+
elsif value.respond_to? :to_hash
|
221
|
+
value.to_hash
|
222
|
+
else
|
223
|
+
value
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
end
|
228
|
+
end
|
@@ -0,0 +1,204 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="detected_object_list.rb">
|
3
|
+
# Copyright (c) 2018-2020 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
|
+
# Wrapper for detected objects array
|
31
|
+
class DetectedObjectList
|
32
|
+
# detected objects
|
33
|
+
attr_accessor :detected_objects
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'detected_objects' => :'DetectedObjects'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.swagger_types
|
44
|
+
{
|
45
|
+
:'detected_objects' => :'Array<DetectedObject>'
|
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?(:'DetectedObjects')
|
58
|
+
if (value = attributes[:'DetectedObjects']).is_a?(Array)
|
59
|
+
self.detected_objects = 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
|
+
detected_objects == o.detected_objects
|
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
|
+
[detected_objects].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
|