simplyrets 2.0.0 → 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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +6 -3
  3. data/Makefile +1 -2
  4. data/README.org +2 -0
  5. data/lib/simplyrets.rb +12 -1
  6. data/lib/simplyrets/api/default_api.rb +132 -128
  7. data/lib/simplyrets/api_client.rb +48 -9
  8. data/lib/simplyrets/api_client.rb.orig +373 -0
  9. data/lib/simplyrets/api_error.rb +12 -1
  10. data/lib/simplyrets/configuration.rb +23 -0
  11. data/lib/simplyrets/models/agent.rb +61 -27
  12. data/lib/simplyrets/models/broker.rb +57 -20
  13. data/lib/simplyrets/models/contact_information.rb +62 -27
  14. data/lib/simplyrets/models/error.rb +59 -23
  15. data/lib/simplyrets/models/geographic_data.rb +61 -28
  16. data/lib/simplyrets/models/listing.rb +94 -70
  17. data/lib/simplyrets/models/mls_information.rb +95 -37
  18. data/lib/simplyrets/models/office.rb +62 -28
  19. data/lib/simplyrets/models/open_house.rb +66 -36
  20. data/lib/simplyrets/models/parking.rb +59 -24
  21. data/lib/simplyrets/models/property.rb +128 -136
  22. data/lib/simplyrets/models/sales.rb +61 -28
  23. data/lib/simplyrets/models/school.rb +60 -34
  24. data/lib/simplyrets/models/street_address.rb +66 -55
  25. data/lib/simplyrets/models/tax.rb +70 -35
  26. data/lib/simplyrets/version.rb +13 -2
  27. data/ruby-client.meta +1 -0
  28. data/ruby-client.zip +0 -0
  29. data/ruby-client/.gitignore +50 -0
  30. data/ruby-client/.rspec +2 -0
  31. data/ruby-client/.swagger-codegen-ignore +23 -0
  32. data/ruby-client/LICENSE +201 -0
  33. data/ruby-client/README.md +128 -0
  34. data/ruby-client/docs/Agent.md +11 -0
  35. data/ruby-client/docs/Broker.md +8 -0
  36. data/ruby-client/docs/ContactInformation.md +10 -0
  37. data/ruby-client/docs/DefaultApi.md +306 -0
  38. data/ruby-client/docs/Error.md +9 -0
  39. data/ruby-client/docs/GeographicData.md +12 -0
  40. data/ruby-client/docs/Listing.md +30 -0
  41. data/ruby-client/docs/MlsInformation.md +11 -0
  42. data/ruby-client/docs/Office.md +11 -0
  43. data/ruby-client/docs/OpenHouse.md +15 -0
  44. data/ruby-client/docs/Parking.md +10 -0
  45. data/ruby-client/docs/Property.md +43 -0
  46. data/ruby-client/docs/Sales.md +12 -0
  47. data/ruby-client/docs/School.md +11 -0
  48. data/ruby-client/docs/StreetAddress.md +16 -0
  49. data/ruby-client/docs/Tax.md +10 -0
  50. data/ruby-client/git_push.sh +67 -0
  51. data/ruby-client/lib/swagger_client.rb +66 -0
  52. data/ruby-client/lib/swagger_client/api/default_api.rb +383 -0
  53. data/ruby-client/lib/swagger_client/api_client.rb +373 -0
  54. data/ruby-client/lib/swagger_client/api_error.rb +47 -0
  55. data/ruby-client/lib/swagger_client/configuration.rb +193 -0
  56. data/ruby-client/lib/swagger_client/models/agent.rb +230 -0
  57. data/ruby-client/lib/swagger_client/models/broker.rb +200 -0
  58. data/ruby-client/lib/swagger_client/models/contact_information.rb +220 -0
  59. data/ruby-client/lib/swagger_client/models/error.rb +210 -0
  60. data/ruby-client/lib/swagger_client/models/geographic_data.rb +240 -0
  61. data/ruby-client/lib/swagger_client/models/listing.rb +422 -0
  62. data/ruby-client/lib/swagger_client/models/mls_information.rb +263 -0
  63. data/ruby-client/lib/swagger_client/models/office.rb +230 -0
  64. data/ruby-client/lib/swagger_client/models/open_house.rb +270 -0
  65. data/ruby-client/lib/swagger_client/models/parking.rb +219 -0
  66. data/ruby-client/lib/swagger_client/models/property.rb +574 -0
  67. data/ruby-client/lib/swagger_client/models/sales.rb +240 -0
  68. data/ruby-client/lib/swagger_client/models/school.rb +230 -0
  69. data/ruby-client/lib/swagger_client/models/street_address.rb +280 -0
  70. data/ruby-client/lib/swagger_client/models/tax.rb +220 -0
  71. data/ruby-client/lib/swagger_client/version.rb +26 -0
  72. data/ruby-client/spec/api/default_api_spec.rb +132 -0
  73. data/ruby-client/spec/api_client_spec.rb +296 -0
  74. data/ruby-client/spec/configuration_spec.rb +48 -0
  75. data/ruby-client/spec/models/agent_spec.rb +71 -0
  76. data/ruby-client/spec/models/broker_spec.rb +53 -0
  77. data/ruby-client/spec/models/contact_information_spec.rb +65 -0
  78. data/ruby-client/spec/models/error_spec.rb +59 -0
  79. data/ruby-client/spec/models/geographic_data_spec.rb +77 -0
  80. data/ruby-client/spec/models/listing_spec.rb +185 -0
  81. data/ruby-client/spec/models/mls_information_spec.rb +74 -0
  82. data/ruby-client/spec/models/office_spec.rb +71 -0
  83. data/ruby-client/spec/models/open_house_spec.rb +95 -0
  84. data/ruby-client/spec/models/parking_spec.rb +65 -0
  85. data/ruby-client/spec/models/property_spec.rb +266 -0
  86. data/ruby-client/spec/models/sales_spec.rb +77 -0
  87. data/ruby-client/spec/models/school_spec.rb +71 -0
  88. data/ruby-client/spec/models/street_address_spec.rb +101 -0
  89. data/ruby-client/spec/models/tax_spec.rb +65 -0
  90. data/ruby-client/spec/spec_helper.rb +122 -0
  91. data/ruby-client/swagger_client.gemspec +55 -0
  92. data/simplyrets.gemspec +1 -1
  93. metadata +71 -5
