cloudmersive-image-recognition-api-client 1.4.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- metadata +3 -139
- data/Gemfile +0 -7
- data/README.md +0 -174
- data/Rakefile +0 -8
- data/cloudmersive-image-recognition-api-client.gemspec +0 -45
- data/docs/AgeDetectionResult.md +0 -10
- data/docs/ArtisticApi.md +0 -66
- data/docs/ColorResult.md +0 -10
- data/docs/ConvertApi.md +0 -176
- data/docs/DetectedLicensePlate.md +0 -14
- data/docs/DetectedObject.md +0 -13
- data/docs/DominantColorResult.md +0 -9
- data/docs/DrawPolygonInstance.md +0 -11
- data/docs/DrawPolygonRequest.md +0 -10
- data/docs/DrawRectangleInstance.md +0 -14
- data/docs/DrawRectangleRequest.md +0 -10
- data/docs/DrawTextInstance.md +0 -15
- data/docs/DrawTextRequest.md +0 -10
- data/docs/EditApi.md +0 -539
- data/docs/Face.md +0 -11
- data/docs/FaceApi.md +0 -396
- data/docs/FaceCompareResponse.md +0 -11
- data/docs/FaceLocateResponse.md +0 -11
- data/docs/FaceLocateWithLandmarksResponse.md +0 -11
- data/docs/FaceMatch.md +0 -13
- data/docs/FacePoint.md +0 -9
- data/docs/FaceWithLandmarks.md +0 -20
- data/docs/FilterApi.md +0 -478
- data/docs/FindSymbolResult.md +0 -13
- data/docs/FineTextDetectionResult.md +0 -10
- data/docs/FineTextItem.md +0 -18
- data/docs/GenderDetectionResult.md +0 -10
- data/docs/ImageDescriptionResponse.md +0 -11
- data/docs/InfoApi.md +0 -63
- data/docs/NsfwApi.md +0 -63
- data/docs/NsfwResult.md +0 -10
- data/docs/ObjectDetectionResult.md +0 -10
- data/docs/PersonWithAge.md +0 -11
- data/docs/PersonWithGender.md +0 -10
- data/docs/PolygonPoint.md +0 -9
- data/docs/RecognitionOutcome.md +0 -9
- data/docs/RecognizeApi.md +0 -455
- data/docs/ResizeApi.md +0 -130
- data/docs/TextDetectionResult.md +0 -10
- data/docs/TextItem.md +0 -11
- data/docs/VehicleLicensePlateDetectionResult.md +0 -10
- data/git_push.sh +0 -55
- data/lib/cloudmersive-image-recognition-api-client.rb +0 -80
- data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +0 -85
- data/lib/cloudmersive-image-recognition-api-client/api/convert_api.rb +0 -197
- data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +0 -597
- data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +0 -422
- data/lib/cloudmersive-image-recognition-api-client/api/filter_api.rb +0 -533
- data/lib/cloudmersive-image-recognition-api-client/api/info_api.rb +0 -79
- data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +0 -79
- data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +0 -481
- data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +0 -159
- data/lib/cloudmersive-image-recognition-api-client/api_client.rb +0 -389
- data/lib/cloudmersive-image-recognition-api-client/api_error.rb +0 -38
- data/lib/cloudmersive-image-recognition-api-client/configuration.rb +0 -209
- data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/models/color_result.rb +0 -209
- data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +0 -249
- data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +0 -239
- data/lib/cloudmersive-image-recognition-api-client/models/dominant_color_result.rb +0 -201
- data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_instance.rb +0 -221
- data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_request.rb +0 -227
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +0 -249
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +0 -227
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +0 -259
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +0 -227
- data/lib/cloudmersive-image-recognition-api-client/models/face.rb +0 -219
- data/lib/cloudmersive-image-recognition-api-client/models/face_compare_response.rb +0 -221
- data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +0 -220
- data/lib/cloudmersive-image-recognition-api-client/models/face_locate_with_landmarks_response.rb +0 -221
- data/lib/cloudmersive-image-recognition-api-client/models/face_match.rb +0 -239
- data/lib/cloudmersive-image-recognition-api-client/models/face_point.rb +0 -199
- data/lib/cloudmersive-image-recognition-api-client/models/face_with_landmarks.rb +0 -327
- data/lib/cloudmersive-image-recognition-api-client/models/find_symbol_result.rb +0 -239
- data/lib/cloudmersive-image-recognition-api-client/models/fine_text_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/models/fine_text_item.rb +0 -289
- data/lib/cloudmersive-image-recognition-api-client/models/gender_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +0 -219
- data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +0 -209
- data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +0 -218
- data/lib/cloudmersive-image-recognition-api-client/models/person_with_gender.rb +0 -209
- data/lib/cloudmersive-image-recognition-api-client/models/polygon_point.rb +0 -199
- data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +0 -199
- data/lib/cloudmersive-image-recognition-api-client/models/text_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/models/text_item.rb +0 -219
- data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/version.rb +0 -15
- data/spec/api/artistic_api_spec.rb +0 -48
- data/spec/api/convert_api_spec.rb +0 -72
- data/spec/api/edit_api_spec.rb +0 -155
- data/spec/api/face_api_spec.rb +0 -120
- data/spec/api/filter_api_spec.rb +0 -141
- data/spec/api/info_api_spec.rb +0 -47
- data/spec/api/nsfw_api_spec.rb +0 -47
- data/spec/api/recognize_api_spec.rb +0 -133
- data/spec/api/resize_api_spec.rb +0 -63
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/age_detection_result_spec.rb +0 -54
- data/spec/models/color_result_spec.rb +0 -54
- data/spec/models/detected_license_plate_spec.rb +0 -78
- data/spec/models/detected_object_spec.rb +0 -72
- data/spec/models/dominant_color_result_spec.rb +0 -48
- data/spec/models/draw_polygon_instance_spec.rb +0 -60
- data/spec/models/draw_polygon_request_spec.rb +0 -54
- data/spec/models/draw_rectangle_instance_spec.rb +0 -78
- data/spec/models/draw_rectangle_request_spec.rb +0 -54
- data/spec/models/draw_text_instance_spec.rb +0 -84
- data/spec/models/draw_text_request_spec.rb +0 -54
- data/spec/models/face_compare_response_spec.rb +0 -60
- data/spec/models/face_locate_response_spec.rb +0 -60
- data/spec/models/face_locate_with_landmarks_response_spec.rb +0 -60
- data/spec/models/face_match_spec.rb +0 -72
- data/spec/models/face_point_spec.rb +0 -48
- data/spec/models/face_spec.rb +0 -60
- data/spec/models/face_with_landmarks_spec.rb +0 -114
- data/spec/models/find_symbol_result_spec.rb +0 -72
- data/spec/models/fine_text_detection_result_spec.rb +0 -54
- data/spec/models/fine_text_item_spec.rb +0 -102
- data/spec/models/gender_detection_result_spec.rb +0 -54
- data/spec/models/image_description_response_spec.rb +0 -60
- data/spec/models/nsfw_result_spec.rb +0 -54
- data/spec/models/object_detection_result_spec.rb +0 -54
- data/spec/models/person_with_age_spec.rb +0 -60
- data/spec/models/person_with_gender_spec.rb +0 -54
- data/spec/models/polygon_point_spec.rb +0 -48
- data/spec/models/recognition_outcome_spec.rb +0 -48
- data/spec/models/text_detection_result_spec.rb +0 -54
- data/spec/models/text_item_spec.rb +0 -60
- data/spec/models/vehicle_license_plate_detection_result_spec.rb +0 -54
- data/spec/spec_helper.rb +0 -111
@@ -1,199 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#imageapi
|
3
|
-
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
5
|
-
|
6
|
-
OpenAPI spec version: v1
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module CloudmersiveImageRecognitionApiClient
|
16
|
-
# Point location within a face
|
17
|
-
class FacePoint
|
18
|
-
# X location, where 0 is the left-most pixel
|
19
|
-
attr_accessor :x
|
20
|
-
|
21
|
-
# Y location, where 0 is the top-most pixel
|
22
|
-
attr_accessor :y
|
23
|
-
|
24
|
-
|
25
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
-
def self.attribute_map
|
27
|
-
{
|
28
|
-
:'x' => :'X',
|
29
|
-
:'y' => :'Y'
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
# Attribute type mapping.
|
34
|
-
def self.swagger_types
|
35
|
-
{
|
36
|
-
:'x' => :'Integer',
|
37
|
-
:'y' => :'Integer'
|
38
|
-
}
|
39
|
-
end
|
40
|
-
|
41
|
-
# Initializes the object
|
42
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
-
def initialize(attributes = {})
|
44
|
-
return unless attributes.is_a?(Hash)
|
45
|
-
|
46
|
-
# convert string to symbol for hash key
|
47
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
48
|
-
|
49
|
-
if attributes.has_key?(:'X')
|
50
|
-
self.x = attributes[:'X']
|
51
|
-
end
|
52
|
-
|
53
|
-
if attributes.has_key?(:'Y')
|
54
|
-
self.y = attributes[:'Y']
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
58
|
-
|
59
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
60
|
-
# @return Array for valid properties with the reasons
|
61
|
-
def list_invalid_properties
|
62
|
-
invalid_properties = Array.new
|
63
|
-
return invalid_properties
|
64
|
-
end
|
65
|
-
|
66
|
-
# Check to see if the all the properties in the model are valid
|
67
|
-
# @return true if the model is valid
|
68
|
-
def valid?
|
69
|
-
return true
|
70
|
-
end
|
71
|
-
|
72
|
-
# Checks equality by comparing each attribute.
|
73
|
-
# @param [Object] Object to be compared
|
74
|
-
def ==(o)
|
75
|
-
return true if self.equal?(o)
|
76
|
-
self.class == o.class &&
|
77
|
-
x == o.x &&
|
78
|
-
y == o.y
|
79
|
-
end
|
80
|
-
|
81
|
-
# @see the `==` method
|
82
|
-
# @param [Object] Object to be compared
|
83
|
-
def eql?(o)
|
84
|
-
self == o
|
85
|
-
end
|
86
|
-
|
87
|
-
# Calculates hash code according to all attributes.
|
88
|
-
# @return [Fixnum] Hash code
|
89
|
-
def hash
|
90
|
-
[x, y].hash
|
91
|
-
end
|
92
|
-
|
93
|
-
# Builds the object from hash
|
94
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
-
# @return [Object] Returns the model itself
|
96
|
-
def build_from_hash(attributes)
|
97
|
-
return nil unless attributes.is_a?(Hash)
|
98
|
-
self.class.swagger_types.each_pair do |key, type|
|
99
|
-
if type =~ /\AArray<(.*)>/i
|
100
|
-
# check to ensure the input is an array given that the the attribute
|
101
|
-
# is documented as an array but the input is not
|
102
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
103
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
104
|
-
end
|
105
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
106
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
107
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
108
|
-
end
|
109
|
-
|
110
|
-
self
|
111
|
-
end
|
112
|
-
|
113
|
-
# Deserializes the data based on type
|
114
|
-
# @param string type Data type
|
115
|
-
# @param string value Value to be deserialized
|
116
|
-
# @return [Object] Deserialized data
|
117
|
-
def _deserialize(type, value)
|
118
|
-
case type.to_sym
|
119
|
-
when :DateTime
|
120
|
-
DateTime.parse(value)
|
121
|
-
when :Date
|
122
|
-
Date.parse(value)
|
123
|
-
when :String
|
124
|
-
value.to_s
|
125
|
-
when :Integer
|
126
|
-
value.to_i
|
127
|
-
when :Float
|
128
|
-
value.to_f
|
129
|
-
when :BOOLEAN
|
130
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
131
|
-
true
|
132
|
-
else
|
133
|
-
false
|
134
|
-
end
|
135
|
-
when :Object
|
136
|
-
# generic object (usually a Hash), return directly
|
137
|
-
value
|
138
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
139
|
-
inner_type = Regexp.last_match[:inner_type]
|
140
|
-
value.map { |v| _deserialize(inner_type, v) }
|
141
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
142
|
-
k_type = Regexp.last_match[:k_type]
|
143
|
-
v_type = Regexp.last_match[:v_type]
|
144
|
-
{}.tap do |hash|
|
145
|
-
value.each do |k, v|
|
146
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
147
|
-
end
|
148
|
-
end
|
149
|
-
else # model
|
150
|
-
temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
|
151
|
-
temp_model.build_from_hash(value)
|
152
|
-
end
|
153
|
-
end
|
154
|
-
|
155
|
-
# Returns the string representation of the object
|
156
|
-
# @return [String] String presentation of the object
|
157
|
-
def to_s
|
158
|
-
to_hash.to_s
|
159
|
-
end
|
160
|
-
|
161
|
-
# to_body is an alias to to_hash (backward compatibility)
|
162
|
-
# @return [Hash] Returns the object in the form of hash
|
163
|
-
def to_body
|
164
|
-
to_hash
|
165
|
-
end
|
166
|
-
|
167
|
-
# Returns the object in the form of hash
|
168
|
-
# @return [Hash] Returns the object in the form of hash
|
169
|
-
def to_hash
|
170
|
-
hash = {}
|
171
|
-
self.class.attribute_map.each_pair do |attr, param|
|
172
|
-
value = self.send(attr)
|
173
|
-
next if value.nil?
|
174
|
-
hash[param] = _to_hash(value)
|
175
|
-
end
|
176
|
-
hash
|
177
|
-
end
|
178
|
-
|
179
|
-
# Outputs non-array value in the form of hash
|
180
|
-
# For object, use to_hash. Otherwise, just return the value
|
181
|
-
# @param [Object] value Any valid value
|
182
|
-
# @return [Hash] Returns the value in the form of hash
|
183
|
-
def _to_hash(value)
|
184
|
-
if value.is_a?(Array)
|
185
|
-
value.compact.map{ |v| _to_hash(v) }
|
186
|
-
elsif value.is_a?(Hash)
|
187
|
-
{}.tap do |hash|
|
188
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
189
|
-
end
|
190
|
-
elsif value.respond_to? :to_hash
|
191
|
-
value.to_hash
|
192
|
-
else
|
193
|
-
value
|
194
|
-
end
|
195
|
-
end
|
196
|
-
|
197
|
-
end
|
198
|
-
|
199
|
-
end
|
@@ -1,327 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#imageapi
|
3
|
-
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
5
|
-
|
6
|
-
OpenAPI spec version: v1
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module CloudmersiveImageRecognitionApiClient
|
16
|
-
# Location of one face in an image
|
17
|
-
class FaceWithLandmarks
|
18
|
-
# X coordinate of the left side of the face
|
19
|
-
attr_accessor :left_x
|
20
|
-
|
21
|
-
# Y coordinate of the top side of the face
|
22
|
-
attr_accessor :top_y
|
23
|
-
|
24
|
-
# X coordinate of the right side of the face
|
25
|
-
attr_accessor :right_x
|
26
|
-
|
27
|
-
# Y coordinate of the bottom side of the face
|
28
|
-
attr_accessor :bottom_y
|
29
|
-
|
30
|
-
# Point locations of the left eyebrow (the eyebrow cloesest to the left side of the picture)
|
31
|
-
attr_accessor :left_eyebrow
|
32
|
-
|
33
|
-
# Point locations of the right eyebrow (the eyebrow cloesest to the right side of the picture)
|
34
|
-
attr_accessor :right_eyebrow
|
35
|
-
|
36
|
-
# Point locations of the left eye (the eye closest to the left side of the picture)
|
37
|
-
attr_accessor :left_eye
|
38
|
-
|
39
|
-
# Point locations of the right eye (the eye closest to the right side of the picture)
|
40
|
-
attr_accessor :right_eye
|
41
|
-
|
42
|
-
# Point locations of the bottom and sides of the face (cheeks and chin)
|
43
|
-
attr_accessor :bottom_and_sides_of_face
|
44
|
-
|
45
|
-
# Point locations of the nose bridge (the vertical portion of the nose)
|
46
|
-
attr_accessor :nose_bridge
|
47
|
-
|
48
|
-
# Point locations of the bottom (nostrils) of the nose
|
49
|
-
attr_accessor :nose_bottom
|
50
|
-
|
51
|
-
# Point locations of the inner outline of the lips
|
52
|
-
attr_accessor :lips_inner_outline
|
53
|
-
|
54
|
-
# Point locations of the outer outline of the lips
|
55
|
-
attr_accessor :lips_outer_outline
|
56
|
-
|
57
|
-
|
58
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
59
|
-
def self.attribute_map
|
60
|
-
{
|
61
|
-
:'left_x' => :'LeftX',
|
62
|
-
:'top_y' => :'TopY',
|
63
|
-
:'right_x' => :'RightX',
|
64
|
-
:'bottom_y' => :'BottomY',
|
65
|
-
:'left_eyebrow' => :'LeftEyebrow',
|
66
|
-
:'right_eyebrow' => :'RightEyebrow',
|
67
|
-
:'left_eye' => :'LeftEye',
|
68
|
-
:'right_eye' => :'RightEye',
|
69
|
-
:'bottom_and_sides_of_face' => :'BottomAndSidesOfFace',
|
70
|
-
:'nose_bridge' => :'NoseBridge',
|
71
|
-
:'nose_bottom' => :'NoseBottom',
|
72
|
-
:'lips_inner_outline' => :'LipsInnerOutline',
|
73
|
-
:'lips_outer_outline' => :'LipsOuterOutline'
|
74
|
-
}
|
75
|
-
end
|
76
|
-
|
77
|
-
# Attribute type mapping.
|
78
|
-
def self.swagger_types
|
79
|
-
{
|
80
|
-
:'left_x' => :'Integer',
|
81
|
-
:'top_y' => :'Integer',
|
82
|
-
:'right_x' => :'Integer',
|
83
|
-
:'bottom_y' => :'Integer',
|
84
|
-
:'left_eyebrow' => :'Array<FacePoint>',
|
85
|
-
:'right_eyebrow' => :'Array<FacePoint>',
|
86
|
-
:'left_eye' => :'Array<FacePoint>',
|
87
|
-
:'right_eye' => :'Array<FacePoint>',
|
88
|
-
:'bottom_and_sides_of_face' => :'Array<FacePoint>',
|
89
|
-
:'nose_bridge' => :'Array<FacePoint>',
|
90
|
-
:'nose_bottom' => :'Array<FacePoint>',
|
91
|
-
:'lips_inner_outline' => :'Array<FacePoint>',
|
92
|
-
:'lips_outer_outline' => :'Array<FacePoint>'
|
93
|
-
}
|
94
|
-
end
|
95
|
-
|
96
|
-
# Initializes the object
|
97
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
98
|
-
def initialize(attributes = {})
|
99
|
-
return unless attributes.is_a?(Hash)
|
100
|
-
|
101
|
-
# convert string to symbol for hash key
|
102
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
103
|
-
|
104
|
-
if attributes.has_key?(:'LeftX')
|
105
|
-
self.left_x = attributes[:'LeftX']
|
106
|
-
end
|
107
|
-
|
108
|
-
if attributes.has_key?(:'TopY')
|
109
|
-
self.top_y = attributes[:'TopY']
|
110
|
-
end
|
111
|
-
|
112
|
-
if attributes.has_key?(:'RightX')
|
113
|
-
self.right_x = attributes[:'RightX']
|
114
|
-
end
|
115
|
-
|
116
|
-
if attributes.has_key?(:'BottomY')
|
117
|
-
self.bottom_y = attributes[:'BottomY']
|
118
|
-
end
|
119
|
-
|
120
|
-
if attributes.has_key?(:'LeftEyebrow')
|
121
|
-
if (value = attributes[:'LeftEyebrow']).is_a?(Array)
|
122
|
-
self.left_eyebrow = value
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
if attributes.has_key?(:'RightEyebrow')
|
127
|
-
if (value = attributes[:'RightEyebrow']).is_a?(Array)
|
128
|
-
self.right_eyebrow = value
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
if attributes.has_key?(:'LeftEye')
|
133
|
-
if (value = attributes[:'LeftEye']).is_a?(Array)
|
134
|
-
self.left_eye = value
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
if attributes.has_key?(:'RightEye')
|
139
|
-
if (value = attributes[:'RightEye']).is_a?(Array)
|
140
|
-
self.right_eye = value
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
if attributes.has_key?(:'BottomAndSidesOfFace')
|
145
|
-
if (value = attributes[:'BottomAndSidesOfFace']).is_a?(Array)
|
146
|
-
self.bottom_and_sides_of_face = value
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
if attributes.has_key?(:'NoseBridge')
|
151
|
-
if (value = attributes[:'NoseBridge']).is_a?(Array)
|
152
|
-
self.nose_bridge = value
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
if attributes.has_key?(:'NoseBottom')
|
157
|
-
if (value = attributes[:'NoseBottom']).is_a?(Array)
|
158
|
-
self.nose_bottom = value
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
|
-
if attributes.has_key?(:'LipsInnerOutline')
|
163
|
-
if (value = attributes[:'LipsInnerOutline']).is_a?(Array)
|
164
|
-
self.lips_inner_outline = value
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
|
-
if attributes.has_key?(:'LipsOuterOutline')
|
169
|
-
if (value = attributes[:'LipsOuterOutline']).is_a?(Array)
|
170
|
-
self.lips_outer_outline = value
|
171
|
-
end
|
172
|
-
end
|
173
|
-
|
174
|
-
end
|
175
|
-
|
176
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
177
|
-
# @return Array for valid properties with the reasons
|
178
|
-
def list_invalid_properties
|
179
|
-
invalid_properties = Array.new
|
180
|
-
return invalid_properties
|
181
|
-
end
|
182
|
-
|
183
|
-
# Check to see if the all the properties in the model are valid
|
184
|
-
# @return true if the model is valid
|
185
|
-
def valid?
|
186
|
-
return true
|
187
|
-
end
|
188
|
-
|
189
|
-
# Checks equality by comparing each attribute.
|
190
|
-
# @param [Object] Object to be compared
|
191
|
-
def ==(o)
|
192
|
-
return true if self.equal?(o)
|
193
|
-
self.class == o.class &&
|
194
|
-
left_x == o.left_x &&
|
195
|
-
top_y == o.top_y &&
|
196
|
-
right_x == o.right_x &&
|
197
|
-
bottom_y == o.bottom_y &&
|
198
|
-
left_eyebrow == o.left_eyebrow &&
|
199
|
-
right_eyebrow == o.right_eyebrow &&
|
200
|
-
left_eye == o.left_eye &&
|
201
|
-
right_eye == o.right_eye &&
|
202
|
-
bottom_and_sides_of_face == o.bottom_and_sides_of_face &&
|
203
|
-
nose_bridge == o.nose_bridge &&
|
204
|
-
nose_bottom == o.nose_bottom &&
|
205
|
-
lips_inner_outline == o.lips_inner_outline &&
|
206
|
-
lips_outer_outline == o.lips_outer_outline
|
207
|
-
end
|
208
|
-
|
209
|
-
# @see the `==` method
|
210
|
-
# @param [Object] Object to be compared
|
211
|
-
def eql?(o)
|
212
|
-
self == o
|
213
|
-
end
|
214
|
-
|
215
|
-
# Calculates hash code according to all attributes.
|
216
|
-
# @return [Fixnum] Hash code
|
217
|
-
def hash
|
218
|
-
[left_x, top_y, right_x, bottom_y, left_eyebrow, right_eyebrow, left_eye, right_eye, bottom_and_sides_of_face, nose_bridge, nose_bottom, lips_inner_outline, lips_outer_outline].hash
|
219
|
-
end
|
220
|
-
|
221
|
-
# Builds the object from hash
|
222
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
223
|
-
# @return [Object] Returns the model itself
|
224
|
-
def build_from_hash(attributes)
|
225
|
-
return nil unless attributes.is_a?(Hash)
|
226
|
-
self.class.swagger_types.each_pair do |key, type|
|
227
|
-
if type =~ /\AArray<(.*)>/i
|
228
|
-
# check to ensure the input is an array given that the the attribute
|
229
|
-
# is documented as an array but the input is not
|
230
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
231
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
232
|
-
end
|
233
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
234
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
235
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
236
|
-
end
|
237
|
-
|
238
|
-
self
|
239
|
-
end
|
240
|
-
|
241
|
-
# Deserializes the data based on type
|
242
|
-
# @param string type Data type
|
243
|
-
# @param string value Value to be deserialized
|
244
|
-
# @return [Object] Deserialized data
|
245
|
-
def _deserialize(type, value)
|
246
|
-
case type.to_sym
|
247
|
-
when :DateTime
|
248
|
-
DateTime.parse(value)
|
249
|
-
when :Date
|
250
|
-
Date.parse(value)
|
251
|
-
when :String
|
252
|
-
value.to_s
|
253
|
-
when :Integer
|
254
|
-
value.to_i
|
255
|
-
when :Float
|
256
|
-
value.to_f
|
257
|
-
when :BOOLEAN
|
258
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
259
|
-
true
|
260
|
-
else
|
261
|
-
false
|
262
|
-
end
|
263
|
-
when :Object
|
264
|
-
# generic object (usually a Hash), return directly
|
265
|
-
value
|
266
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
267
|
-
inner_type = Regexp.last_match[:inner_type]
|
268
|
-
value.map { |v| _deserialize(inner_type, v) }
|
269
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
270
|
-
k_type = Regexp.last_match[:k_type]
|
271
|
-
v_type = Regexp.last_match[:v_type]
|
272
|
-
{}.tap do |hash|
|
273
|
-
value.each do |k, v|
|
274
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
275
|
-
end
|
276
|
-
end
|
277
|
-
else # model
|
278
|
-
temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
|
279
|
-
temp_model.build_from_hash(value)
|
280
|
-
end
|
281
|
-
end
|
282
|
-
|
283
|
-
# Returns the string representation of the object
|
284
|
-
# @return [String] String presentation of the object
|
285
|
-
def to_s
|
286
|
-
to_hash.to_s
|
287
|
-
end
|
288
|
-
|
289
|
-
# to_body is an alias to to_hash (backward compatibility)
|
290
|
-
# @return [Hash] Returns the object in the form of hash
|
291
|
-
def to_body
|
292
|
-
to_hash
|
293
|
-
end
|
294
|
-
|
295
|
-
# Returns the object in the form of hash
|
296
|
-
# @return [Hash] Returns the object in the form of hash
|
297
|
-
def to_hash
|
298
|
-
hash = {}
|
299
|
-
self.class.attribute_map.each_pair do |attr, param|
|
300
|
-
value = self.send(attr)
|
301
|
-
next if value.nil?
|
302
|
-
hash[param] = _to_hash(value)
|
303
|
-
end
|
304
|
-
hash
|
305
|
-
end
|
306
|
-
|
307
|
-
# Outputs non-array value in the form of hash
|
308
|
-
# For object, use to_hash. Otherwise, just return the value
|
309
|
-
# @param [Object] value Any valid value
|
310
|
-
# @return [Hash] Returns the value in the form of hash
|
311
|
-
def _to_hash(value)
|
312
|
-
if value.is_a?(Array)
|
313
|
-
value.compact.map{ |v| _to_hash(v) }
|
314
|
-
elsif value.is_a?(Hash)
|
315
|
-
{}.tap do |hash|
|
316
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
317
|
-
end
|
318
|
-
elsif value.respond_to? :to_hash
|
319
|
-
value.to_hash
|
320
|
-
else
|
321
|
-
value
|
322
|
-
end
|
323
|
-
end
|
324
|
-
|
325
|
-
end
|
326
|
-
|
327
|
-
end
|