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,239 +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
- # 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
- # Score between 0.0 and 1.0 that measures how closely the symbol matched; scores above 0.2 are good
22
- attr_accessor :match_score
23
-
24
- # X location of the left edge of the found location in pixels
25
- attr_accessor :x_left
26
-
27
- # Y location of the top edge of the found location in pixels
28
- attr_accessor :y_top
29
-
30
- # Width of the found location in pixels
31
- attr_accessor :width
32
-
33
- # Height of the found location in pixels
34
- attr_accessor :height
35
-
36
-
37
- # Attribute mapping from ruby-style variable name to JSON key.
38
- def self.attribute_map
39
- {
40
- :'successful' => :'Successful',
41
- :'match_score' => :'MatchScore',
42
- :'x_left' => :'XLeft',
43
- :'y_top' => :'YTop',
44
- :'width' => :'Width',
45
- :'height' => :'Height'
46
- }
47
- end
48
-
49
- # Attribute type mapping.
50
- def self.swagger_types
51
- {
52
- :'successful' => :'BOOLEAN',
53
- :'match_score' => :'Float',
54
- :'x_left' => :'Integer',
55
- :'y_top' => :'Integer',
56
- :'width' => :'Integer',
57
- :'height' => :'Integer'
58
- }
59
- end
60
-
61
- # Initializes the object
62
- # @param [Hash] attributes Model attributes in the form of hash
63
- def initialize(attributes = {})
64
- return unless attributes.is_a?(Hash)
65
-
66
- # convert string to symbol for hash key
67
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
68
-
69
- if attributes.has_key?(:'Successful')
70
- self.successful = attributes[:'Successful']
71
- end
72
-
73
- if attributes.has_key?(:'MatchScore')
74
- self.match_score = attributes[:'MatchScore']
75
- end
76
-
77
- if attributes.has_key?(:'XLeft')
78
- self.x_left = attributes[:'XLeft']
79
- end
80
-
81
- if attributes.has_key?(:'YTop')
82
- self.y_top = attributes[:'YTop']
83
- end
84
-
85
- if attributes.has_key?(:'Width')
86
- self.width = attributes[:'Width']
87
- end
88
-
89
- if attributes.has_key?(:'Height')
90
- self.height = attributes[:'Height']
91
- end
92
-
93
- end
94
-
95
- # Show invalid properties with the reasons. Usually used together with valid?
96
- # @return Array for valid properties with the reasons
97
- def list_invalid_properties
98
- invalid_properties = Array.new
99
- return invalid_properties
100
- end
101
-
102
- # Check to see if the all the properties in the model are valid
103
- # @return true if the model is valid
104
- def valid?
105
- return true
106
- end
107
-
108
- # Checks equality by comparing each attribute.
109
- # @param [Object] Object to be compared
110
- def ==(o)
111
- return true if self.equal?(o)
112
- self.class == o.class &&
113
- successful == o.successful &&
114
- match_score == o.match_score &&
115
- x_left == o.x_left &&
116
- y_top == o.y_top &&
117
- width == o.width &&
118
- height == o.height
119
- end
120
-
121
- # @see the `==` method
122
- # @param [Object] Object to be compared
123
- def eql?(o)
124
- self == o
125
- end
126
-
127
- # Calculates hash code according to all attributes.
128
- # @return [Fixnum] Hash code
129
- def hash
130
- [successful, match_score, x_left, y_top, width, height].hash
131
- end
132
-
133
- # Builds the object from hash
134
- # @param [Hash] attributes Model attributes in the form of hash
135
- # @return [Object] Returns the model itself
136
- def build_from_hash(attributes)
137
- return nil unless attributes.is_a?(Hash)
138
- self.class.swagger_types.each_pair do |key, type|
139
- if type =~ /\AArray<(.*)>/i
140
- # check to ensure the input is an array given that the the attribute
141
- # is documented as an array but the input is not
142
- if attributes[self.class.attribute_map[key]].is_a?(Array)
143
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
144
- end
145
- elsif !attributes[self.class.attribute_map[key]].nil?
146
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
- end # or else data not found in attributes(hash), not an issue as the data can be optional
148
- end
149
-
150
- self
151
- end
152
-
153
- # Deserializes the data based on type
154
- # @param string type Data type
155
- # @param string value Value to be deserialized
156
- # @return [Object] Deserialized data
157
- def _deserialize(type, value)
158
- case type.to_sym
159
- when :DateTime
160
- DateTime.parse(value)
161
- when :Date
162
- Date.parse(value)
163
- when :String
164
- value.to_s
165
- when :Integer
166
- value.to_i
167
- when :Float
168
- value.to_f
169
- when :BOOLEAN
170
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
- true
172
- else
173
- false
174
- end
175
- when :Object
176
- # generic object (usually a Hash), return directly
177
- value
178
- when /\AArray<(?<inner_type>.+)>\z/
179
- inner_type = Regexp.last_match[:inner_type]
180
- value.map { |v| _deserialize(inner_type, v) }
181
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
- k_type = Regexp.last_match[:k_type]
183
- v_type = Regexp.last_match[:v_type]
184
- {}.tap do |hash|
185
- value.each do |k, v|
186
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
- end
188
- end
189
- else # model
190
- temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
191
- temp_model.build_from_hash(value)
192
- end
193
- end
194
-
195
- # Returns the string representation of the object
196
- # @return [String] String presentation of the object
197
- def to_s
198
- to_hash.to_s
199
- end
200
-
201
- # to_body is an alias to to_hash (backward compatibility)
202
- # @return [Hash] Returns the object in the form of hash
203
- def to_body
204
- to_hash
205
- end
206
-
207
- # Returns the object in the form of hash
208
- # @return [Hash] Returns the object in the form of hash
209
- def to_hash
210
- hash = {}
211
- self.class.attribute_map.each_pair do |attr, param|
212
- value = self.send(attr)
213
- next if value.nil?
214
- hash[param] = _to_hash(value)
215
- end
216
- hash
217
- end
218
-
219
- # Outputs non-array value in the form of hash
220
- # For object, use to_hash. Otherwise, just return the value
221
- # @param [Object] value Any valid value
222
- # @return [Hash] Returns the value in the form of hash
223
- def _to_hash(value)
224
- if value.is_a?(Array)
225
- value.compact.map{ |v| _to_hash(v) }
226
- elsif value.is_a?(Hash)
227
- {}.tap do |hash|
228
- value.each { |k, v| hash[k] = _to_hash(v) }
229
- end
230
- elsif value.respond_to? :to_hash
231
- value.to_hash
232
- else
233
- value
234
- end
235
- end
236
-
237
- end
238
-
239
- end
@@ -1,211 +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
- # Result of an operation to detect text in a photo
17
- class FineTextDetectionResult
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<FineTextItem>',
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
@@ -1,289 +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
- # Individual instance of text occuring in an image; one piece of text
17
- class FineTextItem
18
- # X coordinate of the top/left text location; 0 represents the left edge of the input image
19
- attr_accessor :top_left_x
20
-
21
- # Y coordinate of the top/left text location; 0 represents the top edge of the input image
22
- attr_accessor :top_left_y
23
-
24
- # X coordinate of the top/right text location; 0 represents the left edge of the input image
25
- attr_accessor :top_right_x
26
-
27
- # Y coordinate of the top/right text location; 0 represents the top edge of the input image
28
- attr_accessor :top_right_y
29
-
30
- # X coordinate of the bottom/left text location; 0 represents the left edge of the input image
31
- attr_accessor :bottom_left_x
32
-
33
- # Y coordinate of the bottom/left text location; 0 represents the top edge of the input image
34
- attr_accessor :bottom_left_y
35
-
36
- # X coordinate of the bottom/right text location; 0 represents the left edge of the input image
37
- attr_accessor :bottom_right_x
38
-
39
- # Y coordinate of the bottom/right text location; 0 represents the top edge of the input image
40
- attr_accessor :bottom_right_y
41
-
42
- # Width in pixels of the text
43
- attr_accessor :width
44
-
45
- # Height in pixels of the text
46
- attr_accessor :height
47
-
48
- # Rotation Angle in radians of the text
49
- attr_accessor :angle
50
-
51
-
52
- # Attribute mapping from ruby-style variable name to JSON key.
53
- def self.attribute_map
54
- {
55
- :'top_left_x' => :'TopLeftX',
56
- :'top_left_y' => :'TopLeftY',
57
- :'top_right_x' => :'TopRightX',
58
- :'top_right_y' => :'TopRightY',
59
- :'bottom_left_x' => :'BottomLeftX',
60
- :'bottom_left_y' => :'BottomLeftY',
61
- :'bottom_right_x' => :'BottomRightX',
62
- :'bottom_right_y' => :'BottomRightY',
63
- :'width' => :'Width',
64
- :'height' => :'Height',
65
- :'angle' => :'Angle'
66
- }
67
- end
68
-
69
- # Attribute type mapping.
70
- def self.swagger_types
71
- {
72
- :'top_left_x' => :'Integer',
73
- :'top_left_y' => :'Integer',
74
- :'top_right_x' => :'Integer',
75
- :'top_right_y' => :'Integer',
76
- :'bottom_left_x' => :'Integer',
77
- :'bottom_left_y' => :'Integer',
78
- :'bottom_right_x' => :'Integer',
79
- :'bottom_right_y' => :'Integer',
80
- :'width' => :'Integer',
81
- :'height' => :'Integer',
82
- :'angle' => :'Float'
83
- }
84
- end
85
-
86
- # Initializes the object
87
- # @param [Hash] attributes Model attributes in the form of hash
88
- def initialize(attributes = {})
89
- return unless attributes.is_a?(Hash)
90
-
91
- # convert string to symbol for hash key
92
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
93
-
94
- if attributes.has_key?(:'TopLeftX')
95
- self.top_left_x = attributes[:'TopLeftX']
96
- end
97
-
98
- if attributes.has_key?(:'TopLeftY')
99
- self.top_left_y = attributes[:'TopLeftY']
100
- end
101
-
102
- if attributes.has_key?(:'TopRightX')
103
- self.top_right_x = attributes[:'TopRightX']
104
- end
105
-
106
- if attributes.has_key?(:'TopRightY')
107
- self.top_right_y = attributes[:'TopRightY']
108
- end
109
-
110
- if attributes.has_key?(:'BottomLeftX')
111
- self.bottom_left_x = attributes[:'BottomLeftX']
112
- end
113
-
114
- if attributes.has_key?(:'BottomLeftY')
115
- self.bottom_left_y = attributes[:'BottomLeftY']
116
- end
117
-
118
- if attributes.has_key?(:'BottomRightX')
119
- self.bottom_right_x = attributes[:'BottomRightX']
120
- end
121
-
122
- if attributes.has_key?(:'BottomRightY')
123
- self.bottom_right_y = attributes[:'BottomRightY']
124
- end
125
-
126
- if attributes.has_key?(:'Width')
127
- self.width = attributes[:'Width']
128
- end
129
-
130
- if attributes.has_key?(:'Height')
131
- self.height = attributes[:'Height']
132
- end
133
-
134
- if attributes.has_key?(:'Angle')
135
- self.angle = attributes[:'Angle']
136
- end
137
-
138
- end
139
-
140
- # Show invalid properties with the reasons. Usually used together with valid?
141
- # @return Array for valid properties with the reasons
142
- def list_invalid_properties
143
- invalid_properties = Array.new
144
- return invalid_properties
145
- end
146
-
147
- # Check to see if the all the properties in the model are valid
148
- # @return true if the model is valid
149
- def valid?
150
- return true
151
- end
152
-
153
- # Checks equality by comparing each attribute.
154
- # @param [Object] Object to be compared
155
- def ==(o)
156
- return true if self.equal?(o)
157
- self.class == o.class &&
158
- top_left_x == o.top_left_x &&
159
- top_left_y == o.top_left_y &&
160
- top_right_x == o.top_right_x &&
161
- top_right_y == o.top_right_y &&
162
- bottom_left_x == o.bottom_left_x &&
163
- bottom_left_y == o.bottom_left_y &&
164
- bottom_right_x == o.bottom_right_x &&
165
- bottom_right_y == o.bottom_right_y &&
166
- width == o.width &&
167
- height == o.height &&
168
- angle == o.angle
169
- end
170
-
171
- # @see the `==` method
172
- # @param [Object] Object to be compared
173
- def eql?(o)
174
- self == o
175
- end
176
-
177
- # Calculates hash code according to all attributes.
178
- # @return [Fixnum] Hash code
179
- def hash
180
- [top_left_x, top_left_y, top_right_x, top_right_y, bottom_left_x, bottom_left_y, bottom_right_x, bottom_right_y, width, height, angle].hash
181
- end
182
-
183
- # Builds the object from hash
184
- # @param [Hash] attributes Model attributes in the form of hash
185
- # @return [Object] Returns the model itself
186
- def build_from_hash(attributes)
187
- return nil unless attributes.is_a?(Hash)
188
- self.class.swagger_types.each_pair do |key, type|
189
- if type =~ /\AArray<(.*)>/i
190
- # check to ensure the input is an array given that the the attribute
191
- # is documented as an array but the input is not
192
- if attributes[self.class.attribute_map[key]].is_a?(Array)
193
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
194
- end
195
- elsif !attributes[self.class.attribute_map[key]].nil?
196
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
197
- end # or else data not found in attributes(hash), not an issue as the data can be optional
198
- end
199
-
200
- self
201
- end
202
-
203
- # Deserializes the data based on type
204
- # @param string type Data type
205
- # @param string value Value to be deserialized
206
- # @return [Object] Deserialized data
207
- def _deserialize(type, value)
208
- case type.to_sym
209
- when :DateTime
210
- DateTime.parse(value)
211
- when :Date
212
- Date.parse(value)
213
- when :String
214
- value.to_s
215
- when :Integer
216
- value.to_i
217
- when :Float
218
- value.to_f
219
- when :BOOLEAN
220
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
221
- true
222
- else
223
- false
224
- end
225
- when :Object
226
- # generic object (usually a Hash), return directly
227
- value
228
- when /\AArray<(?<inner_type>.+)>\z/
229
- inner_type = Regexp.last_match[:inner_type]
230
- value.map { |v| _deserialize(inner_type, v) }
231
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
232
- k_type = Regexp.last_match[:k_type]
233
- v_type = Regexp.last_match[:v_type]
234
- {}.tap do |hash|
235
- value.each do |k, v|
236
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
- end
238
- end
239
- else # model
240
- temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
241
- temp_model.build_from_hash(value)
242
- end
243
- end
244
-
245
- # Returns the string representation of the object
246
- # @return [String] String presentation of the object
247
- def to_s
248
- to_hash.to_s
249
- end
250
-
251
- # to_body is an alias to to_hash (backward compatibility)
252
- # @return [Hash] Returns the object in the form of hash
253
- def to_body
254
- to_hash
255
- end
256
-
257
- # Returns the object in the form of hash
258
- # @return [Hash] Returns the object in the form of hash
259
- def to_hash
260
- hash = {}
261
- self.class.attribute_map.each_pair do |attr, param|
262
- value = self.send(attr)
263
- next if value.nil?
264
- hash[param] = _to_hash(value)
265
- end
266
- hash
267
- end
268
-
269
- # Outputs non-array value in the form of hash
270
- # For object, use to_hash. Otherwise, just return the value
271
- # @param [Object] value Any valid value
272
- # @return [Hash] Returns the value in the form of hash
273
- def _to_hash(value)
274
- if value.is_a?(Array)
275
- value.compact.map{ |v| _to_hash(v) }
276
- elsif value.is_a?(Hash)
277
- {}.tap do |hash|
278
- value.each { |k, v| hash[k] = _to_hash(v) }
279
- end
280
- elsif value.respond_to? :to_hash
281
- value.to_hash
282
- else
283
- value
284
- end
285
- end
286
-
287
- end
288
-
289
- end