cloudmersive-image-recognition-api-client 1.4.6 → 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 (144) hide show
  1. checksums.yaml +4 -4
  2. metadata +3 -145
  3. data/Gemfile +0 -7
  4. data/README.md +0 -184
  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 -396
  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 -704
  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/ImageMetadata.md +0 -17
  36. data/docs/ImageMetadataExifValue.md +0 -10
  37. data/docs/InfoApi.md +0 -118
  38. data/docs/NsfwApi.md +0 -63
  39. data/docs/NsfwResult.md +0 -10
  40. data/docs/ObjectDetectionResult.md +0 -10
  41. data/docs/PersonWithAge.md +0 -11
  42. data/docs/PersonWithGender.md +0 -10
  43. data/docs/PolygonPoint.md +0 -9
  44. data/docs/RecognitionOutcome.md +0 -9
  45. data/docs/RecognizeApi.md +0 -455
  46. data/docs/ResizeApi.md +0 -130
  47. data/docs/TextDetectionResult.md +0 -10
  48. data/docs/TextItem.md +0 -11
  49. data/docs/VehicleLicensePlateDetectionResult.md +0 -10
  50. data/git_push.sh +0 -55
  51. data/lib/cloudmersive-image-recognition-api-client.rb +0 -82
  52. data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +0 -85
  53. data/lib/cloudmersive-image-recognition-api-client/api/convert_api.rb +0 -421
  54. data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +0 -765
  55. data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +0 -422
  56. data/lib/cloudmersive-image-recognition-api-client/api/filter_api.rb +0 -533
  57. data/lib/cloudmersive-image-recognition-api-client/api/info_api.rb +0 -135
  58. data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +0 -79
  59. data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +0 -481
  60. data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +0 -159
  61. data/lib/cloudmersive-image-recognition-api-client/api_client.rb +0 -389
  62. data/lib/cloudmersive-image-recognition-api-client/api_error.rb +0 -38
  63. data/lib/cloudmersive-image-recognition-api-client/configuration.rb +0 -209
  64. data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +0 -211
  65. data/lib/cloudmersive-image-recognition-api-client/models/color_result.rb +0 -209
  66. data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +0 -249
  67. data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +0 -239
  68. data/lib/cloudmersive-image-recognition-api-client/models/dominant_color_result.rb +0 -201
  69. data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_instance.rb +0 -221
  70. data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_request.rb +0 -227
  71. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +0 -249
  72. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +0 -227
  73. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +0 -259
  74. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +0 -227
  75. data/lib/cloudmersive-image-recognition-api-client/models/face.rb +0 -219
  76. data/lib/cloudmersive-image-recognition-api-client/models/face_compare_response.rb +0 -221
  77. data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +0 -221
  78. data/lib/cloudmersive-image-recognition-api-client/models/face_locate_with_landmarks_response.rb +0 -221
  79. data/lib/cloudmersive-image-recognition-api-client/models/face_match.rb +0 -239
  80. data/lib/cloudmersive-image-recognition-api-client/models/face_point.rb +0 -199
  81. data/lib/cloudmersive-image-recognition-api-client/models/face_with_landmarks.rb +0 -327
  82. data/lib/cloudmersive-image-recognition-api-client/models/find_symbol_result.rb +0 -239
  83. data/lib/cloudmersive-image-recognition-api-client/models/fine_text_detection_result.rb +0 -211
  84. data/lib/cloudmersive-image-recognition-api-client/models/fine_text_item.rb +0 -289
  85. data/lib/cloudmersive-image-recognition-api-client/models/gender_detection_result.rb +0 -211
  86. data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +0 -219
  87. data/lib/cloudmersive-image-recognition-api-client/models/image_metadata.rb +0 -281
  88. data/lib/cloudmersive-image-recognition-api-client/models/image_metadata_exif_value.rb +0 -209
  89. data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +0 -209
  90. data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +0 -211
  91. data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +0 -218
  92. data/lib/cloudmersive-image-recognition-api-client/models/person_with_gender.rb +0 -209
  93. data/lib/cloudmersive-image-recognition-api-client/models/polygon_point.rb +0 -199
  94. data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +0 -199
  95. data/lib/cloudmersive-image-recognition-api-client/models/text_detection_result.rb +0 -211
  96. data/lib/cloudmersive-image-recognition-api-client/models/text_item.rb +0 -219
  97. data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +0 -211
  98. data/lib/cloudmersive-image-recognition-api-client/version.rb +0 -15
  99. data/spec/api/artistic_api_spec.rb +0 -48
  100. data/spec/api/convert_api_spec.rb +0 -120
  101. data/spec/api/edit_api_spec.rb +0 -191
  102. data/spec/api/face_api_spec.rb +0 -120
  103. data/spec/api/filter_api_spec.rb +0 -141
  104. data/spec/api/info_api_spec.rb +0 -59
  105. data/spec/api/nsfw_api_spec.rb +0 -47
  106. data/spec/api/recognize_api_spec.rb +0 -133
  107. data/spec/api/resize_api_spec.rb +0 -63
  108. data/spec/api_client_spec.rb +0 -226
  109. data/spec/configuration_spec.rb +0 -42
  110. data/spec/models/age_detection_result_spec.rb +0 -54
  111. data/spec/models/color_result_spec.rb +0 -54
  112. data/spec/models/detected_license_plate_spec.rb +0 -78
  113. data/spec/models/detected_object_spec.rb +0 -72
  114. data/spec/models/dominant_color_result_spec.rb +0 -48
  115. data/spec/models/draw_polygon_instance_spec.rb +0 -60
  116. data/spec/models/draw_polygon_request_spec.rb +0 -54
  117. data/spec/models/draw_rectangle_instance_spec.rb +0 -78
  118. data/spec/models/draw_rectangle_request_spec.rb +0 -54
  119. data/spec/models/draw_text_instance_spec.rb +0 -84
  120. data/spec/models/draw_text_request_spec.rb +0 -54
  121. data/spec/models/face_compare_response_spec.rb +0 -60
  122. data/spec/models/face_locate_response_spec.rb +0 -60
  123. data/spec/models/face_locate_with_landmarks_response_spec.rb +0 -60
  124. data/spec/models/face_match_spec.rb +0 -72
  125. data/spec/models/face_point_spec.rb +0 -48
  126. data/spec/models/face_spec.rb +0 -60
  127. data/spec/models/face_with_landmarks_spec.rb +0 -114
  128. data/spec/models/find_symbol_result_spec.rb +0 -72
  129. data/spec/models/fine_text_detection_result_spec.rb +0 -54
  130. data/spec/models/fine_text_item_spec.rb +0 -102
  131. data/spec/models/gender_detection_result_spec.rb +0 -54
  132. data/spec/models/image_description_response_spec.rb +0 -60
  133. data/spec/models/image_metadata_exif_value_spec.rb +0 -54
  134. data/spec/models/image_metadata_spec.rb +0 -96
  135. data/spec/models/nsfw_result_spec.rb +0 -54
  136. data/spec/models/object_detection_result_spec.rb +0 -54
  137. data/spec/models/person_with_age_spec.rb +0 -60
  138. data/spec/models/person_with_gender_spec.rb +0 -54
  139. data/spec/models/polygon_point_spec.rb +0 -48
  140. data/spec/models/recognition_outcome_spec.rb +0 -48
  141. data/spec/models/text_detection_result_spec.rb +0 -54
  142. data/spec/models/text_item_spec.rb +0 -60
  143. data/spec/models/vehicle_license_plate_detection_result_spec.rb +0 -54
  144. data/spec/spec_helper.rb +0 -111
