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.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. metadata +3 -139
  3. data/Gemfile +0 -7
  4. data/README.md +0 -174
  5. data/Rakefile +0 -8
  6. data/cloudmersive-image-recognition-api-client.gemspec +0 -45
  7. data/docs/AgeDetectionResult.md +0 -10
  8. data/docs/ArtisticApi.md +0 -66
  9. data/docs/ColorResult.md +0 -10
  10. data/docs/ConvertApi.md +0 -176
  11. data/docs/DetectedLicensePlate.md +0 -14
  12. data/docs/DetectedObject.md +0 -13
  13. data/docs/DominantColorResult.md +0 -9
  14. data/docs/DrawPolygonInstance.md +0 -11
  15. data/docs/DrawPolygonRequest.md +0 -10
  16. data/docs/DrawRectangleInstance.md +0 -14
  17. data/docs/DrawRectangleRequest.md +0 -10
  18. data/docs/DrawTextInstance.md +0 -15
  19. data/docs/DrawTextRequest.md +0 -10
  20. data/docs/EditApi.md +0 -539
  21. data/docs/Face.md +0 -11
  22. data/docs/FaceApi.md +0 -396
  23. data/docs/FaceCompareResponse.md +0 -11
  24. data/docs/FaceLocateResponse.md +0 -11
  25. data/docs/FaceLocateWithLandmarksResponse.md +0 -11
  26. data/docs/FaceMatch.md +0 -13
  27. data/docs/FacePoint.md +0 -9
  28. data/docs/FaceWithLandmarks.md +0 -20
  29. data/docs/FilterApi.md +0 -478
  30. data/docs/FindSymbolResult.md +0 -13
  31. data/docs/FineTextDetectionResult.md +0 -10
  32. data/docs/FineTextItem.md +0 -18
  33. data/docs/GenderDetectionResult.md +0 -10
  34. data/docs/ImageDescriptionResponse.md +0 -11
  35. data/docs/InfoApi.md +0 -63
  36. data/docs/NsfwApi.md +0 -63
  37. data/docs/NsfwResult.md +0 -10
  38. data/docs/ObjectDetectionResult.md +0 -10
  39. data/docs/PersonWithAge.md +0 -11
  40. data/docs/PersonWithGender.md +0 -10
  41. data/docs/PolygonPoint.md +0 -9
  42. data/docs/RecognitionOutcome.md +0 -9
  43. data/docs/RecognizeApi.md +0 -455
  44. data/docs/ResizeApi.md +0 -130
  45. data/docs/TextDetectionResult.md +0 -10
  46. data/docs/TextItem.md +0 -11
  47. data/docs/VehicleLicensePlateDetectionResult.md +0 -10
  48. data/git_push.sh +0 -55
  49. data/lib/cloudmersive-image-recognition-api-client.rb +0 -80
  50. data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +0 -85
  51. data/lib/cloudmersive-image-recognition-api-client/api/convert_api.rb +0 -197
  52. data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +0 -597
  53. data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +0 -422
  54. data/lib/cloudmersive-image-recognition-api-client/api/filter_api.rb +0 -533
  55. data/lib/cloudmersive-image-recognition-api-client/api/info_api.rb +0 -79
  56. data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +0 -79
  57. data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +0 -481
  58. data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +0 -159
  59. data/lib/cloudmersive-image-recognition-api-client/api_client.rb +0 -389
  60. data/lib/cloudmersive-image-recognition-api-client/api_error.rb +0 -38
  61. data/lib/cloudmersive-image-recognition-api-client/configuration.rb +0 -209
  62. data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +0 -211
  63. data/lib/cloudmersive-image-recognition-api-client/models/color_result.rb +0 -209
  64. data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +0 -249
  65. data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +0 -239
  66. data/lib/cloudmersive-image-recognition-api-client/models/dominant_color_result.rb +0 -201
  67. data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_instance.rb +0 -221
  68. data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_request.rb +0 -227
  69. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +0 -249
  70. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +0 -227
  71. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +0 -259
  72. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +0 -227
  73. data/lib/cloudmersive-image-recognition-api-client/models/face.rb +0 -219
  74. data/lib/cloudmersive-image-recognition-api-client/models/face_compare_response.rb +0 -221
  75. data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +0 -220
  76. data/lib/cloudmersive-image-recognition-api-client/models/face_locate_with_landmarks_response.rb +0 -221
  77. data/lib/cloudmersive-image-recognition-api-client/models/face_match.rb +0 -239
  78. data/lib/cloudmersive-image-recognition-api-client/models/face_point.rb +0 -199
  79. data/lib/cloudmersive-image-recognition-api-client/models/face_with_landmarks.rb +0 -327
  80. data/lib/cloudmersive-image-recognition-api-client/models/find_symbol_result.rb +0 -239
  81. data/lib/cloudmersive-image-recognition-api-client/models/fine_text_detection_result.rb +0 -211
  82. data/lib/cloudmersive-image-recognition-api-client/models/fine_text_item.rb +0 -289
  83. data/lib/cloudmersive-image-recognition-api-client/models/gender_detection_result.rb +0 -211
  84. data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +0 -219
  85. data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +0 -209
  86. data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +0 -211
  87. data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +0 -218
  88. data/lib/cloudmersive-image-recognition-api-client/models/person_with_gender.rb +0 -209
  89. data/lib/cloudmersive-image-recognition-api-client/models/polygon_point.rb +0 -199
  90. data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +0 -199
  91. data/lib/cloudmersive-image-recognition-api-client/models/text_detection_result.rb +0 -211
  92. data/lib/cloudmersive-image-recognition-api-client/models/text_item.rb +0 -219
  93. data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +0 -211
  94. data/lib/cloudmersive-image-recognition-api-client/version.rb +0 -15
  95. data/spec/api/artistic_api_spec.rb +0 -48
  96. data/spec/api/convert_api_spec.rb +0 -72
  97. data/spec/api/edit_api_spec.rb +0 -155
  98. data/spec/api/face_api_spec.rb +0 -120
  99. data/spec/api/filter_api_spec.rb +0 -141
  100. data/spec/api/info_api_spec.rb +0 -47
  101. data/spec/api/nsfw_api_spec.rb +0 -47
  102. data/spec/api/recognize_api_spec.rb +0 -133
  103. data/spec/api/resize_api_spec.rb +0 -63
  104. data/spec/api_client_spec.rb +0 -226
  105. data/spec/configuration_spec.rb +0 -42
  106. data/spec/models/age_detection_result_spec.rb +0 -54
  107. data/spec/models/color_result_spec.rb +0 -54
  108. data/spec/models/detected_license_plate_spec.rb +0 -78
  109. data/spec/models/detected_object_spec.rb +0 -72
  110. data/spec/models/dominant_color_result_spec.rb +0 -48
  111. data/spec/models/draw_polygon_instance_spec.rb +0 -60
  112. data/spec/models/draw_polygon_request_spec.rb +0 -54
  113. data/spec/models/draw_rectangle_instance_spec.rb +0 -78
  114. data/spec/models/draw_rectangle_request_spec.rb +0 -54
  115. data/spec/models/draw_text_instance_spec.rb +0 -84
  116. data/spec/models/draw_text_request_spec.rb +0 -54
  117. data/spec/models/face_compare_response_spec.rb +0 -60
  118. data/spec/models/face_locate_response_spec.rb +0 -60
  119. data/spec/models/face_locate_with_landmarks_response_spec.rb +0 -60
  120. data/spec/models/face_match_spec.rb +0 -72
  121. data/spec/models/face_point_spec.rb +0 -48
  122. data/spec/models/face_spec.rb +0 -60
  123. data/spec/models/face_with_landmarks_spec.rb +0 -114
  124. data/spec/models/find_symbol_result_spec.rb +0 -72
  125. data/spec/models/fine_text_detection_result_spec.rb +0 -54
  126. data/spec/models/fine_text_item_spec.rb +0 -102
  127. data/spec/models/gender_detection_result_spec.rb +0 -54
  128. data/spec/models/image_description_response_spec.rb +0 -60
  129. data/spec/models/nsfw_result_spec.rb +0 -54
  130. data/spec/models/object_detection_result_spec.rb +0 -54
  131. data/spec/models/person_with_age_spec.rb +0 -60
  132. data/spec/models/person_with_gender_spec.rb +0 -54
  133. data/spec/models/polygon_point_spec.rb +0 -48
  134. data/spec/models/recognition_outcome_spec.rb +0 -48
  135. data/spec/models/text_detection_result_spec.rb +0 -54
  136. data/spec/models/text_item_spec.rb +0 -60
  137. data/spec/models/vehicle_license_plate_detection_result_spec.rb +0 -54
  138. data/spec/spec_helper.rb +0 -111
