cloudmersive-image-recognition-api-client 1.3.7 → 1.4.0

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.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -5
  3. data/cloudmersive-image-recognition-api-client.gemspec +1 -1
  4. data/docs/ColorResult.md +10 -0
  5. data/docs/DetectedLicensePlate.md +4 -4
  6. data/docs/DominantColorResult.md +9 -0
  7. data/docs/EditApi.md +134 -0
  8. data/docs/FaceApi.md +55 -0
  9. data/docs/FaceCompareResponse.md +1 -1
  10. data/docs/FaceLocateWithLandmarksResponse.md +1 -1
  11. data/docs/FaceWithLandmarks.md +9 -9
  12. data/docs/FilterApi.md +475 -0
  13. data/docs/FindSymbolResult.md +12 -0
  14. data/docs/GenderDetectionResult.md +10 -0
  15. data/docs/InfoApi.md +63 -0
  16. data/docs/PersonWithAge.md +1 -0
  17. data/docs/PersonWithGender.md +10 -0
  18. data/docs/RecognizeApi.md +68 -4
  19. data/docs/ResizeApi.md +64 -3
  20. data/lib/cloudmersive-image-recognition-api-client.rb +8 -1
  21. data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +1 -1
  22. data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +161 -1
  23. data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +57 -1
  24. data/lib/cloudmersive-image-recognition-api-client/api/filter_api.rb +524 -0
  25. data/lib/cloudmersive-image-recognition-api-client/api/info_api.rb +79 -0
  26. data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +1 -1
  27. data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +76 -4
  28. data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +71 -3
  29. data/lib/cloudmersive-image-recognition-api-client/api_client.rb +1 -1
  30. data/lib/cloudmersive-image-recognition-api-client/api_error.rb +1 -1
  31. data/lib/cloudmersive-image-recognition-api-client/configuration.rb +1 -1
  32. data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +1 -1
  33. data/lib/cloudmersive-image-recognition-api-client/models/color_result.rb +209 -0
  34. data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +26 -22
  35. data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +1 -1
  36. data/lib/cloudmersive-image-recognition-api-client/models/dominant_color_result.rb +201 -0
  37. data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_instance.rb +1 -1
  38. data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_request.rb +1 -1
  39. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +1 -1
  40. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +1 -1
  41. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +1 -1
  42. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +1 -1
  43. data/lib/cloudmersive-image-recognition-api-client/models/face.rb +1 -1
  44. data/lib/cloudmersive-image-recognition-api-client/models/face_compare_response.rb +15 -14
  45. data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +1 -1
  46. data/lib/cloudmersive-image-recognition-api-client/models/face_locate_with_landmarks_response.rb +15 -14
  47. data/lib/cloudmersive-image-recognition-api-client/models/face_match.rb +1 -1
  48. data/lib/cloudmersive-image-recognition-api-client/models/face_point.rb +1 -1
  49. data/lib/cloudmersive-image-recognition-api-client/models/face_with_landmarks.rb +54 -45
  50. data/lib/cloudmersive-image-recognition-api-client/models/find_symbol_result.rb +229 -0
  51. data/lib/cloudmersive-image-recognition-api-client/models/fine_text_detection_result.rb +1 -1
  52. data/lib/cloudmersive-image-recognition-api-client/models/fine_text_item.rb +1 -1
  53. data/lib/cloudmersive-image-recognition-api-client/models/gender_detection_result.rb +211 -0
  54. data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +1 -1
  55. data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +1 -1
  56. data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +1 -1
  57. data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +14 -5
  58. data/lib/cloudmersive-image-recognition-api-client/models/person_with_gender.rb +209 -0
  59. data/lib/cloudmersive-image-recognition-api-client/models/polygon_point.rb +1 -1
  60. data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +1 -1
  61. data/lib/cloudmersive-image-recognition-api-client/models/text_detection_result.rb +1 -1
  62. data/lib/cloudmersive-image-recognition-api-client/models/text_item.rb +1 -1
  63. data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +1 -1
  64. data/lib/cloudmersive-image-recognition-api-client/version.rb +2 -2
  65. data/spec/api/artistic_api_spec.rb +1 -1
  66. data/spec/api/edit_api_spec.rb +33 -1
  67. data/spec/api/face_api_spec.rb +13 -1
  68. data/spec/api/filter_api_spec.rb +140 -0
  69. data/spec/api/info_api_spec.rb +47 -0
  70. data/spec/api/nsfw_api_spec.rb +1 -1
  71. data/spec/api/recognize_api_spec.rb +15 -1
  72. data/spec/api/resize_api_spec.rb +16 -2
  73. data/spec/api_client_spec.rb +1 -1
  74. data/spec/configuration_spec.rb +1 -1
  75. data/spec/models/age_detection_result_spec.rb +1 -1
  76. data/spec/models/color_result_spec.rb +54 -0
  77. data/spec/models/detected_license_plate_spec.rb +7 -7
  78. data/spec/models/detected_object_spec.rb +1 -1
  79. data/spec/models/dominant_color_result_spec.rb +48 -0
  80. data/spec/models/draw_polygon_instance_spec.rb +1 -1
  81. data/spec/models/draw_polygon_request_spec.rb +1 -1
  82. data/spec/models/draw_rectangle_instance_spec.rb +1 -1
  83. data/spec/models/draw_rectangle_request_spec.rb +1 -1
  84. data/spec/models/draw_text_instance_spec.rb +1 -1
  85. data/spec/models/draw_text_request_spec.rb +1 -1
  86. data/spec/models/face_compare_response_spec.rb +5 -5
  87. data/spec/models/face_locate_response_spec.rb +1 -1
  88. data/spec/models/face_locate_with_landmarks_response_spec.rb +5 -5
  89. data/spec/models/face_match_spec.rb +1 -1
  90. data/spec/models/face_point_spec.rb +1 -1
  91. data/spec/models/face_spec.rb +1 -1
  92. data/spec/models/face_with_landmarks_spec.rb +14 -14
  93. data/spec/models/find_symbol_result_spec.rb +66 -0
  94. data/spec/models/fine_text_detection_result_spec.rb +1 -1
  95. data/spec/models/fine_text_item_spec.rb +1 -1
  96. data/spec/models/gender_detection_result_spec.rb +54 -0
  97. data/spec/models/image_description_response_spec.rb +1 -1
  98. data/spec/models/nsfw_result_spec.rb +1 -1
  99. data/spec/models/object_detection_result_spec.rb +1 -1
  100. data/spec/models/person_with_age_spec.rb +7 -1
  101. data/spec/models/person_with_gender_spec.rb +54 -0
  102. data/spec/models/polygon_point_spec.rb +1 -1
  103. data/spec/models/recognition_outcome_spec.rb +1 -1
  104. data/spec/models/text_detection_result_spec.rb +1 -1
  105. data/spec/models/text_item_spec.rb +1 -1
  106. data/spec/models/vehicle_license_plate_detection_result_spec.rb +1 -1
  107. data/spec/spec_helper.rb +1 -1
  108. metadata +36 -16
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: unset
9
+ Swagger Codegen version: 2.3.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: unset
9
+ Swagger Codegen version: 2.3.1
10
10
 