@@ -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 from classifying the Gender of people in an image
17
- class GenderDetectionResult
18
- # True if the operation was successful, false otherwise
19
- attr_accessor :successful
20
-
21
- # People in the image annotated with gender information
22
- attr_accessor :person_with_gender
23
-
24
- # Number of people identified in the image with a gender
25
- attr_accessor :people_identified
26
-
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'successful' => :'Successful',
32
- :'person_with_gender' => :'PersonWithGender',
33
- :'people_identified' => :'PeopleIdentified'
34
- }
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.swagger_types
39
- {
40
- :'successful' => :'BOOLEAN',
41
- :'person_with_gender' => :'Array<PersonWithGender>',
42
- :'people_identified' => :'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?(:'PersonWithGender')
59
- if (value = attributes[:'PersonWithGender']).is_a?(Array)
60
- self.person_with_gender = value
61
- end
62
- end
63
-
64
- if attributes.has_key?(:'PeopleIdentified')
65
- self.people_identified = attributes[:'PeopleIdentified']
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
- person_with_gender == o.person_with_gender &&
90
- people_identified == o.people_identified
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, person_with_gender, people_identified].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,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
- # Result of recognizing an image
17
- class ImageDescriptionResponse
18
- # Was the image processed successfully?
19
- attr_accessor :successful
20
-
21
- # Is the resulting best outcome recognition a high confidence outcome?
22
- attr_accessor :highconfidence
23
-
24
- # The best Machine Learning outcome
25
- attr_accessor :best_outcome
26
-
27
- # Best backup (\"runner up\") Machine Learning outcome
28
- attr_accessor :runner_up_outcome
29
-
30
-
31
- # Attribute mapping from ruby-style variable name to JSON key.
32
- def self.attribute_map
33
- {
34
- :'successful' => :'Successful',
35
- :'highconfidence' => :'Highconfidence',
36
- :'best_outcome' => :'BestOutcome',
37
- :'runner_up_outcome' => :'RunnerUpOutcome'
38
- }
39
- end
40
-
41
- # Attribute type mapping.
42
- def self.swagger_types
43
- {
44
- :'successful' => :'BOOLEAN',
45
- :'highconfidence' => :'BOOLEAN',
46
- :'best_outcome' => :'RecognitionOutcome',
47
- :'runner_up_outcome' => :'RecognitionOutcome'
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?(:'Highconfidence')
64
- self.highconfidence = attributes[:'Highconfidence']
65
- end
66
-
67
- if attributes.has_key?(:'BestOutcome')
68
- self.best_outcome = attributes[:'BestOutcome']
69
- end
70
-
71
- if attributes.has_key?(:'RunnerUpOutcome')
72
- self.runner_up_outcome = attributes[:'RunnerUpOutcome']
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
- successful == o.successful &&
96
- highconfidence == o.highconfidence &&
97
- best_outcome == o.best_outcome &&
98
- runner_up_outcome == o.runner_up_outcome
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
- [successful, highconfidence, best_outcome, runner_up_outcome].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,281 +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
- # Metadata from an image
17
- class ImageMetadata
18
- # True if the operation was successful, false otherwise
19
- attr_accessor :successful
20
-
21
- # True if the input image is a valid image file, false otherwise
22
- attr_accessor :is_valid_image
23
-
24
- # File format of the image
25
- attr_accessor :file_format
26
-
27
- # Width of the image in pixels
28
- attr_accessor :width
29
-
30
- # Height of the image in pixels
31
- attr_accessor :height
32
-
33
- # Bits per pixel
34
- attr_accessor :bit_depth
35
-
36
- # True if the image has transaprency in the form of an alpha channel, false otherwise
37
- attr_accessor :has_transparency
38
-
39
- # Color space of the image
40
- attr_accessor :color_space
41
-
42
- # Name of the EXIF profile used
43
- attr_accessor :exif_profile_name
44
-
45
- # EXIF tags and values embedded in the image
46
- attr_accessor :exif_values
47
-
48
-
49
- # Attribute mapping from ruby-style variable name to JSON key.
50
- def self.attribute_map
51
- {
52
- :'successful' => :'Successful',
53
- :'is_valid_image' => :'IsValidImage',
54
- :'file_format' => :'FileFormat',
55
- :'width' => :'Width',
56
- :'height' => :'Height',
57
- :'bit_depth' => :'BitDepth',
58
- :'has_transparency' => :'HasTransparency',
59
- :'color_space' => :'ColorSpace',
60
- :'exif_profile_name' => :'ExifProfileName',
61
- :'exif_values' => :'ExifValues'
62
- }
63
- end
64
-
65
- # Attribute type mapping.
66
- def self.swagger_types
67
- {
68
- :'successful' => :'BOOLEAN',
69
- :'is_valid_image' => :'BOOLEAN',
70
- :'file_format' => :'String',
71
- :'width' => :'Integer',
72
- :'height' => :'Integer',
73
- :'bit_depth' => :'Integer',
74
- :'has_transparency' => :'BOOLEAN',
75
- :'color_space' => :'String',
76
- :'exif_profile_name' => :'String',
77
- :'exif_values' => :'Array<ImageMetadataExifValue>'
78
- }
79
- end
80
-
81
- # Initializes the object
82
- # @param [Hash] attributes Model attributes in the form of hash
83
- def initialize(attributes = {})
84
- return unless attributes.is_a?(Hash)
85
-
86
- # convert string to symbol for hash key
87
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
88
-
89
- if attributes.has_key?(:'Successful')
90
- self.successful = attributes[:'Successful']
91
- end
92
-
93
- if attributes.has_key?(:'IsValidImage')
94
- self.is_valid_image = attributes[:'IsValidImage']
95
- end
96
-
97
- if attributes.has_key?(:'FileFormat')
98
- self.file_format = attributes[:'FileFormat']
99
- end
100
-
101
- if attributes.has_key?(:'Width')
102
- self.width = attributes[:'Width']
103
- end
104
-
105
- if attributes.has_key?(:'Height')
106
- self.height = attributes[:'Height']
107
- end
108
-
109
- if attributes.has_key?(:'BitDepth')
110
- self.bit_depth = attributes[:'BitDepth']
111
- end
112
-
113
- if attributes.has_key?(:'HasTransparency')
114
- self.has_transparency = attributes[:'HasTransparency']
115
- end
116
-
117
- if attributes.has_key?(:'ColorSpace')
118
- self.color_space = attributes[:'ColorSpace']
119
- end
120
-
121
- if attributes.has_key?(:'ExifProfileName')
122
- self.exif_profile_name = attributes[:'ExifProfileName']
123
- end
124
-
125
- if attributes.has_key?(:'ExifValues')
126
- if (value = attributes[:'ExifValues']).is_a?(Array)
127
- self.exif_values = value
128
- end
129
- end
130
-
131
- end
132
-
133
- # Show invalid properties with the reasons. Usually used together with valid?
134
- # @return Array for valid properties with the reasons
135
- def list_invalid_properties
136
- invalid_properties = Array.new
137
- return invalid_properties
138
- end
139
-
140
- # Check to see if the all the properties in the model are valid
141
- # @return true if the model is valid
142
- def valid?
143
- return true
144
- end
145
-
146
- # Checks equality by comparing each attribute.
147
- # @param [Object] Object to be compared
148
- def ==(o)
149
- return true if self.equal?(o)
150
- self.class == o.class &&
151
- successful == o.successful &&
152
- is_valid_image == o.is_valid_image &&
153
- file_format == o.file_format &&
154
- width == o.width &&
155
- height == o.height &&
156
- bit_depth == o.bit_depth &&
157
- has_transparency == o.has_transparency &&
158
- color_space == o.color_space &&
159
- exif_profile_name == o.exif_profile_name &&
160
- exif_values == o.exif_values
161
- end
162
-
163
- # @see the `==` method
164
- # @param [Object] Object to be compared
165
- def eql?(o)
166
- self == o
167
- end
168
-
169
- # Calculates hash code according to all attributes.
170
- # @return [Fixnum] Hash code
171
- def hash
172
- [successful, is_valid_image, file_format, width, height, bit_depth, has_transparency, color_space, exif_profile_name, exif_values].hash
173
- end
174
-
175
- # Builds the object from hash
176
- # @param [Hash] attributes Model attributes in the form of hash
177
- # @return [Object] Returns the model itself
178
- def build_from_hash(attributes)
179
- return nil unless attributes.is_a?(Hash)
180
- self.class.swagger_types.each_pair do |key, type|
181
- if type =~ /\AArray<(.*)>/i
182
- # check to ensure the input is an array given that the the attribute
183
- # is documented as an array but the input is not
184
- if attributes[self.class.attribute_map[key]].is_a?(Array)
185
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
186
- end
187
- elsif !attributes[self.class.attribute_map[key]].nil?
188
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
189
- end # or else data not found in attributes(hash), not an issue as the data can be optional
190
- end
191
-
192
- self
193
- end
194
-
195
- # Deserializes the data based on type
196
- # @param string type Data type
197
- # @param string value Value to be deserialized
198
- # @return [Object] Deserialized data
199
- def _deserialize(type, value)
200
- case type.to_sym
201
- when :DateTime
202
- DateTime.parse(value)
203
- when :Date
204
- Date.parse(value)
205
- when :String
206
- value.to_s
207
- when :Integer
208
- value.to_i
209
- when :Float
210
- value.to_f
211
- when :BOOLEAN
212
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
213
- true
214
- else
215
- false
216
- end
217
- when :Object
218
- # generic object (usually a Hash), return directly
219
- value
220
- when /\AArray<(?<inner_type>.+)>\z/
221
- inner_type = Regexp.last_match[:inner_type]
222
- value.map { |v| _deserialize(inner_type, v) }
223
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
224
- k_type = Regexp.last_match[:k_type]
225
- v_type = Regexp.last_match[:v_type]
226
- {}.tap do |hash|
227
- value.each do |k, v|
228
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
229
- end
230
- end
231
- else # model
232
- temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
233
- temp_model.build_from_hash(value)
234
- end
235
- end
236
-
237
- # Returns the string representation of the object
238
- # @return [String] String presentation of the object
239
- def to_s
240
- to_hash.to_s
241
- end
242
-
243
- # to_body is an alias to to_hash (backward compatibility)
244
- # @return [Hash] Returns the object in the form of hash
245
- def to_body
246
- to_hash
247
- end
248
-
249
- # Returns the object in the form of hash
250
- # @return [Hash] Returns the object in the form of hash
251
- def to_hash
252
- hash = {}
253
- self.class.attribute_map.each_pair do |attr, param|
254
- value = self.send(attr)
255
- next if value.nil?
256
- hash[param] = _to_hash(value)
257
- end
258
- hash
259
- end
260
-
261
- # Outputs non-array value in the form of hash
262
- # For object, use to_hash. Otherwise, just return the value
263
- # @param [Object] value Any valid value
264
- # @return [Hash] Returns the value in the form of hash
265
- def _to_hash(value)
266
- if value.is_a?(Array)
267
- value.compact.map{ |v| _to_hash(v) }
268
- elsif value.is_a?(Hash)
269
- {}.tap do |hash|
270
- value.each { |k, v| hash[k] = _to_hash(v) }
271
- end
272
- elsif value.respond_to? :to_hash
273
- value.to_hash
274
- else
275
- value
276
- end
277
- end
278
-
279
- end
280
-
281
- end