@@ -0,0 +1,574 @@
1
+ =begin
2
+ SimplyRETS API
3
+
4
+ The SimplyRETS API is an exciting step towards making it easier for developers and real estate agents to build something awesome with real estate data! The documentation below makes live requests to our API using the trial data. To get set up with the API using live MLS data, you must have RETS credentials from your MLS, which you can then use to create an app with SimplyRETS. For more information on that process, please see our [FAQ](https://simplyrets.com/faq), [Getting Started](https://simplyrets.com/blog/getting-set-up.html) page, or [contact us](https://simplyrets.com/\\#home-contact). Below you'll find the API endpoints, query parameters, response bodies, and other information about using the SimplyRETS API. You can run queries by clicking the 'Try it Out' button at the bottom of each section. ### Authentication The SimplyRETS API uses Basic Authentication. When you create an app, you'll get a set of API credentials to access your listings. If you're trying out the test data, you can use `simplyrets:simplyrets` for connecting to the API. ### Media Types The SimplyRETS API uses the `Accept` header to allow clients to control media types (content versions). We maintain backwards compatibility with API clients by allowing them to specify a content version. We highly recommend setting and explicity media type when your application reaches production. Both the structure and content of our API response bodies is subject to change so we can add new features while respecting the stability of applications which have already been developed. To always use the latest SimplyRETS content version, simply use `application/json` in your application `Accept` header. If you want to pin your clients media type to a specific version, you can use the vendor-specific SimplyRETS media type, e.g. `application/vnd.simplyrets-v0.1+json\"` To view all valid content-types for making an `OPTIONS`, make a request to the SimplyRETS api root `curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/` The default media types used in our API responses may change in the future. If you're building an application and care about the stability of the API, be sure to request a specific media type in the Accept header as shown in the examples below. The wordpress plugin automatically sets the `Accept` header for the compatible SimplyRETS media types. ### Pagination There a few pieces of useful information about each request stored in the HTTP Headers: - `X-Total-Count` shows you the total amount of listings that match your current query. - `Link` contains pre-built pagination links for accessing the next 'page' of listings that match your query. Read more about that [here](https://simplyrets.com/blog/api-pagination.html).
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module SwaggerClient
27
+ # Rets MLS Listing Property
28
+ class Property
29
+ # Property roof description
30
+ attr_accessor :roof
31
+
32
+ # A description of the cooling or air conditioning features of the property.
33
+ attr_accessor :cooling
34
+
35
+ # Property style description or short string
36
+ attr_accessor :style
37
+
38
+ # Square footage of the building associated with a listing
39
+ attr_accessor :area
40
+
41
+ # Number of full bathrooms
42
+ attr_accessor :baths_full
43
+
44
+ # Number of half bathrooms
45
+ attr_accessor :baths_half
46
+
47
+ # Number of stories or levels. Represented as a `double' to account for half stories.
48
+ attr_accessor :stories
49
+
50
+ # Number of fireplaces
51
+ attr_accessor :fireplaces
52
+
53
+ # The type(s) of flooring found within the property.
54
+ attr_accessor :flooring
55
+
56
+ # Heating description or short string
57
+ attr_accessor :heating
58
+
59
+ attr_accessor :foundation
60
+
61
+ attr_accessor :pool_features
62
+
63
+ attr_accessor :laundry_features
64
+
65
+ attr_accessor :occupant_name
66
+
67
+ attr_accessor :lot_description
68
+
69
+ # Lot size in acres **Added on 2016/05/04 - Not available for all RETS vendors**
70
+ attr_accessor :lot_size_acres
71
+
72
+ # The property's sub-type, i.e. SingleFamilyResidential, Condo, etc. Or a list of Sub Types for Mobile, such as Expando, Manufactured, Modular, etc.
73
+ attr_accessor :sub_type
74
+
75
+ # Number of bedrooms
76
+ attr_accessor :bedrooms
77
+
78
+ # The properties interior features
79
+ attr_accessor :interior_features
80
+
81
+ # Lot size dimensions or square footage as a text. This field is generally used to show the pretty formatted lot size.
82
+ attr_accessor :lot_size
83
+
84
+ attr_accessor :area_source
85
+
86
+ # Yearly maintenance expense
87
+ attr_accessor :maintenance_expense
88
+
89
+ # Additional room information
90
+ attr_accessor :additional_rooms
91
+
92
+ # Exterior Features for the listing
93
+ attr_accessor :exterior_features
94
+
95
+ # Water description and details
96
+ attr_accessor :water
97
+
98
+ # View details and description
99
+ attr_accessor :view
100
+
101
+ # The total area of the lot. See `lotSizeUnits` for the units of measurement (Square Feet, Square Meters, Acres, etc.). **Added on 2016/05/04 - Not available for all RETS vendors**
102
+ attr_accessor :lot_size_area
103
+
104
+ # The subdivision or community name
105
+ attr_accessor :subdivision
106
+
107
+ # The materials that were used in the construction of the property.
108
+ attr_accessor :construction
109
+
110
+ attr_accessor :parking
111
+
112
+ # Unit of measurement for the lotSizeArea field. e.g. Square Feet, Square Meters, Acres, etc. If this field is `null` the units is the default unit of measure specified by your RETS provider. **Added on 2016/05/04 - Not available for all RETS vendors**
113
+ attr_accessor :lot_size_area_units
114
+
115
+ # Abbreviated property type. RES is Residential, CND is CondoOrTownhome, RNT is Rental, MLF is Multi-Family, CRE is Commercial, LND is Land, FRM is Farm. See the `propertySubType` field for more information.
116
+ attr_accessor :type
117
+
118
+ # Number of garage spaces
119
+ attr_accessor :garage_spaces
120
+
121
+ attr_accessor :accessibility
122
+
123
+ attr_accessor :occupant_type
124
+
125
+ # Year the property was built
126
+ attr_accessor :year_built
127
+
128
+ class EnumAttributeValidator
129
+ attr_reader :datatype
130
+ attr_reader :allowable_values
131
+
132
+ def initialize(datatype, allowable_values)
133
+ @allowable_values = allowable_values.map do |value|
134
+ case datatype.to_s
135
+ when /Integer/i
136
+ value.to_i
137
+ when /Float/i
138
+ value.to_f
139
+ else
140
+ value
141
+ end
142
+ end
143
+ end
144
+
145
+ def valid?(value)
146
+ !value || allowable_values.include?(value)
147
+ end
148
+ end
149
+
150
+ # Attribute mapping from ruby-style variable name to JSON key.
151
+ def self.attribute_map
152
+ {
153
+ :'roof' => :'roof',
154
+ :'cooling' => :'cooling',
155
+ :'style' => :'style',
156
+ :'area' => :'area',
157
+ :'baths_full' => :'bathsFull',
158
+ :'baths_half' => :'bathsHalf',
159
+ :'stories' => :'stories',
160
+ :'fireplaces' => :'fireplaces',
161
+ :'flooring' => :'flooring',
162
+ :'heating' => :'heating',
163
+ :'foundation' => :'foundation',
164
+ :'pool_features' => :'poolFeatures',
165
+ :'laundry_features' => :'laundryFeatures',
166
+ :'occupant_name' => :'occupantName',
167
+ :'lot_description' => :'lotDescription',
168
+ :'lot_size_acres' => :'lotSizeAcres',
169
+ :'sub_type' => :'subType',
170
+ :'bedrooms' => :'bedrooms',
171
+ :'interior_features' => :'interiorFeatures',
172
+ :'lot_size' => :'lotSize',
173
+ :'area_source' => :'areaSource',
174
+ :'maintenance_expense' => :'maintenanceExpense',
175
+ :'additional_rooms' => :'additionalRooms',
176
+ :'exterior_features' => :'exteriorFeatures',
177
+ :'water' => :'water',
178
+ :'view' => :'view',
179
+ :'lot_size_area' => :'lotSizeArea',
180
+ :'subdivision' => :'subdivision',
181
+ :'construction' => :'construction',
182
+ :'parking' => :'parking',
183
+ :'lot_size_area_units' => :'lotSizeAreaUnits',
184
+ :'type' => :'type',
185
+ :'garage_spaces' => :'garageSpaces',
186
+ :'accessibility' => :'accessibility',
187
+ :'occupant_type' => :'occupantType',
188
+ :'year_built' => :'yearBuilt'
189
+ }
190
+ end
191
+
192
+ # Attribute type mapping.
193
+ def self.swagger_types
194
+ {
195
+ :'roof' => :'String',
196
+ :'cooling' => :'String',
197
+ :'style' => :'String',
198
+ :'area' => :'Integer',
199
+ :'baths_full' => :'Integer',
200
+ :'baths_half' => :'Integer',
201
+ :'stories' => :'Float',
202
+ :'fireplaces' => :'Integer',
203
+ :'flooring' => :'String',
204
+ :'heating' => :'String',
205
+ :'foundation' => :'String',
206
+ :'pool_features' => :'String',
207
+ :'laundry_features' => :'String',
208
+ :'occupant_name' => :'String',
209
+ :'lot_description' => :'String',
210
+ :'lot_size_acres' => :'Float',
211
+ :'sub_type' => :'String',
212
+ :'bedrooms' => :'Integer',
213
+ :'interior_features' => :'String',
214
+ :'lot_size' => :'String',
215
+ :'area_source' => :'String',
216
+ :'maintenance_expense' => :'Float',
217
+ :'additional_rooms' => :'String',
218
+ :'exterior_features' => :'String',
219
+ :'water' => :'String',
220
+ :'view' => :'String',
221
+ :'lot_size_area' => :'Float',
222
+ :'subdivision' => :'String',
223
+ :'construction' => :'String',
224
+ :'parking' => :'Parking',
225
+ :'lot_size_area_units' => :'String',
226
+ :'type' => :'String',
227
+ :'garage_spaces' => :'Float',
228
+ :'accessibility' => :'String',
229
+ :'occupant_type' => :'String',
230
+ :'year_built' => :'Integer'
231
+ }
232
+ end
233
+
234
+ # Initializes the object
235
+ # @param [Hash] attributes Model attributes in the form of hash
236
+ def initialize(attributes = {})
237
+ return unless attributes.is_a?(Hash)
238
+
239
+ # convert string to symbol for hash key
240
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
241
+
242
+ if attributes.has_key?(:'roof')
243
+ self.roof = attributes[:'roof']
244
+ end
245
+
246
+ if attributes.has_key?(:'cooling')
247
+ self.cooling = attributes[:'cooling']
248
+ end
249
+
250
+ if attributes.has_key?(:'style')
251
+ self.style = attributes[:'style']
252
+ end
253
+
254
+ if attributes.has_key?(:'area')
255
+ self.area = attributes[:'area']
256
+ end
257
+
258
+ if attributes.has_key?(:'bathsFull')
259
+ self.baths_full = attributes[:'bathsFull']
260
+ end
261
+
262
+ if attributes.has_key?(:'bathsHalf')
263
+ self.baths_half = attributes[:'bathsHalf']
264
+ end
265
+
266
+ if attributes.has_key?(:'stories')
267
+ self.stories = attributes[:'stories']
268
+ end
269
+
270
+ if attributes.has_key?(:'fireplaces')
271
+ self.fireplaces = attributes[:'fireplaces']
272
+ end
273
+
274
+ if attributes.has_key?(:'flooring')
275
+ self.flooring = attributes[:'flooring']
276
+ end
277
+
278
+ if attributes.has_key?(:'heating')
279
+ self.heating = attributes[:'heating']
280
+ end
281
+
282
+ if attributes.has_key?(:'foundation')
283
+ self.foundation = attributes[:'foundation']
284
+ end
285
+
286
+ if attributes.has_key?(:'poolFeatures')
287
+ self.pool_features = attributes[:'poolFeatures']
288
+ end
289
+
290
+ if attributes.has_key?(:'laundryFeatures')
291
+ self.laundry_features = attributes[:'laundryFeatures']
292
+ end
293
+
294
+ if attributes.has_key?(:'occupantName')
295
+ self.occupant_name = attributes[:'occupantName']
296
+ end
297
+
298
+ if attributes.has_key?(:'lotDescription')
299
+ self.lot_description = attributes[:'lotDescription']
300
+ end
301
+
302
+ if attributes.has_key?(:'lotSizeAcres')
303
+ self.lot_size_acres = attributes[:'lotSizeAcres']
304
+ end
305
+
306
+ if attributes.has_key?(:'subType')
307
+ self.sub_type = attributes[:'subType']
308
+ end
309
+
310
+ if attributes.has_key?(:'bedrooms')
311
+ self.bedrooms = attributes[:'bedrooms']
312
+ end
313
+
314
+ if attributes.has_key?(:'interiorFeatures')
315
+ self.interior_features = attributes[:'interiorFeatures']
316
+ end
317
+
318
+ if attributes.has_key?(:'lotSize')
319
+ self.lot_size = attributes[:'lotSize']
320
+ end
321
+
322
+ if attributes.has_key?(:'areaSource')
323
+ self.area_source = attributes[:'areaSource']
324
+ end
325
+
326
+ if attributes.has_key?(:'maintenanceExpense')
327
+ self.maintenance_expense = attributes[:'maintenanceExpense']
328
+ end
329
+
330
+ if attributes.has_key?(:'additionalRooms')
331
+ self.additional_rooms = attributes[:'additionalRooms']
332
+ end
333
+
334
+ if attributes.has_key?(:'exteriorFeatures')
335
+ self.exterior_features = attributes[:'exteriorFeatures']
336
+ end
337
+
338
+ if attributes.has_key?(:'water')
339
+ self.water = attributes[:'water']
340
+ end
341
+
342
+ if attributes.has_key?(:'view')
343
+ self.view = attributes[:'view']
344
+ end
345
+
346
+ if attributes.has_key?(:'lotSizeArea')
347
+ self.lot_size_area = attributes[:'lotSizeArea']
348
+ end
349
+
350
+ if attributes.has_key?(:'subdivision')
351
+ self.subdivision = attributes[:'subdivision']
352
+ end
353
+
354
+ if attributes.has_key?(:'construction')
355
+ self.construction = attributes[:'construction']
356
+ end
357
+
358
+ if attributes.has_key?(:'parking')
359
+ self.parking = attributes[:'parking']
360
+ end
361
+
362
+ if attributes.has_key?(:'lotSizeAreaUnits')
363
+ self.lot_size_area_units = attributes[:'lotSizeAreaUnits']
364
+ end
365
+
366
+ if attributes.has_key?(:'type')
367
+ self.type = attributes[:'type']
368
+ end
369
+
370
+ if attributes.has_key?(:'garageSpaces')
371
+ self.garage_spaces = attributes[:'garageSpaces']
372
+ end
373
+
374
+ if attributes.has_key?(:'accessibility')
375
+ self.accessibility = attributes[:'accessibility']
376
+ end
377
+
378
+ if attributes.has_key?(:'occupantType')
379
+ self.occupant_type = attributes[:'occupantType']
380
+ end
381
+
382
+ if attributes.has_key?(:'yearBuilt')
383
+ self.year_built = attributes[:'yearBuilt']
384
+ end
385
+
386
+ end
387
+
388
+ # Show invalid properties with the reasons. Usually used together with valid?
389
+ # @return Array for valid properies with the reasons
390
+ def list_invalid_properties
391
+ invalid_properties = Array.new
392
+ return invalid_properties
393
+ end
394
+
395
+ # Check to see if the all the properties in the model are valid
396
+ # @return true if the model is valid
397
+ def valid?
398
+ type_validator = EnumAttributeValidator.new('String', ["RES", "CND", "RNT", "MLF", "CRE", "LND", "FRM"])
399
+ return false unless type_validator.valid?(@type)
400
+ return true
401
+ end
402
+
403
+ # Custom attribute writer method checking allowed values (enum).
404
+ # @param [Object] type Object to be assigned
405
+ def type=(type)
406
+ validator = EnumAttributeValidator.new('String', ["RES", "CND", "RNT", "MLF", "CRE", "LND", "FRM"])
407
+ unless validator.valid?(type)
408
+ fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
409
+ end
410
+ @type = type
411
+ end
412
+
413
+ # Checks equality by comparing each attribute.
414
+ # @param [Object] Object to be compared
415
+ def ==(o)
416
+ return true if self.equal?(o)
417
+ self.class == o.class &&
418
+ roof == o.roof &&
419
+ cooling == o.cooling &&
420
+ style == o.style &&
421
+ area == o.area &&
422
+ baths_full == o.baths_full &&
423
+ baths_half == o.baths_half &&
424
+ stories == o.stories &&
425
+ fireplaces == o.fireplaces &&
426
+ flooring == o.flooring &&
427
+ heating == o.heating &&
428
+ foundation == o.foundation &&
429
+ pool_features == o.pool_features &&
430
+ laundry_features == o.laundry_features &&
431
+ occupant_name == o.occupant_name &&
432
+ lot_description == o.lot_description &&
433
+ lot_size_acres == o.lot_size_acres &&
434
+ sub_type == o.sub_type &&
435
+ bedrooms == o.bedrooms &&
436
+ interior_features == o.interior_features &&
437
+ lot_size == o.lot_size &&
438
+ area_source == o.area_source &&
439
+ maintenance_expense == o.maintenance_expense &&
440
+ additional_rooms == o.additional_rooms &&
441
+ exterior_features == o.exterior_features &&
442
+ water == o.water &&
443
+ view == o.view &&
444
+ lot_size_area == o.lot_size_area &&
445
+ subdivision == o.subdivision &&
446
+ construction == o.construction &&
447
+ parking == o.parking &&
448
+ lot_size_area_units == o.lot_size_area_units &&
449
+ type == o.type &&
450
+ garage_spaces == o.garage_spaces &&
451
+ accessibility == o.accessibility &&
452
+ occupant_type == o.occupant_type &&
453
+ year_built == o.year_built
454
+ end
455
+
456
+ # @see the `==` method
457
+ # @param [Object] Object to be compared
458
+ def eql?(o)
459
+ self == o
460
+ end
461
+
462
+ # Calculates hash code according to all attributes.
463
+ # @return [Fixnum] Hash code
464
+ def hash
465
+ [roof, cooling, style, area, baths_full, baths_half, stories, fireplaces, flooring, heating, foundation, pool_features, laundry_features, occupant_name, lot_description, lot_size_acres, sub_type, bedrooms, interior_features, lot_size, area_source, maintenance_expense, additional_rooms, exterior_features, water, view, lot_size_area, subdivision, construction, parking, lot_size_area_units, type, garage_spaces, accessibility, occupant_type, year_built].hash
466
+ end
467
+
468
+ # Builds the object from hash
469
+ # @param [Hash] attributes Model attributes in the form of hash
470
+ # @return [Object] Returns the model itself
471
+ def build_from_hash(attributes)
472
+ return nil unless attributes.is_a?(Hash)
473
+ self.class.swagger_types.each_pair do |key, type|
474
+ if type =~ /^Array<(.*)>/i
475
+ # check to ensure the input is an array given that the the attribute
476
+ # is documented as an array but the input is not
477
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
478
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
479
+ end
480
+ elsif !attributes[self.class.attribute_map[key]].nil?
481
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
482
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
483
+ end
484
+
485
+ self
486
+ end
487
+
488
+ # Deserializes the data based on type
489
+ # @param string type Data type
490
+ # @param string value Value to be deserialized
491
+ # @return [Object] Deserialized data
492
+ def _deserialize(type, value)
493
+ case type.to_sym
494
+ when :DateTime
495
+ DateTime.parse(value)
496
+ when :Date
497
+ Date.parse(value)
498
+ when :String
499
+ value.to_s
500
+ when :Integer
501
+ value.to_i
502
+ when :Float
503
+ value.to_f
504
+ when :BOOLEAN
505
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
506
+ true
507
+ else
508
+ false
509
+ end
510
+ when :Object
511
+ # generic object (usually a Hash), return directly
512
+ value
513
+ when /\AArray<(?<inner_type>.+)>\z/
514
+ inner_type = Regexp.last_match[:inner_type]
515
+ value.map { |v| _deserialize(inner_type, v) }
516
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
517
+ k_type = Regexp.last_match[:k_type]
518
+ v_type = Regexp.last_match[:v_type]
519
+ {}.tap do |hash|
520
+ value.each do |k, v|
521
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
522
+ end
523
+ end
524
+ else # model
525
+ temp_model = SwaggerClient.const_get(type).new
526
+ temp_model.build_from_hash(value)
527
+ end
528
+ end
529
+
530
+ # Returns the string representation of the object
531
+ # @return [String] String presentation of the object
532
+ def to_s
533
+ to_hash.to_s
534
+ end
535
+
536
+ # to_body is an alias to to_hash (backward compatibility)
537
+ # @return [Hash] Returns the object in the form of hash
538
+ def to_body
539
+ to_hash
540
+ end
541
+
542
+ # Returns the object in the form of hash
543
+ # @return [Hash] Returns the object in the form of hash
544
+ def to_hash
545
+ hash = {}
546
+ self.class.attribute_map.each_pair do |attr, param|
547
+ value = self.send(attr)
548
+ next if value.nil?
549
+ hash[param] = _to_hash(value)
550
+ end
551
+ hash
552
+ end
553
+
554
+ # Outputs non-array value in the form of hash
555
+ # For object, use to_hash. Otherwise, just return the value
556
+ # @param [Object] value Any valid value
557
+ # @return [Hash] Returns the value in the form of hash
558
+ def _to_hash(value)
559
+ if value.is_a?(Array)
560
+ value.compact.map{ |v| _to_hash(v) }
561
+ elsif value.is_a?(Hash)
562
+ {}.tap do |hash|
563
+ value.each { |k, v| hash[k] = _to_hash(v) }
564
+ end
565
+ elsif value.respond_to? :to_hash
566
+ value.to_hash
567
+ else
568
+ value
569
+ end
570
+ end
571
+
572
+ end
573
+
574
+ end