11
11
  =end
12
12
 
@@ -15,8 +15,6 @@ require 'date'
15
15
  module CloudmersiveImageRecognitionApiClient
16
16
  # Results of locating faces in an image
17
17
  class FaceLocateWithLandmarksResponse
18
- attr_accessor :error_details
19
-
20
18
  # True if the operation was successful, false otherwise
21
19
  attr_accessor :successful
22
20
 
@@ -26,24 +24,27 @@ module CloudmersiveImageRecognitionApiClient
26
24
  # Number of faces found in the image
27
25
  attr_accessor :face_count
28
26
 
27
+ # Details of any errors that occurred
28
+ attr_accessor :error_details
29
+
29
30
 
30
31
  # Attribute mapping from ruby-style variable name to JSON key.
31
32
  def self.attribute_map
32
33
  {
33
- :'error_details' => :'ErrorDetails',
34
34
  :'successful' => :'Successful',
35
35
  :'faces' => :'Faces',
36
- :'face_count' => :'FaceCount'
36
+ :'face_count' => :'FaceCount',
37
+ :'error_details' => :'ErrorDetails'
37
38
  }
38
39
  end
39
40
 
40
41
  # Attribute type mapping.
41
42
  def self.swagger_types
42
43
  {
43
- :'error_details' => :'String',
44
44
  :'successful' => :'BOOLEAN',
45
45
  :'faces' => :'Array<FaceWithLandmarks>',
46
- :'face_count' => :'Integer'
46
+ :'face_count' => :'Integer',
47
+ :'error_details' => :'String'
47
48
  }
