cloudmersive-image-recognition-api-client 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -4
  3. data/cloudmersive-image-recognition-api-client.gemspec +1 -1
  4. data/docs/FineTextDetectionResult.md +10 -0
  5. data/docs/FineTextItem.md +15 -0
  6. data/docs/RecognizeApi.md +104 -0
  7. data/docs/TextDetectionResult.md +10 -0
  8. data/docs/TextItem.md +11 -0
  9. data/lib/cloudmersive-image-recognition-api-client.rb +5 -1
  10. data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +1 -1
  11. data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +1 -1
  12. data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +1 -1
  13. data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +1 -1
  14. data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +104 -1
  15. data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +1 -1
  16. data/lib/cloudmersive-image-recognition-api-client/api_client.rb +1 -1
  17. data/lib/cloudmersive-image-recognition-api-client/api_error.rb +1 -1
  18. data/lib/cloudmersive-image-recognition-api-client/configuration.rb +1 -1
  19. data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +1 -1
  20. data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +1 -1
  21. data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +1 -1
  22. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +1 -1
  23. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +1 -1
  24. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +1 -1
  25. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +1 -1
  26. data/lib/cloudmersive-image-recognition-api-client/models/face.rb +1 -1
  27. data/lib/cloudmersive-image-recognition-api-client/models/face_compare_response.rb +1 -1
  28. data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +1 -1
  29. data/lib/cloudmersive-image-recognition-api-client/models/face_locate_with_landmarks_response.rb +1 -1
  30. data/lib/cloudmersive-image-recognition-api-client/models/face_match.rb +1 -1
  31. data/lib/cloudmersive-image-recognition-api-client/models/face_point.rb +1 -1
  32. data/lib/cloudmersive-image-recognition-api-client/models/face_with_landmarks.rb +1 -1
  33. data/lib/cloudmersive-image-recognition-api-client/models/fine_text_detection_result.rb +211 -0
  34. data/lib/cloudmersive-image-recognition-api-client/models/fine_text_item.rb +259 -0
  35. data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +1 -1
  36. data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +1 -1
  37. data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +1 -1
  38. data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +1 -1
  39. data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +1 -1
  40. data/lib/cloudmersive-image-recognition-api-client/models/text_detection_result.rb +211 -0
  41. data/lib/cloudmersive-image-recognition-api-client/models/text_item.rb +219 -0
  42. data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +1 -1
  43. data/lib/cloudmersive-image-recognition-api-client/version.rb +2 -2
  44. data/spec/api/artistic_api_spec.rb +1 -1
  45. data/spec/api/edit_api_spec.rb +1 -1
  46. data/spec/api/face_api_spec.rb +1 -1
  47. data/spec/api/nsfw_api_spec.rb +1 -1
  48. data/spec/api/recognize_api_spec.rb +24 -1
  49. data/spec/api/resize_api_spec.rb +1 -1
  50. data/spec/api_client_spec.rb +1 -1
  51. data/spec/configuration_spec.rb +1 -1
  52. data/spec/models/age_detection_result_spec.rb +1 -1
  53. data/spec/models/detected_license_plate_spec.rb +1 -1
  54. data/spec/models/detected_object_spec.rb +1 -1
  55. data/spec/models/draw_rectangle_instance_spec.rb +1 -1
  56. data/spec/models/draw_rectangle_request_spec.rb +1 -1
  57. data/spec/models/draw_text_instance_spec.rb +1 -1
  58. data/spec/models/draw_text_request_spec.rb +1 -1
  59. data/spec/models/face_compare_response_spec.rb +1 -1
  60. data/spec/models/face_locate_response_spec.rb +1 -1
  61. data/spec/models/face_locate_with_landmarks_response_spec.rb +1 -1
  62. data/spec/models/face_match_spec.rb +1 -1
  63. data/spec/models/face_point_spec.rb +1 -1
  64. data/spec/models/face_spec.rb +1 -1
  65. data/spec/models/face_with_landmarks_spec.rb +1 -1
  66. data/spec/models/fine_text_detection_result_spec.rb +54 -0
  67. data/spec/models/fine_text_item_spec.rb +84 -0
  68. data/spec/models/image_description_response_spec.rb +1 -1
  69. data/spec/models/nsfw_result_spec.rb +1 -1
  70. data/spec/models/object_detection_result_spec.rb +1 -1
  71. data/spec/models/person_with_age_spec.rb +1 -1
  72. data/spec/models/recognition_outcome_spec.rb +1 -1
  73. data/spec/models/text_detection_result_spec.rb +54 -0
  74. data/spec/models/text_item_spec.rb +60 -0
  75. data/spec/models/vehicle_license_plate_detection_result_spec.rb +1 -1
  76. data/spec/spec_helper.rb +1 -1
  77. metadata +27 -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
 
@@ -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
 
@@ -0,0 +1,211 @@
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 an operation to detect text in a photo
17
+ class TextDetectionResult
18
+ # True if the operation was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # Text items found in the input image
22
+ attr_accessor :text_items
23
+
24
+ # Count of text items found in the input image
25
+ attr_accessor :text_items_count
26
+
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'successful' => :'Successful',
32
+ :'text_items' => :'TextItems',
33
+ :'text_items_count' => :'TextItemsCount'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.swagger_types
39
+ {
40
+ :'successful' => :'BOOLEAN',
41
+ :'text_items' => :'Array<TextItem>',
42
+ :'text_items_count' => :'Integer'
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?(:'Successful')
55
+ self.successful = attributes[:'Successful']
56
+ end
57
+
58
+ if attributes.has_key?(:'TextItems')
59
+ if (value = attributes[:'TextItems']).is_a?(Array)
60
+ self.text_items = value
61
+ end
62
+ end
63
+
64
+ if attributes.has_key?(:'TextItemsCount')
65
+ self.text_items_count = attributes[:'TextItemsCount']
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
+ return invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ return true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ successful == o.successful &&
89
+ text_items == o.text_items &&
90
+ text_items_count == o.text_items_count
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Fixnum] Hash code
101
+ def hash
102
+ [successful, text_items, text_items_count].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.swagger_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :BOOLEAN
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
163
+ temp_model.build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ next if value.nil?
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map{ |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to? :to_hash
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+
209
+ end
210
+
211
+ end
@@ -0,0 +1,219 @@
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
+ # Individual instance of text occuring in an image; one piece of text
17
+ class TextItem
18
+ # Left X coordinate of the text location; 0 represents the left edge of the input image
19
+ attr_accessor :left_x
20
+
21
+ # Top Y coordinate of the text location; 0 represents the top edge of the input image
22
+ attr_accessor :top_y
23
+
24
+ # Width in pixels of the text item
25
+ attr_accessor :width
26
+
27
+ # Height in pixels of the text item
28
+ attr_accessor :height
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
+ :'width' => :'Width',
37
+ :'height' => :'Height'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'left_x' => :'Integer',
45
+ :'top_y' => :'Integer',
46
+ :'width' => :'Integer',
47
+ :'height' => :'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?(:'Width')
68
+ self.width = attributes[:'Width']
69
+ end
70
+
71
+ if attributes.has_key?(:'Height')
72
+ self.height = attributes[:'Height']
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
+ width == o.width &&
98
+ height == o.height
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, width, height].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