@@ -1,227 +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
- # Request to draw one or more pieces of text onto an image
17
- class DrawTextRequest
18
- # Image to draw text on, in bytes. You can also use the BaseImageUrl instead to supply image input as a URL
19
- attr_accessor :base_image_bytes
20
-
21
- # Image to draw text on, as an HTTP or HTTPS fully-qualified URL
22
- attr_accessor :base_image_url
23
-
24
- # One or more pieces of text to draw onto the image
25
- attr_accessor :text_to_draw
26
-
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'base_image_bytes' => :'BaseImageBytes',
32
- :'base_image_url' => :'BaseImageUrl',
33
- :'text_to_draw' => :'TextToDraw'
34
- }
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.swagger_types
39
- {
40
- :'base_image_bytes' => :'String',
41
- :'base_image_url' => :'String',
42
- :'text_to_draw' => :'Array<DrawTextInstance>'
43
- }
44
- end
45
-
46
- # Initializes the object
47
- # @param [Hash] attributes Model attributes in the form of hash
48
- def initialize(attributes = {})
49
- return unless attributes.is_a?(Hash)
50
-
51
- # convert string to symbol for hash key
52
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
53
-
54
- if attributes.has_key?(:'BaseImageBytes')
55
- self.base_image_bytes = attributes[:'BaseImageBytes']
56
- end
57
-
58
- if attributes.has_key?(:'BaseImageUrl')
59
- self.base_image_url = attributes[:'BaseImageUrl']
60
- end
61
-
62
- if attributes.has_key?(:'TextToDraw')
63
- if (value = attributes[:'TextToDraw']).is_a?(Array)
64
- self.text_to_draw = value
65
- end
66
- end
67
-
68
- end
69
-
70
- # Show invalid properties with the reasons. Usually used together with valid?
71
- # @return Array for valid properties with the reasons
72
- def list_invalid_properties
73
- invalid_properties = Array.new
74
- if !@base_image_bytes.nil? && @base_image_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
75
- invalid_properties.push("invalid value for 'base_image_bytes', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.")
76
- end
77
-
78
- return invalid_properties
79
- end
80
-
81
- # Check to see if the all the properties in the model are valid
82
- # @return true if the model is valid
83
- def valid?
84
- return false if !@base_image_bytes.nil? && @base_image_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
85
- return true
86
- end
87
-
88
- # Custom attribute writer method with validation
89
- # @param [Object] base_image_bytes Value to be assigned
90
- def base_image_bytes=(base_image_bytes)
91
-
92
- if !base_image_bytes.nil? && base_image_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
93
- fail ArgumentError, "invalid value for 'base_image_bytes', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."
94
- end
95
-
96
- @base_image_bytes = base_image_bytes
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
- base_image_bytes == o.base_image_bytes &&
105
- base_image_url == o.base_image_url &&
106
- text_to_draw == o.text_to_draw
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
- [base_image_bytes, base_image_url, text_to_draw].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
- if type =~ /\AArray<(.*)>/i
128
- # check to ensure the input is an array given that the the attribute
129
- # is documented as an array but the input is not
130
- if attributes[self.class.attribute_map[key]].is_a?(Array)
131
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
132
- end
133
- elsif !attributes[self.class.attribute_map[key]].nil?
134
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
- end # or else data not found in attributes(hash), not an issue as the data can be optional
136
- end
137
-
138
- self
139
- end
140
-
141
- # Deserializes the data based on type
142
- # @param string type Data type
143
- # @param string value Value to be deserialized
144
- # @return [Object] Deserialized data
145
- def _deserialize(type, value)
146
- case type.to_sym
147
- when :DateTime
148
- DateTime.parse(value)
149
- when :Date
150
- Date.parse(value)
151
- when :String
152
- value.to_s
153
- when :Integer
154
- value.to_i
155
- when :Float
156
- value.to_f
157
- when :BOOLEAN
158
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
- true
160
- else
161
- false
162
- end
163
- when :Object
164
- # generic object (usually a Hash), return directly
165
- value
166
- when /\AArray<(?<inner_type>.+)>\z/
167
- inner_type = Regexp.last_match[:inner_type]
168
- value.map { |v| _deserialize(inner_type, v) }
169
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
- k_type = Regexp.last_match[:k_type]
171
- v_type = Regexp.last_match[:v_type]
172
- {}.tap do |hash|
173
- value.each do |k, v|
174
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
- end
176
- end
177
- else # model
178
- temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
179
- temp_model.build_from_hash(value)
180
- end
181
- end
182
-
183
- # Returns the string representation of the object
184
- # @return [String] String presentation of the object
185
- def to_s
186
- to_hash.to_s
187
- end
188
-
189
- # to_body is an alias to to_hash (backward compatibility)
190
- # @return [Hash] Returns the object in the form of hash
191
- def to_body
192
- to_hash
193
- end
194
-
195
- # Returns the object in the form of hash
196
- # @return [Hash] Returns the object in the form of hash
197
- def to_hash
198
- hash = {}
199
- self.class.attribute_map.each_pair do |attr, param|
200
- value = self.send(attr)
201
- next if value.nil?
202
- hash[param] = _to_hash(value)
203
- end
204
- hash
205
- end
206
-
207
- # Outputs non-array value in the form of hash
208
- # For object, use to_hash. Otherwise, just return the value
209
- # @param [Object] value Any valid value
210
- # @return [Hash] Returns the value in the form of hash
211
- def _to_hash(value)
212
- if value.is_a?(Array)
213
- value.compact.map{ |v| _to_hash(v) }
214
- elsif value.is_a?(Hash)
215
- {}.tap do |hash|
216
- value.each { |k, v| hash[k] = _to_hash(v) }
217
- end
218
- elsif value.respond_to? :to_hash
219
- value.to_hash
220
- else
221
- value
222
- end
223
- end
224
-
225
- end
226
-
227
- end
@@ -1,219 +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 Face
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
-
31
- # Attribute mapping from ruby-style variable name to JSON key.
32
- def self.attribute_map
33
- {
34
- :'left_x' => :'LeftX',
35
- :'top_y' => :'TopY',
36
- :'right_x' => :'RightX',
37
- :'bottom_y' => :'BottomY'
38
- }
39
- end
40
-
41
- # Attribute type mapping.
42
- def self.swagger_types
43
- {
44
- :'left_x' => :'Integer',
45
- :'top_y' => :'Integer',
46
- :'right_x' => :'Integer',
47
- :'bottom_y' => :'Integer'
48
- }
49
- end
50
-
51
- # Initializes the object
52
- # @param [Hash] attributes Model attributes in the form of hash
53
- def initialize(attributes = {})
54
- return unless attributes.is_a?(Hash)
55
-
56
- # convert string to symbol for hash key
57
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
58
-
59
- if attributes.has_key?(:'LeftX')
60
- self.left_x = attributes[:'LeftX']
61
- end
62
-
63
- if attributes.has_key?(:'TopY')
64
- self.top_y = attributes[:'TopY']
65
- end
66
-
67
- if attributes.has_key?(:'RightX')
68
- self.right_x = attributes[:'RightX']
69
- end
70
-
71
- if attributes.has_key?(:'BottomY')
72
- self.bottom_y = attributes[:'BottomY']
73
- end
74
-
75
- end
76
-
77
- # Show invalid properties with the reasons. Usually used together with valid?
78
- # @return Array for valid properties with the reasons
79
- def list_invalid_properties
80
- invalid_properties = Array.new
81
- return invalid_properties
82
- end
83
-
84
- # Check to see if the all the properties in the model are valid
85
- # @return true if the model is valid
86
- def valid?
87
- return true
88
- end
89
-
90
- # Checks equality by comparing each attribute.
91
- # @param [Object] Object to be compared
92
- def ==(o)
93
- return true if self.equal?(o)
94
- self.class == o.class &&
95
- left_x == o.left_x &&
96
- top_y == o.top_y &&
97
- right_x == o.right_x &&
98
- bottom_y == o.bottom_y
99
- end
100
-
101
- # @see the `==` method
102
- # @param [Object] Object to be compared
103
- def eql?(o)
104
- self == o
105
- end
106
-
107
- # Calculates hash code according to all attributes.
108
- # @return [Fixnum] Hash code
109
- def hash
110
- [left_x, top_y, right_x, bottom_y].hash
111
- end
112
-
113
- # Builds the object from hash
114
- # @param [Hash] attributes Model attributes in the form of hash
115
- # @return [Object] Returns the model itself
116
- def build_from_hash(attributes)
117
- return nil unless attributes.is_a?(Hash)
118
- self.class.swagger_types.each_pair do |key, type|
119
- if type =~ /\AArray<(.*)>/i
120
- # check to ensure the input is an array given that the the attribute
121
- # is documented as an array but the input is not
122
- if attributes[self.class.attribute_map[key]].is_a?(Array)
123
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
124
- end
125
- elsif !attributes[self.class.attribute_map[key]].nil?
126
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
- end # or else data not found in attributes(hash), not an issue as the data can be optional
128
- end
129
-
130
- self
131
- end
132
-
133
- # Deserializes the data based on type
134
- # @param string type Data type
135
- # @param string value Value to be deserialized
136
- # @return [Object] Deserialized data
137
- def _deserialize(type, value)
138
- case type.to_sym
139
- when :DateTime
140
- DateTime.parse(value)
141
- when :Date
142
- Date.parse(value)
143
- when :String
144
- value.to_s
145
- when :Integer
146
- value.to_i
147
- when :Float
148
- value.to_f
149
- when :BOOLEAN
150
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
- true
152
- else
153
- false
154
- end
155
- when :Object
156
- # generic object (usually a Hash), return directly
157
- value
158
- when /\AArray<(?<inner_type>.+)>\z/
159
- inner_type = Regexp.last_match[:inner_type]
160
- value.map { |v| _deserialize(inner_type, v) }
161
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
- k_type = Regexp.last_match[:k_type]
163
- v_type = Regexp.last_match[:v_type]
164
- {}.tap do |hash|
165
- value.each do |k, v|
166
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
- end
168
- end
169
- else # model
170
- temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
171
- temp_model.build_from_hash(value)
172
- end
173
- end
174
-
175
- # Returns the string representation of the object
176
- # @return [String] String presentation of the object
177
- def to_s
178
- to_hash.to_s
179
- end
180
-
181
- # to_body is an alias to to_hash (backward compatibility)
182
- # @return [Hash] Returns the object in the form of hash
183
- def to_body
184
- to_hash
185
- end
186
-
187
- # Returns the object in the form of hash
188
- # @return [Hash] Returns the object in the form of hash
189
- def to_hash
190
- hash = {}
191
- self.class.attribute_map.each_pair do |attr, param|
192
- value = self.send(attr)
193
- next if value.nil?
194
- hash[param] = _to_hash(value)
195
- end
196
- hash
197
- end
198
-
199
- # Outputs non-array value in the form of hash
200
- # For object, use to_hash. Otherwise, just return the value
201
- # @param [Object] value Any valid value
202
- # @return [Hash] Returns the value in the form of hash
203
- def _to_hash(value)
204
- if value.is_a?(Array)
205
- value.compact.map{ |v| _to_hash(v) }
206
- elsif value.is_a?(Hash)
207
- {}.tap do |hash|
208
- value.each { |k, v| hash[k] = _to_hash(v) }
209
- end
210
- elsif value.respond_to? :to_hash
211
- value.to_hash
212
- else
213
- value
214
- end
215
- end
216
-
217
- end
218
-
219
- end
@@ -1,221 +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
- # Results of comparing/matching faces in an image
17
- class FaceCompareResponse
18
- # True if the operation was successful, false otherwise
19
- attr_accessor :successful
20
-
21
- # Array of faces found in the input image
22
- attr_accessor :faces
23
-
24
- # Number of faces found in the image
25
- attr_accessor :face_count
26
-
27
- # Details of any errors that occurred
28
- attr_accessor :error_details
29
-
30
-
31
- # Attribute mapping from ruby-style variable name to JSON key.
32
- def self.attribute_map
33
- {
34
- :'successful' => :'Successful',
35
- :'faces' => :'Faces',
36
- :'face_count' => :'FaceCount',
37
- :'error_details' => :'ErrorDetails'
38
- }
39
- end
40
-
41
- # Attribute type mapping.
42
- def self.swagger_types
43
- {
44
- :'successful' => :'BOOLEAN',
45
- :'faces' => :'Array<FaceMatch>',
46
- :'face_count' => :'Integer',
47
- :'error_details' => :'String'
48
- }
49
- end
50
-
51
- # Initializes the object
52
- # @param [Hash] attributes Model attributes in the form of hash
53
- def initialize(attributes = {})
54
- return unless attributes.is_a?(Hash)
55
-
56
- # convert string to symbol for hash key
57
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
58
-
59
- if attributes.has_key?(:'Successful')
60
- self.successful = attributes[:'Successful']
61
- end
62
-
63
- if attributes.has_key?(:'Faces')
64
- if (value = attributes[:'Faces']).is_a?(Array)
65
- self.faces = value
66
- end
67
- end
68
-
69
- if attributes.has_key?(:'FaceCount')
70
- self.face_count = attributes[:'FaceCount']
71
- end
72
-
73
- if attributes.has_key?(:'ErrorDetails')
74
- self.error_details = attributes[:'ErrorDetails']
75
- end
76
-
77
- end
78
-
79
- # Show invalid properties with the reasons. Usually used together with valid?
80
- # @return Array for valid properties with the reasons
81
- def list_invalid_properties
82
- invalid_properties = Array.new
83
- return invalid_properties
84
- end
85
-
86
- # Check to see if the all the properties in the model are valid
87
- # @return true if the model is valid
88
- def valid?
89
- return true
90
- end
91
-
92
- # Checks equality by comparing each attribute.
93
- # @param [Object] Object to be compared
94
- def ==(o)
95
- return true if self.equal?(o)
96
- self.class == o.class &&
97
- successful == o.successful &&
98
- faces == o.faces &&
99
- face_count == o.face_count &&
100
- error_details == o.error_details
101
- end
102
-
103
- # @see the `==` method
104
- # @param [Object] Object to be compared
105
- def eql?(o)
106
- self == o
107
- end
108
-
109
- # Calculates hash code according to all attributes.
110
- # @return [Fixnum] Hash code
111
- def hash
112
- [successful, faces, face_count, error_details].hash
113
- end
114
-
115
- # Builds the object from hash
116
- # @param [Hash] attributes Model attributes in the form of hash
117
- # @return [Object] Returns the model itself
118
- def build_from_hash(attributes)
119
- return nil unless attributes.is_a?(Hash)
120
- self.class.swagger_types.each_pair do |key, type|
121
- if type =~ /\AArray<(.*)>/i
122
- # check to ensure the input is an array given that the the attribute
123
- # is documented as an array but the input is not
124
- if attributes[self.class.attribute_map[key]].is_a?(Array)
125
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
126
- end
127
- elsif !attributes[self.class.attribute_map[key]].nil?
128
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
- end # or else data not found in attributes(hash), not an issue as the data can be optional
130
- end
131
-
132
- self
133
- end
134
-
135
- # Deserializes the data based on type
136
- # @param string type Data type
137
- # @param string value Value to be deserialized
138
- # @return [Object] Deserialized data
139
- def _deserialize(type, value)
140
- case type.to_sym
141
- when :DateTime
142
- DateTime.parse(value)
143
- when :Date
144
- Date.parse(value)
145
- when :String
146
- value.to_s
147
- when :Integer
148
- value.to_i
149
- when :Float
150
- value.to_f
151
- when :BOOLEAN
152
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
- true
154
- else
155
- false
156
- end
157
- when :Object
158
- # generic object (usually a Hash), return directly
159
- value
160
- when /\AArray<(?<inner_type>.+)>\z/
161
- inner_type = Regexp.last_match[:inner_type]
162
- value.map { |v| _deserialize(inner_type, v) }
163
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
- k_type = Regexp.last_match[:k_type]
165
- v_type = Regexp.last_match[:v_type]
166
- {}.tap do |hash|
167
- value.each do |k, v|
168
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
- end
170
- end
171
- else # model
172
- temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
173
- temp_model.build_from_hash(value)
174
- end
175
- end
176
-
177
- # Returns the string representation of the object
178
- # @return [String] String presentation of the object
179
- def to_s
180
- to_hash.to_s
181
- end
182
-
183
- # to_body is an alias to to_hash (backward compatibility)
184
- # @return [Hash] Returns the object in the form of hash
185
- def to_body
186
- to_hash
187
- end
188
-
189
- # Returns the object in the form of hash
190
- # @return [Hash] Returns the object in the form of hash
191
- def to_hash
192
- hash = {}
193
- self.class.attribute_map.each_pair do |attr, param|
194
- value = self.send(attr)
195
- next if value.nil?
196
- hash[param] = _to_hash(value)
197
- end
198
- hash
199
- end
200
-
201
- # Outputs non-array value in the form of hash
202
- # For object, use to_hash. Otherwise, just return the value
203
- # @param [Object] value Any valid value
204
- # @return [Hash] Returns the value in the form of hash
205
- def _to_hash(value)
206
- if value.is_a?(Array)
207
- value.compact.map{ |v| _to_hash(v) }
208
- elsif value.is_a?(Hash)
209
- {}.tap do |hash|
210
- value.each { |k, v| hash[k] = _to_hash(v) }
211
- end
212
- elsif value.respond_to? :to_hash
213
- value.to_hash
214
- else
215
- value
216
- end
217
- end
218
-
219
- end
220
-
221
- end