48
49
  end
49
50
 
@@ -55,10 +56,6 @@ module CloudmersiveImageRecognitionApiClient
55
56
  # convert string to symbol for hash key
56
57
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
57
58
 
58
- if attributes.has_key?(:'ErrorDetails')
59
- self.error_details = attributes[:'ErrorDetails']
60
- end
61
-
62
59
  if attributes.has_key?(:'Successful')
63
60
  self.successful = attributes[:'Successful']
64
61
  end
@@ -73,6 +70,10 @@ module CloudmersiveImageRecognitionApiClient
73
70
  self.face_count = attributes[:'FaceCount']
74
71
  end
75
72
 
73
+ if attributes.has_key?(:'ErrorDetails')
74
+ self.error_details = attributes[:'ErrorDetails']
75
+ end
76
+
76
77
  end
77
78
 
78
79
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -93,10 +94,10 @@ module CloudmersiveImageRecognitionApiClient
93
94
  def ==(o)
94
95
  return true if self.equal?(o)
95
96
  self.class == o.class &&
96
- error_details == o.error_details &&
97
97
  successful == o.successful &&
98
98
  faces == o.faces &&
99
- face_count == o.face_count
99
+ face_count == o.face_count &&
100
+ error_details == o.error_details
100
101
  end
101
102
 
102
103
  # @see the `==` method
@@ -108,7 +109,7 @@ module CloudmersiveImageRecognitionApiClient
108
109
  # Calculates hash code according to all attributes.
109
110
  # @return [Fixnum] Hash code
110
111
  def hash
111
- [error_details, successful, faces, face_count].hash
112
+ [successful, faces, face_count, error_details].hash
112
113
  end
113
114
 
114
115
  # Builds the object from hash
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: unset
9
+ Swagger Codegen version: 2.3.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: unset
9
+ Swagger Codegen version: 2.3.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: unset
9
+ Swagger Codegen version: 2.3.1
10
10
 
11
11
  =end
12
12
 
@@ -15,40 +15,53 @@ require 'date'
15
15
  module CloudmersiveImageRecognitionApiClient
16
16
  # Location of one face in an image
17
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)
18
31
  attr_accessor :left_eyebrow
19
32
 
33
+ # Point locations of the right eyebrow (the eyebrow cloesest to the right side of the picture)
20
34
  attr_accessor :right_eyebrow
21
35
 
36
+ # Point locations of the left eye (the eye closest to the left side of the picture)
22
37
  attr_accessor :left_eye
23
38
 
39
+ # Point locations of the right eye (the eye closest to the right side of the picture)
24
40
  attr_accessor :right_eye
25
41
 
42
+ # Point locations of the bottom and sides of the face (cheeks and chin)
26
43
  attr_accessor :bottom_and_sides_of_face
27
44
 
