avm_client 1.0.0

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 (50) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +104 -0
  5. data/Rakefile +10 -0
  6. data/avm_client.gemspec +45 -0
  7. data/docs/AdditionalFeatures.md +53 -0
  8. data/docs/BuiltForm.md +16 -0
  9. data/docs/DefaultApi.md +67 -0
  10. data/docs/EnergyEfficiency.md +16 -0
  11. data/docs/EnergyRating.md +16 -0
  12. data/docs/FloorLevel.md +16 -0
  13. data/docs/LeaseholdOrFreehold.md +16 -0
  14. data/docs/NewOrResale.md +16 -0
  15. data/docs/Problem.md +25 -0
  16. data/docs/PropertyFeatures.md +19 -0
  17. data/docs/PropertyType.md +16 -0
  18. data/docs/RequiredFeatures.md +27 -0
  19. data/docs/RoofInsulation.md +16 -0
  20. data/docs/RoofType.md +16 -0
  21. data/docs/Valuation.md +25 -0
  22. data/docs/ValuationPriceDistribution.md +21 -0
  23. data/docs/WallInsulation.md +16 -0
  24. data/docs/WallType.md +16 -0
  25. data/docs/WindowGlazingType.md +16 -0
  26. data/lib/avm_client/api/default_api.rb +146 -0
  27. data/lib/avm_client/avm_client.rb +386 -0
  28. data/lib/avm_client/avm_error.rb +57 -0
  29. data/lib/avm_client/configuration.rb +248 -0
  30. data/lib/avm_client/models/additional_features.rb +373 -0
  31. data/lib/avm_client/models/built_form.rb +40 -0
  32. data/lib/avm_client/models/energy_efficiency.rb +39 -0
  33. data/lib/avm_client/models/energy_rating.rb +42 -0
  34. data/lib/avm_client/models/floor_level.rb +59 -0
  35. data/lib/avm_client/models/leasehold_or_freehold.rb +36 -0
  36. data/lib/avm_client/models/new_or_resale.rb +36 -0
  37. data/lib/avm_client/models/problem.rb +264 -0
  38. data/lib/avm_client/models/property_features.rb +210 -0
  39. data/lib/avm_client/models/property_type.rb +38 -0
  40. data/lib/avm_client/models/required_features.rb +329 -0
  41. data/lib/avm_client/models/roof_insulation.rb +39 -0
  42. data/lib/avm_client/models/roof_type.rb +38 -0
  43. data/lib/avm_client/models/valuation.rb +239 -0
  44. data/lib/avm_client/models/valuation_price_distribution.rb +217 -0
  45. data/lib/avm_client/models/wall_insulation.rb +38 -0
  46. data/lib/avm_client/models/wall_type.rb +42 -0
  47. data/lib/avm_client/models/window_glazing_type.rb +40 -0
  48. data/lib/avm_client/version.rb +15 -0
  49. data/lib/avm_client.rb +58 -0
  50. metadata +272 -0
