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,209 +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 color
17
- class ColorResult
18
- # Red (R) channel pixel value of this color
19
- attr_accessor :r
20
-
21
- # Green (G) channel pixel value of this color
22
- attr_accessor :g
23
-
24
- # Blue (B) channel pixel value of this color
25
- attr_accessor :b
26
-
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'r' => :'R',
32
- :'g' => :'G',
33
- :'b' => :'B'
34
- }
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.swagger_types
39
- {
40
- :'r' => :'Integer',
41
- :'g' => :'Integer',
42
- :'b' => :'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?(:'R')
55
- self.r = attributes[:'R']
56
- end
57
-
58
- if attributes.has_key?(:'G')
59
- self.g = attributes[:'G']
60
- end
61
-
62
- if attributes.has_key?(:'B')
63
- self.b = attributes[:'B']
64
- end
65
-
66
- end
67
-
68
- # Show invalid properties with the reasons. Usually used together with valid?
69
- # @return Array for valid properties with the reasons
70
- def list_invalid_properties
71
- invalid_properties = Array.new
72
- return invalid_properties
73
- end
74
-
75
- # Check to see if the all the properties in the model are valid
76
- # @return true if the model is valid
77
- def valid?
78
- return true
79
- end
80
-
81
- # Checks equality by comparing each attribute.
82
- # @param [Object] Object to be compared
83
- def ==(o)
84
- return true if self.equal?(o)
85
- self.class == o.class &&
86
- r == o.r &&
87
- g == o.g &&
88
- b == o.b
89
- end
90
-
91
- # @see the `==` method
92
- # @param [Object] Object to be compared
93
- def eql?(o)
94
- self == o
95
- end
96
-
97
- # Calculates hash code according to all attributes.
98
- # @return [Fixnum] Hash code
99
- def hash
100
- [r, g, b].hash
101
- end
102
-
103
- # Builds the object from hash
104
- # @param [Hash] attributes Model attributes in the form of hash
105
- # @return [Object] Returns the model itself
106
- def build_from_hash(attributes)
107
- return nil unless attributes.is_a?(Hash)
108
- self.class.swagger_types.each_pair do |key, type|
109
- if type =~ /\AArray<(.*)>/i
110
- # check to ensure the input is an array given that the the attribute
111
- # is documented as an array but the input is not
112
- if attributes[self.class.attribute_map[key]].is_a?(Array)
113
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
114
- end
115
- elsif !attributes[self.class.attribute_map[key]].nil?
116
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
- end # or else data not found in attributes(hash), not an issue as the data can be optional
118
- end
119
-
120
- self
121
- end
122
-
123
- # Deserializes the data based on type
124
- # @param string type Data type
125
- # @param string value Value to be deserialized
126
- # @return [Object] Deserialized data
127
- def _deserialize(type, value)
128
- case type.to_sym
129
- when :DateTime
130
- DateTime.parse(value)
131
- when :Date
132
- Date.parse(value)
133
- when :String
134
- value.to_s
135
- when :Integer
136
- value.to_i
137
- when :Float
138
- value.to_f
139
- when :BOOLEAN
140
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
- true
142
- else
143
- false
144
- end
145
- when :Object
146
- # generic object (usually a Hash), return directly
147
- value
148
- when /\AArray<(?<inner_type>.+)>\z/
149
- inner_type = Regexp.last_match[:inner_type]
150
- value.map { |v| _deserialize(inner_type, v) }
151
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
- k_type = Regexp.last_match[:k_type]
153
- v_type = Regexp.last_match[:v_type]
154
- {}.tap do |hash|
155
- value.each do |k, v|
156
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
- end
158
- end
159
- else # model
160
- temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
161
- temp_model.build_from_hash(value)
162
- end
163
- end
164
-
165
- # Returns the string representation of the object
166
- # @return [String] String presentation of the object
167
- def to_s
168
- to_hash.to_s
169
- end
170
-
171
- # to_body is an alias to to_hash (backward compatibility)
172
- # @return [Hash] Returns the object in the form of hash
173
- def to_body
174
- to_hash
175
- end
176
-
177
- # Returns the object in the form of hash
178
- # @return [Hash] Returns the object in the form of hash
179
- def to_hash
180
- hash = {}
181
- self.class.attribute_map.each_pair do |attr, param|
182
- value = self.send(attr)
183
- next if value.nil?
184
- hash[param] = _to_hash(value)
185
- end
186
- hash
187
- end
188
-
189
- # Outputs non-array value in the form of hash
190
- # For object, use to_hash. Otherwise, just return the value
191
- # @param [Object] value Any valid value
192
- # @return [Hash] Returns the value in the form of hash
193
- def _to_hash(value)
194
- if value.is_a?(Array)
195
- value.compact.map{ |v| _to_hash(v) }
196
- elsif value.is_a?(Hash)
197
- {}.tap do |hash|
198
- value.each { |k, v| hash[k] = _to_hash(v) }
199
- end
200
- elsif value.respond_to? :to_hash
201
- value.to_hash
202
- else
203
- value
204
- end
205
- end
206
-
207
- end
208
-
209
- end
@@ -1,249 +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
- # License plate found in the image
17
- class DetectedLicensePlate
18
- # Text from the license plate, highest-confidence result
19
- attr_accessor :license_plate_text_best_match
20
-
21
- # Alternate text from the license plate, based on second-highest-confidence result
22
- attr_accessor :license_plate_text_runner_up
23
-
24
- # X location of the left edge of the license plate, starting from the left edge of the photo (X = 0)
25
- attr_accessor :location_x
26
-
27
- # Y location of the top edge of the license plate, starting from the top edge of the photo (Y = 0)
28
- attr_accessor :location_y
29
-
30
- # Width of the license plate's location in pixels
31
- attr_accessor :width
32
-
33
- # Height of the license plate's location in pixels
34
- attr_accessor :height
35
-
36
- # Confidence score on a range of 0.0 - 1.0 of the accuracy of the detected license plate, with higher scores being better; values about 0.75 are high confidence
37
- attr_accessor :license_plate_recognition_confidence_level
38
-
39
-
40
- # Attribute mapping from ruby-style variable name to JSON key.
41
- def self.attribute_map
42
- {
43
- :'license_plate_text_best_match' => :'LicensePlateText_BestMatch',
44
- :'license_plate_text_runner_up' => :'LicensePlateText_RunnerUp',
45
- :'location_x' => :'LocationX',
46
- :'location_y' => :'LocationY',
47
- :'width' => :'Width',
48
- :'height' => :'Height',
49
- :'license_plate_recognition_confidence_level' => :'LicensePlateRecognitionConfidenceLevel'
50
- }
51
- end
52
-
53
- # Attribute type mapping.
54
- def self.swagger_types
55
- {
56
- :'license_plate_text_best_match' => :'String',
57
- :'license_plate_text_runner_up' => :'String',
58
- :'location_x' => :'Integer',
59
- :'location_y' => :'Integer',
60
- :'width' => :'Integer',
61
- :'height' => :'Integer',
62
- :'license_plate_recognition_confidence_level' => :'Float'
63
- }
64
- end
65
-
66
- # Initializes the object
67
- # @param [Hash] attributes Model attributes in the form of hash
68
- def initialize(attributes = {})
69
- return unless attributes.is_a?(Hash)
70
-
71
- # convert string to symbol for hash key
72
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
73
-
74
- if attributes.has_key?(:'LicensePlateText_BestMatch')
75
- self.license_plate_text_best_match = attributes[:'LicensePlateText_BestMatch']
76
- end
77
-
78
- if attributes.has_key?(:'LicensePlateText_RunnerUp')
79
- self.license_plate_text_runner_up = attributes[:'LicensePlateText_RunnerUp']
80
- end
81
-
82
- if attributes.has_key?(:'LocationX')
83
- self.location_x = attributes[:'LocationX']
84
- end
85
-
86
- if attributes.has_key?(:'LocationY')
87
- self.location_y = attributes[:'LocationY']
88
- end
89
-
90
- if attributes.has_key?(:'Width')
91
- self.width = attributes[:'Width']
92
- end
93
-
94
- if attributes.has_key?(:'Height')
95
- self.height = attributes[:'Height']
96
- end
97
-
98
- if attributes.has_key?(:'LicensePlateRecognitionConfidenceLevel')
99
- self.license_plate_recognition_confidence_level = attributes[:'LicensePlateRecognitionConfidenceLevel']
100
- end
101
-
102
- end
103
-
104
- # Show invalid properties with the reasons. Usually used together with valid?
105
- # @return Array for valid properties with the reasons
106
- def list_invalid_properties
107
- invalid_properties = Array.new
108
- return invalid_properties
109
- end
110
-
111
- # Check to see if the all the properties in the model are valid
112
- # @return true if the model is valid
113
- def valid?
114
- return true
115
- end
116
-
117
- # Checks equality by comparing each attribute.
118
- # @param [Object] Object to be compared
119
- def ==(o)
120
- return true if self.equal?(o)
121
- self.class == o.class &&
122
- license_plate_text_best_match == o.license_plate_text_best_match &&
123
- license_plate_text_runner_up == o.license_plate_text_runner_up &&
124
- location_x == o.location_x &&
125
- location_y == o.location_y &&
126
- width == o.width &&
127
- height == o.height &&
128
- license_plate_recognition_confidence_level == o.license_plate_recognition_confidence_level
129
- end
130
-
131
- # @see the `==` method
132
- # @param [Object] Object to be compared
133
- def eql?(o)
134
- self == o
135
- end
136
-
137
- # Calculates hash code according to all attributes.
138
- # @return [Fixnum] Hash code
139
- def hash
140
- [license_plate_text_best_match, license_plate_text_runner_up, location_x, location_y, width, height, license_plate_recognition_confidence_level].hash
141
- end
142
-
143
- # Builds the object from hash
144
- # @param [Hash] attributes Model attributes in the form of hash
145
- # @return [Object] Returns the model itself
146
- def build_from_hash(attributes)
147
- return nil unless attributes.is_a?(Hash)
148
- self.class.swagger_types.each_pair do |key, type|
149
- if type =~ /\AArray<(.*)>/i
150
- # check to ensure the input is an array given that the the attribute
151
- # is documented as an array but the input is not
152
- if attributes[self.class.attribute_map[key]].is_a?(Array)
153
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
154
- end
155
- elsif !attributes[self.class.attribute_map[key]].nil?
156
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
157
- end # or else data not found in attributes(hash), not an issue as the data can be optional
158
- end
159
-
160
- self
161
- end
162
-
163
- # Deserializes the data based on type
164
- # @param string type Data type
165
- # @param string value Value to be deserialized
166
- # @return [Object] Deserialized data
167
- def _deserialize(type, value)
168
- case type.to_sym
169
- when :DateTime
170
- DateTime.parse(value)
171
- when :Date
172
- Date.parse(value)
173
- when :String
174
- value.to_s
175
- when :Integer
176
- value.to_i
177
- when :Float
178
- value.to_f
179
- when :BOOLEAN
180
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
- true
182
- else
183
- false
184
- end
185
- when :Object
186
- # generic object (usually a Hash), return directly
187
- value
188
- when /\AArray<(?<inner_type>.+)>\z/
189
- inner_type = Regexp.last_match[:inner_type]
190
- value.map { |v| _deserialize(inner_type, v) }
191
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
- k_type = Regexp.last_match[:k_type]
193
- v_type = Regexp.last_match[:v_type]
194
- {}.tap do |hash|
195
- value.each do |k, v|
196
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
- end
198
- end
199
- else # model
200
- temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
201
- temp_model.build_from_hash(value)
202
- end
203
- end
204
-
205
- # Returns the string representation of the object
206
- # @return [String] String presentation of the object
207
- def to_s
208
- to_hash.to_s
209
- end
210
-
211
- # to_body is an alias to to_hash (backward compatibility)
212
- # @return [Hash] Returns the object in the form of hash
213
- def to_body
214
- to_hash
215
- end
216
-
217
- # Returns the object in the form of hash
218
- # @return [Hash] Returns the object in the form of hash
219
- def to_hash
220
- hash = {}
221
- self.class.attribute_map.each_pair do |attr, param|
222
- value = self.send(attr)
223
- next if value.nil?
224
- hash[param] = _to_hash(value)
225
- end
226
- hash
227
- end
228
-
229
- # Outputs non-array value in the form of hash
230
- # For object, use to_hash. Otherwise, just return the value
231
- # @param [Object] value Any valid value
232
- # @return [Hash] Returns the value in the form of hash
233
- def _to_hash(value)
234
- if value.is_a?(Array)
235
- value.compact.map{ |v| _to_hash(v) }
236
- elsif value.is_a?(Hash)
237
- {}.tap do |hash|
238
- value.each { |k, v| hash[k] = _to_hash(v) }
239
- end
240
- elsif value.respond_to? :to_hash
241
- value.to_hash
242
- else
243
- value
244
- end
245
- end
246
-
247
- end
248
-
249
- end