45
+ # Point locations of the nose bridge (the vertical portion of the nose)
28
46
  attr_accessor :nose_bridge
29
47
 
48
+ # Point locations of the bottom (nostrils) of the nose
30
49
  attr_accessor :nose_bottom
31
50
 
51
+ # Point locations of the inner outline of the lips
32
52
  attr_accessor :lips_inner_outline
33
53
 
54
+ # Point locations of the outer outline of the lips
34
55
  attr_accessor :lips_outer_outline
35
56
 
36
- # X coordinate of the left side of the face
37
- attr_accessor :left_x
38
-
39
- # Y coordinate of the top side of the face
40
- attr_accessor :top_y
41
-
42
- # X coordinate of the right side of the face
43
- attr_accessor :right_x
44
-
45
- # Y coordinate of the bottom side of the face
46
- attr_accessor :bottom_y
47
-
48
57
 
49
58
  # Attribute mapping from ruby-style variable name to JSON key.
50
59
  def self.attribute_map
51
60
  {
61
+ :'left_x' => :'LeftX',
62
+ :'top_y' => :'TopY',
63
+ :'right_x' => :'RightX',
64
+ :'bottom_y' => :'BottomY',
52
65
  :'left_eyebrow' => :'LeftEyebrow',
53
66
  :'right_eyebrow' => :'RightEyebrow',
54
67
  :'left_eye' => :'LeftEye',
@@ -57,17 +70,17 @@ module CloudmersiveImageRecognitionApiClient
57
70
  :'nose_bridge' => :'NoseBridge',
58
71
  :'nose_bottom' => :'NoseBottom',
59
72
  :'lips_inner_outline' => :'LipsInnerOutline',
60
- :'lips_outer_outline' => :'LipsOuterOutline',
61
- :'left_x' => :'LeftX',
62
- :'top_y' => :'TopY',
63
- :'right_x' => :'RightX',
64
- :'bottom_y' => :'BottomY'
73
+ :'lips_outer_outline' => :'LipsOuterOutline'
65
74
  }
66
75
  end
67
76
 
68
77
  # Attribute type mapping.
69
78
  def self.swagger_types
70
79
  {
80
+ :'left_x' => :'Integer',
81
+ :'top_y' => :'Integer',
82
+ :'right_x' => :'Integer',
83
+ :'bottom_y' => :'Integer',
71
84
  :'left_eyebrow' => :'Array<FacePoint>',
72
85
  :'right_eyebrow' => :'Array<FacePoint>',
73
86
  :'left_eye' => :'Array<FacePoint>',
@@ -76,11 +89,7 @@ module CloudmersiveImageRecognitionApiClient
76
89
  :'nose_bridge' => :'Array<FacePoint>',
77
90
  :'nose_bottom' => :'Array<FacePoint>',
78
91
  :'lips_inner_outline' => :'Array<FacePoint>',
79
- :'lips_outer_outline' => :'Array<FacePoint>',
80
- :'left_x' => :'Integer',
81
- :'top_y' => :'Integer',
82
- :'right_x' => :'Integer',
83
- :'bottom_y' => :'Integer'
92
+ :'lips_outer_outline' => :'Array<FacePoint>'
84
93
  }
85
94
  end
86
95
 
@@ -92,6 +101,22 @@ module CloudmersiveImageRecognitionApiClient
92
101
  # convert string to symbol for hash key
93
102
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
94
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
+
95
120
  if attributes.has_key?(:'LeftEyebrow')
96
121
  if (value = attributes[:'LeftEyebrow']).is_a?(Array)
97
122
  self.left_eyebrow = value
@@ -146,22 +171,6 @@ module CloudmersiveImageRecognitionApiClient
146
171
  end
147
172
  end
148
173
 