@@ -0,0 +1,42 @@
1
+ =begin
2
+ #AVM
3
+
4
+ #This is api for AVM (automated valuation machine)
5
+
6
+ The version of the AvmClient document: 1.0.0
7
+ Contact: info@enbisys.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module AvmClient
16
+ class EnergyRating
17
+ A = "A".freeze
18
+ B = "B".freeze
19
+ C = "C".freeze
20
+ D = "D".freeze
21
+ E = "E".freeze
22
+ F = "F".freeze
23
+ G = "G".freeze
24
+ I = "I".freeze
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ constantValues = EnergyRating.constants.select { |c| EnergyRating::const_get(c) == value }
38
+ raise "Invalid ENUM value #{value} for class #EnergyRating" if constantValues.empty?
39
+ value
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,59 @@
1
+ =begin
2
+ #AVM
3
+
4
+ #This is api for AVM (automated valuation machine)
5
+
6
+ The version of the AvmClient document: 1.0.0
7
+ Contact: info@enbisys.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module AvmClient
16
+ class FloorLevel
17
+ BASEMENT = "basement".freeze
18
+ GROUND = "ground".freeze
19
+ MIDDLE = "middle".freeze
20
+ TOP = "top".freeze
21
+ FLOOR_1 = "floor_1".freeze
22
+ FLOOR_2 = "floor_2".freeze
23
+ FLOOR_3 = "floor_3".freeze
24
+ FLOOR_4 = "floor_4".freeze
25
+ FLOOR_5 = "floor_5".freeze
26
+ FLOOR_6 = "floor_6".freeze
27
+ FLOOR_7 = "floor_7".freeze
28
+ FLOOR_8 = "floor_8".freeze
29
+ FLOOR_9 = "floor_9".freeze
30
+ FLOOR_10 = "floor_10".freeze
31
+ FLOOR_11 = "floor_11".freeze
32
+ FLOOR_12 = "floor_12".freeze
33
+ FLOOR_13 = "floor_13".freeze
34
+ FLOOR_14 = "floor_14".freeze
35
+ FLOOR_15 = "floor_15".freeze
36
+ FLOOR_16 = "floor_16".freeze
37
+ FLOOR_17 = "floor_17".freeze
38
+ FLOOR_18 = "floor_18".freeze
39
+ FLOOR_19 = "floor_19".freeze
40
+ FLOOR_20 = "floor_20".freeze
41
+ FLOOR_21_OR_ABOVE = "floor_21_or_above".freeze
42
+
43
+ # Builds the enum from string
44
+ # @param [String] The enum value in the form of the string
45
+ # @return [String] The enum value
46
+ def self.build_from_hash(value)
47
+ new.build_from_hash(value)
48
+ end
49
+
50
+ # Builds the enum from string
51
+ # @param [String] The enum value in the form of the string
52
+ # @return [String] The enum value
53
+ def build_from_hash(value)
54
+ constantValues = FloorLevel.constants.select { |c| FloorLevel::const_get(c) == value }
55
+ raise "Invalid ENUM value #{value} for class #FloorLevel" if constantValues.empty?
56
+ value
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #AVM
3
+
4
+ #This is api for AVM (automated valuation machine)
5
+
6
+ The version of the AvmClient document: 1.0.0
7
+ Contact: info@enbisys.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module AvmClient
16
+ class LeaseholdOrFreehold
17
+ FREEHOLD = "freehold".freeze
18
+ LEASEHOLD = "leasehold".freeze
19
+
20
+ # Builds the enum from string
21
+ # @param [String] The enum value in the form of the string
22
+ # @return [String] The enum value
23
+ def self.build_from_hash(value)
24
+ new.build_from_hash(value)
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def build_from_hash(value)
31
+ constantValues = LeaseholdOrFreehold.constants.select { |c| LeaseholdOrFreehold::const_get(c) == value }
32
+ raise "Invalid ENUM value #{value} for class #LeaseholdOrFreehold" if constantValues.empty?
33
+ value
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #AVM
3
+
4
+ #This is api for AVM (automated valuation machine)
5
+
6
+ The version of the AvmClient document: 1.0.0
7
+ Contact: info@enbisys.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module AvmClient
16
+ class NewOrResale
17
+ NEW = "new".freeze
18
+ RESALE = "resale".freeze
19
+
20
+ # Builds the enum from string
21
+ # @param [String] The enum value in the form of the string
22
+ # @return [String] The enum value
23
+ def self.build_from_hash(value)
24
+ new.build_from_hash(value)
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def build_from_hash(value)
31
+ constantValues = NewOrResale.constants.select { |c| NewOrResale::const_get(c) == value }
32
+ raise "Invalid ENUM value #{value} for class #NewOrResale" if constantValues.empty?
33
+ value
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,264 @@
1
+ =begin
2
+ #AVM
3
+
4
+ #This is api for AVM (automated valuation machine)
5
+
6
+ The version of the AvmClient document: 1.0.0
7
+ Contact: info@enbisys.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module AvmClient
16
+ # A Problem Details object (RFC 7807)
17
+ class Problem
18
+ # A relative URI reference that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g. using HTML).
19
+ attr_accessor :type
20
+
21
+ # A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized)
22
+ attr_accessor :title
23
+
24
+ # The HTTP status code generated by the origin server for this occurrence of the problem.
25
+ attr_accessor :status
26
+
27
+ # A human-readable explanation specific to this occurrence of the problem
28
+ attr_accessor :detail
29
+
30
+ # A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
31
+ attr_accessor :instance
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'type' => :'type',
37
+ :'title' => :'title',
38
+ :'status' => :'status',
39
+ :'detail' => :'detail',
40
+ :'instance' => :'instance'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.avm_types
46
+ {
47
+ :'type' => :'String',
48
+ :'title' => :'String',
49
+ :'status' => :'Integer',
50
+ :'detail' => :'String',
51
+ :'instance' => :'String'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AvmClient::Problem` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AvmClient::Problem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'type')
71
+ self.type = attributes[:'type']
72
+ else
73
+ self.type = 'about:blank'
74
+ end
75
+
76
+ if attributes.key?(:'title')
77
+ self.title = attributes[:'title']
78
+ end
79
+
80
+ if attributes.key?(:'status')
81
+ self.status = attributes[:'status']
82
+ end
83
+
84
+ if attributes.key?(:'detail')
85
+ self.detail = attributes[:'detail']
86
+ end
87
+
88
+ if attributes.key?(:'instance')
89
+ self.instance = attributes[:'instance']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ if !@status.nil? && @status >= 600
98
+ invalid_properties.push('invalid value for "status", must be smaller than 600.')
99
+ end
100
+
101
+ if !@status.nil? && @status < 400
102
+ invalid_properties.push('invalid value for "status", must be greater than or equal to 400.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ return false if !@status.nil? && @status >= 600
112
+ return false if !@status.nil? && @status < 400
113
+ true
114
+ end
115
+
116
+ # Custom attribute writer method with validation
117
+ # @param [Object] status Value to be assigned
118
+ def status=(status)
119
+ if !status.nil? && status >= 600
120
+ fail ArgumentError, 'invalid value for "status", must be smaller than 600.'
121
+ end
122
+
123
+ if !status.nil? && status < 400
124
+ fail ArgumentError, 'invalid value for "status", must be greater than or equal to 400.'
125
+ end
126
+
127
+ @status = status
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ type == o.type &&
136
+ title == o.title &&
137
+ status == o.status &&
138
+ detail == o.detail &&
139
+ instance == o.instance
140
+ end
141
+
142
+ # @see the `==` method
143
+ # @param [Object] Object to be compared
144
+ def eql?(o)
145
+ self == o
146
+ end
147
+
148
+ # Calculates hash code according to all attributes.
149
+ # @return [Integer] Hash code
150
+ def hash
151
+ [type, title, status, detail, instance].hash
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def self.build_from_hash(attributes)
158
+ new.build_from_hash(attributes)
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ self.class.avm_types.each_pair do |key, type|
167
+ if type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
171
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
172
+ end
173
+ elsif !attributes[self.class.attribute_map[key]].nil?
174
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
175
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
176
+ end
177
+
178
+ self
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :DateTime
188
+ DateTime.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :Boolean
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ AvmClient.const_get(type).build_from_hash(value)
219
+ end
220
+ end
221
+
222
+ # Returns the string representation of the object
223
+ # @return [String] String presentation of the object
224
+ def to_s
225
+ to_hash.to_s
226
+ end
227
+
228
+ # to_body is an alias to to_hash (backward compatibility)
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_body
231
+ to_hash
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = self.send(attr)
240
+ next if value.nil?
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ # Outputs non-array value in the form of hash
247
+ # For object, use to_hash. Otherwise, just return the value
248
+ # @param [Object] value Any valid value
249
+ # @return [Hash] Returns the value in the form of hash
250
+ def _to_hash(value)
251
+ if value.is_a?(Array)
252
+ value.compact.map { |v| _to_hash(v) }
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.each { |k, v| hash[k] = _to_hash(v) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash
259
+ else
260
+ value
261
+ end
262
+ end
263
+ end
264
+ end
@@ -0,0 +1,210 @@
1
+ =begin
2
+ #AVM
3
+
4
+ #This is api for AVM (automated valuation machine)
5
+
6
+ The version of the AvmClient document: 1.0.0
7
+ Contact: info@enbisys.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module AvmClient
16
+ class PropertyFeatures
17
+ attr_accessor :required_features
18
+
19
+ attr_accessor :additional_features
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'required_features' => :'requiredFeatures',
25
+ :'additional_features' => :'additionalFeatures'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.avm_types
31
+ {
32
+ :'required_features' => :'RequiredFeatures',
33
+ :'additional_features' => :'AdditionalFeatures'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ if (!attributes.is_a?(Hash))
41
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AvmClient::PropertyFeatures` initialize method"
42
+ end
43
+
44
+ # check to see if the attribute exists and convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h|
46
+ if (!self.class.attribute_map.key?(k.to_sym))
47
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AvmClient::PropertyFeatures`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
48
+ end
49
+ h[k.to_sym] = v
50
+ }
51
+
52
+ if attributes.key?(:'required_features')
53
+ self.required_features = attributes[:'required_features']
54
+ end
55
+
56
+ if attributes.key?(:'additional_features')
57
+ self.additional_features = attributes[:'additional_features']
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ if @required_features.nil?
66
+ invalid_properties.push('invalid value for "required_features", required_features cannot be nil.')
67
+ end
68
+
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ return false if @required_features.nil?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ required_features == o.required_features &&
85
+ additional_features == o.additional_features
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(o)
91
+ self == o
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Integer] Hash code
96
+ def hash
97
+ [required_features, additional_features].hash
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def self.build_from_hash(attributes)
104
+ new.build_from_hash(attributes)
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ self.class.avm_types.each_pair do |key, type|
113
+ if type =~ /\AArray<(.*)>/i
114
+ # check to ensure the input is an array given that the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
118
+ end
119
+ elsif !attributes[self.class.attribute_map[key]].nil?
120
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :DateTime
134
+ DateTime.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :Boolean
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ AvmClient.const_get(type).build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.compact.map { |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to? :to_hash
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+ end
210
+ end
@@ -0,0 +1,38 @@
1
+ =begin
2
+ #AVM
3
+
4
+ #This is api for AVM (automated valuation machine)
5
+
6
+ The version of the AvmClient document: 1.0.0
7
+ Contact: info@enbisys.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module AvmClient
16
+ class PropertyType
17
+ FLAT = "flat".freeze
18
+ SEMI_DETACHED_HOUSE = "semi_detached_house".freeze
19
+ DETACHED_HOUSE = "detached_house".freeze
20
+ TERRACED_HOUSE = "terraced_house".freeze
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def self.build_from_hash(value)
26
+ new.build_from_hash(value)
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ constantValues = PropertyType.constants.select { |c| PropertyType::const_get(c) == value }
34
+ raise "Invalid ENUM value #{value} for class #PropertyType" if constantValues.empty?
35
+ value
36
+ end
37
+ end
38
+ end