149
- if attributes.has_key?(:'LeftX')
150
- self.left_x = attributes[:'LeftX']
151
- end
152
-
153
- if attributes.has_key?(:'TopY')
154
- self.top_y = attributes[:'TopY']
155
- end
156
-
157
- if attributes.has_key?(:'RightX')
158
- self.right_x = attributes[:'RightX']
159
- end
160
-
161
- if attributes.has_key?(:'BottomY')
162
- self.bottom_y = attributes[:'BottomY']
163
- end
164
-
165
174
  end
166
175
 
167
176
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -182,6 +191,10 @@ module CloudmersiveImageRecognitionApiClient
182
191
  def ==(o)
183
192
  return true if self.equal?(o)
184
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 &&
185
198
  left_eyebrow == o.left_eyebrow &&
186
199
  right_eyebrow == o.right_eyebrow &&
187
200
  left_eye == o.left_eye &&
@@ -190,11 +203,7 @@ module CloudmersiveImageRecognitionApiClient
190
203
  nose_bridge == o.nose_bridge &&
191
204
  nose_bottom == o.nose_bottom &&
192
205
  lips_inner_outline == o.lips_inner_outline &&
193
- lips_outer_outline == o.lips_outer_outline &&
194
- left_x == o.left_x &&
195
- top_y == o.top_y &&
196
- right_x == o.right_x &&
197
- bottom_y == o.bottom_y
206
+ lips_outer_outline == o.lips_outer_outline
198
207
  end
199
208
 
200
209
  # @see the `==` method
@@ -206,7 +215,7 @@ module CloudmersiveImageRecognitionApiClient
206
215
  # Calculates hash code according to all attributes.
207
216
  # @return [Fixnum] Hash code
208
217
  def hash
209
- [left_eyebrow, right_eyebrow, left_eye, right_eye, bottom_and_sides_of_face, nose_bridge, nose_bottom, lips_inner_outline, lips_outer_outline, left_x, top_y, right_x, bottom_y].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
210
219
  end
211
220
 
212
221
  # Builds the object from hash
@@ -0,0 +1,229 @@
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
+ # Result of a find symbol operation on an input image
17
+ class FindSymbolResult
18
+ # True if successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # X location of the left edge of the found location in pixels
22
+ attr_accessor :x_left
23
+
24
+ # Y location of the top edge of the found location in pixels
25
+ attr_accessor :y_top
26
+
27
+ # Width of the found location in pixels
28
+ attr_accessor :width
29
+
30
+ # Height of the found location in pixels
31
+ attr_accessor :height
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'successful' => :'Successful',
38
+ :'x_left' => :'XLeft',
39
+ :'y_top' => :'YTop',
40
+ :'width' => :'Width',
41
+ :'height' => :'Height'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.swagger_types
47
+ {
48
+ :'successful' => :'BOOLEAN',
49
+ :'x_left' => :'Integer',
50
+ :'y_top' => :'Integer',
51
+ :'width' => :'Integer',
52
+ :'height' => :'Integer'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
63
+
64
+ if attributes.has_key?(:'Successful')
65
+ self.successful = attributes[:'Successful']
66
+ end
67
+
68
+ if attributes.has_key?(:'XLeft')
69
+ self.x_left = attributes[:'XLeft']
70
+ end
71
+
72
+ if attributes.has_key?(:'YTop')
73
+ self.y_top = attributes[:'YTop']
74
+ end
75
+
76
+ if attributes.has_key?(:'Width')
77
+ self.width = attributes[:'Width']
78
+ end
79
+
80
+ if attributes.has_key?(:'Height')
81
+ self.height = attributes[:'Height']
82
+ end
83
+
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ return invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ return 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
+ successful == o.successful &&
105
+ x_left == o.x_left &&
106
+ y_top == o.y_top &&
107
+ width == o.width &&
108
+ height == o.height
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Fixnum] Hash code
119
+ def hash
120
+ [successful, x_left, y_top, width, height].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ self.class.swagger_types.each_pair do |key, type|
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[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[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 = CloudmersiveImageRecognitionApiClient.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
+
229
+ end