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
@@ -1,12 +1,23 @@
1
1
  =begin
2
2
  SimplyRETS API
3
3
 
4
- The SimplyRETS API is an exciting step towards making it easier for\ndevelopers and real estate agents to build something awesome with\nreal estate data!\n\nThe documentation below makes live requests to our API using the\ntrial data. To get set up with the API using live MLS data, you\nmust have RETS credentials from your MLS, which you can then use to\ncreate an app with SimplyRETS. For more information on that\nprocess, please see our [FAQ](https://simplyrets.com/faq), [Getting\nStarted](https://simplyrets.com/blog/getting-set-up.html) page, or\n[contact us](https://simplyrets.com/\\#home-contact).\n\nBelow you'll find the API endpoints, query parameters, response bodies,\nand other information about using the SimplyRETS API. You can run\nqueries by clicking the 'Try it Out' button at the bottom of each\nsection.\n\n### Authentication\nThe SimplyRETS API uses Basic Authentication. When you create an\napp, you'll get a set of API credentials to access your\nlistings. If you're trying out the test data, you can use\n`simplyrets:simplyrets` for connecting to the API.\n\n### Media Types\nThe SimplyRETS API uses the `Accept` header to allow clients to\ncontrol media types (content versions). We maintain backwards\ncompatibility with API clients by allowing them to specify a\ncontent version. We highly recommend setting and explicity media\ntype when your application reaches production. Both the structure\nand content of our API response bodies is subject to change so we\ncan add new features while respecting the stability of applications\nwhich have already been developed.\n\nTo always use the latest SimplyRETS content version, simply use\n`application/json` in your application `Accept` header.\n\nIf you want to pin your clients media type to a specific version,\nyou can use the vendor-specific SimplyRETS media type, e.g.\n`application/vnd.simplyrets-v0.1+json\"`\n\nTo view all valid content-types for making an `OPTIONS`, make a\nrequest to the SimplyRETS api root\n\n`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n\nThe default media types used in our API responses may change in the\nfuture. If you're building an application and care about the\nstability of the API, be sure to request a specific media type in the\nAccept header as shown in the examples below.\n\nThe wordpress plugin automatically sets the `Accept` header for the\ncompatible SimplyRETS media types.\n\n### Pagination\nThere a few pieces of useful information about each request stored\nin the HTTP Headers:\n\n- `X-Total-Count` shows you the total amount of listings that match\n your current query.\n- `Link` contains pre-built pagination links for accessing the next\n'page' of listings that match your query. Read more about that\n[here](https://simplyrets.com/blog/api-pagination.html).\n
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
5
 
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
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.
10
21
 
11
22
  =end
12
23
 
@@ -24,13 +35,13 @@ module SimplyRetsClient
24
35
  # Start Date for the open house
25
36
  attr_accessor :start_time
26
37
 
27
- # A unique identifier for the open house which is specific to the\nSimplyRETS API\n
38
+ # A unique identifier for the open house which is specific to the SimplyRETS API
28
39
  attr_accessor :open_house_key
29
40
 
30
41
  # The ending date time for the open house
31
42
  attr_accessor :end_time
32
43
 
33
- # The MLS number or id provided by the MLS\n
44
+ # The MLS number or id provided by the MLS
34
45
  attr_accessor :open_house_id
35
46
 
36
47
  # The open house type. For example, Public or Private
@@ -39,26 +50,18 @@ module SimplyRetsClient
39
50
  # The remarks and/or description details for the open house
40
51
  attr_accessor :description
41
52
 
53
+
42
54
  # Attribute mapping from ruby-style variable name to JSON key.
43
55
  def self.attribute_map
44
56
  {
45
-
46
57
  :'refreshments' => :'refreshments',
47
-
48
58
  :'listing' => :'listing',
49
-
50
59
  :'start_time' => :'startTime',
51
-
52
60
  :'open_house_key' => :'openHouseKey',
53
-
54
61
  :'end_time' => :'endTime',
55
-
56
62
  :'open_house_id' => :'openHouseId',
57
-
58
63
  :'type' => :'type',
59
-
60
64
  :'description' => :'description'
61
-
62
65
  }
63
66
  end
64
67
 
@@ -73,52 +76,66 @@ module SimplyRetsClient
73
76
  :'open_house_id' => :'String',
74
77
  :'type' => :'String',
75
78
  :'description' => :'String'
76
-
77
79
  }
78
80
  end
79
81
 
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
80
84
  def initialize(attributes = {})
81
85
  return unless attributes.is_a?(Hash)
82
86
 
83
87
  # convert string to symbol for hash key
84
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
85
-
88
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
86
89
 
87
- if attributes[:'refreshments']
90
+ if attributes.has_key?(:'refreshments')
88
91
  self.refreshments = attributes[:'refreshments']
89
92
  end
90
93
 
91
- if attributes[:'listing']
94
+ if attributes.has_key?(:'listing')
92
95
  self.listing = attributes[:'listing']
93
96
  end
94
97
 
95
- if attributes[:'startTime']
98
+ if attributes.has_key?(:'startTime')
96
99
  self.start_time = attributes[:'startTime']
97
100
  end
98
101
 
99
- if attributes[:'openHouseKey']
102
+ if attributes.has_key?(:'openHouseKey')
100
103
  self.open_house_key = attributes[:'openHouseKey']
101
104
  end
102
105
 
103
- if attributes[:'endTime']
106
+ if attributes.has_key?(:'endTime')
104
107
  self.end_time = attributes[:'endTime']
105
108
  end
106
109
 
107
- if attributes[:'openHouseId']
110
+ if attributes.has_key?(:'openHouseId')
108
111
  self.open_house_id = attributes[:'openHouseId']
109
112
  end
110
113
 
111
- if attributes[:'type']
114
+ if attributes.has_key?(:'type')
112
115
  self.type = attributes[:'type']
113
116
  end
114
117
 
115
- if attributes[:'description']
118
+ if attributes.has_key?(:'description')
116
119
  self.description = attributes[:'description']
117
120
  end
118
121
 
119
122
  end
120
123
 
121
- # Check equality by comparing each attribute.
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properies with the reasons
126
+ def list_invalid_properties
127
+ invalid_properties = Array.new
128
+ return invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ return true
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
122
139
  def ==(o)
123
140
  return true if self.equal?(o)
124
141
  self.class == o.class &&
@@ -133,35 +150,41 @@ module SimplyRetsClient
133
150
  end
134
151
 
135
152
  # @see the `==` method
153
+ # @param [Object] Object to be compared
136
154
  def eql?(o)
137
155
  self == o
138
156
  end
139
157
 
140
- # Calculate hash code according to all attributes.
158
+ # Calculates hash code according to all attributes.
159
+ # @return [Fixnum] Hash code
141
160
  def hash
142
161
  [refreshments, listing, start_time, open_house_key, end_time, open_house_id, type, description].hash
143
162
  end
144
163
 
145
- # build the object from hash
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
146
167
  def build_from_hash(attributes)
147
168
  return nil unless attributes.is_a?(Hash)
148
169
  self.class.swagger_types.each_pair do |key, type|
149
170
  if type =~ /^Array<(.*)>/i
171
+ # check to ensure the input is an array given that the the attribute
172
+ # is documented as an array but the input is not
150
173
  if attributes[self.class.attribute_map[key]].is_a?(Array)
151
174
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
152
- else
153
- #TODO show warning in debug mode
154
175
  end
155
176
  elsif !attributes[self.class.attribute_map[key]].nil?
156
177
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
157
- else
158
- # data not found in attributes(hash), not an issue as the data can be optional
159
- end
178
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
160
179
  end
161
180
 
162
181
  self
163
182
  end
164
183
 
184
+ # Deserializes the data based on type
185
+ # @param string type Data type
186
+ # @param string value Value to be deserialized
187
+ # @return [Object] Deserialized data
165
188
  def _deserialize(type, value)
166
189
  case type.to_sym
167
190
  when :DateTime
@@ -195,21 +218,25 @@ module SimplyRetsClient
195
218
  end
196
219
  end
197
220
  else # model
198
- _model = SimplyRetsClient.const_get(type).new
199
- _model.build_from_hash(value)
221
+ temp_model = SimplyRetsClient.const_get(type).new
222
+ temp_model.build_from_hash(value)
200
223
  end
201
224
  end
202
225
 
226
+ # Returns the string representation of the object
227
+ # @return [String] String presentation of the object
203
228
  def to_s
204
229
  to_hash.to_s
205
230
  end
206
231
 
207
- # to_body is an alias to to_body (backward compatibility))
232
+ # to_body is an alias to to_hash (backward compatibility)
233
+ # @return [Hash] Returns the object in the form of hash
208
234
  def to_body
209
235
  to_hash
210
236
  end
211
237
 
212
- # return the object in the form of hash
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
213
240
  def to_hash
214
241
  hash = {}
215
242
  self.class.attribute_map.each_pair do |attr, param|
@@ -220,8 +247,10 @@ module SimplyRetsClient
220
247
  hash
221
248
  end
222
249
 
223
- # Method to output non-array value in the form of hash
250
+ # Outputs non-array value in the form of hash
224
251
  # For object, use to_hash. Otherwise, just return the value
252
+ # @param [Object] value Any valid value
253
+ # @return [Hash] Returns the value in the form of hash
225
254
  def _to_hash(value)
226
255
  if value.is_a?(Array)
227
256
  value.compact.map{ |v| _to_hash(v) }
@@ -237,4 +266,5 @@ module SimplyRetsClient
237
266
  end
238
267
 
239
268
  end
269
+
240
270
  end
@@ -1,12 +1,23 @@
1
1
  =begin
2
2
  SimplyRETS API
3
3
 
4
- The SimplyRETS API is an exciting step towards making it easier for\ndevelopers and real estate agents to build something awesome with\nreal estate data!\n\nThe documentation below makes live requests to our API using the\ntrial data. To get set up with the API using live MLS data, you\nmust have RETS credentials from your MLS, which you can then use to\ncreate an app with SimplyRETS. For more information on that\nprocess, please see our [FAQ](https://simplyrets.com/faq), [Getting\nStarted](https://simplyrets.com/blog/getting-set-up.html) page, or\n[contact us](https://simplyrets.com/\\#home-contact).\n\nBelow you'll find the API endpoints, query parameters, response bodies,\nand other information about using the SimplyRETS API. You can run\nqueries by clicking the 'Try it Out' button at the bottom of each\nsection.\n\n### Authentication\nThe SimplyRETS API uses Basic Authentication. When you create an\napp, you'll get a set of API credentials to access your\nlistings. If you're trying out the test data, you can use\n`simplyrets:simplyrets` for connecting to the API.\n\n### Media Types\nThe SimplyRETS API uses the `Accept` header to allow clients to\ncontrol media types (content versions). We maintain backwards\ncompatibility with API clients by allowing them to specify a\ncontent version. We highly recommend setting and explicity media\ntype when your application reaches production. Both the structure\nand content of our API response bodies is subject to change so we\ncan add new features while respecting the stability of applications\nwhich have already been developed.\n\nTo always use the latest SimplyRETS content version, simply use\n`application/json` in your application `Accept` header.\n\nIf you want to pin your clients media type to a specific version,\nyou can use the vendor-specific SimplyRETS media type, e.g.\n`application/vnd.simplyrets-v0.1+json\"`\n\nTo view all valid content-types for making an `OPTIONS`, make a\nrequest to the SimplyRETS api root\n\n`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n\nThe default media types used in our API responses may change in the\nfuture. If you're building an application and care about the\nstability of the API, be sure to request a specific media type in the\nAccept header as shown in the examples below.\n\nThe wordpress plugin automatically sets the `Accept` header for the\ncompatible SimplyRETS media types.\n\n### Pagination\nThere a few pieces of useful information about each request stored\nin the HTTP Headers:\n\n- `X-Total-Count` shows you the total amount of listings that match\n your current query.\n- `Link` contains pre-built pagination links for accessing the next\n'page' of listings that match your query. Read more about that\n[here](https://simplyrets.com/blog/api-pagination.html).\n
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
5
 
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
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.
10
21
 
11
22
  =end
12
23
 
@@ -23,16 +34,13 @@ module SimplyRetsClient
23
34
  # Parking features description
24
35
  attr_accessor :description
25
36
 
37
+
26
38
  # Attribute mapping from ruby-style variable name to JSON key.
27
39
  def self.attribute_map
28
40
  {
29
-
30
41
  :'leased' => :'leased',
31
-
32
42
  :'spaces' => :'spaces',
33
-
34
43
  :'description' => :'description'
35
-
36
44
  }
37
45
  end
38
46
 
@@ -42,32 +50,46 @@ module SimplyRetsClient
42
50
  :'leased' => :'String',
43
51
  :'spaces' => :'Integer',
44
52
  :'description' => :'String'
45
-
46
53
  }
47
54
  end
48
55
 
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
49
58
  def initialize(attributes = {})
50
59
  return unless attributes.is_a?(Hash)
51
60
 
52
61
  # convert string to symbol for hash key
53
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
62
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
54
63
 
55
-
56
- if attributes[:'leased']
64
+ if attributes.has_key?(:'leased')
57
65
  self.leased = attributes[:'leased']
58
66
  end
59
67
 
60
- if attributes[:'spaces']
68
+ if attributes.has_key?(:'spaces')
61
69
  self.spaces = attributes[:'spaces']
62
70
  end
63
71
 
64
- if attributes[:'description']
72
+ if attributes.has_key?(:'description')
65
73
  self.description = attributes[:'description']
66
74
  end
67
75
 
68
76
  end
69
77
 
70
- # Check equality by comparing each attribute.
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properies with the reasons
80
+ def list_invalid_properties
81
+ invalid_properties = Array.new
82
+ return invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ return true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
71
93
  def ==(o)
72
94
  return true if self.equal?(o)
73
95
  self.class == o.class &&
@@ -77,35 +99,41 @@ module SimplyRetsClient
77
99
  end
78
100
 
79
101
  # @see the `==` method
102
+ # @param [Object] Object to be compared
80
103
  def eql?(o)
81
104
  self == o
82
105
  end
83
106
 
84
- # Calculate hash code according to all attributes.
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Fixnum] Hash code
85
109
  def hash
86
110
  [leased, spaces, description].hash
87
111
  end
88
112
 
89
- # build the object from hash
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
90
116
  def build_from_hash(attributes)
91
117
  return nil unless attributes.is_a?(Hash)
92
118
  self.class.swagger_types.each_pair do |key, type|
93
119
  if type =~ /^Array<(.*)>/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
94
122
  if attributes[self.class.attribute_map[key]].is_a?(Array)
95
123
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
96
- else
97
- #TODO show warning in debug mode
98
124
  end
99
125
  elsif !attributes[self.class.attribute_map[key]].nil?
100
126
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
101
- else
102
- # data not found in attributes(hash), not an issue as the data can be optional
103
- end
127
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
104
128
  end
105
129
 
106
130
  self
107
131
  end
108
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
109
137
  def _deserialize(type, value)
110
138
  case type.to_sym
111
139
  when :DateTime
@@ -139,21 +167,25 @@ module SimplyRetsClient
139
167
  end
140
168
  end
141
169
  else # model
142
- _model = SimplyRetsClient.const_get(type).new
143
- _model.build_from_hash(value)
170
+ temp_model = SimplyRetsClient.const_get(type).new
171
+ temp_model.build_from_hash(value)
144
172
  end
145
173
  end
146
174
 
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
147
177
  def to_s
148
178
  to_hash.to_s
149
179
  end
150
180
 
151
- # to_body is an alias to to_body (backward compatibility))
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
152
183
  def to_body
153
184
  to_hash
154
185
  end
155
186
 
156
- # return the object in the form of hash
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
157
189
  def to_hash
158
190
  hash = {}
159
191
  self.class.attribute_map.each_pair do |attr, param|
@@ -164,8 +196,10 @@ module SimplyRetsClient
164
196
  hash
165
197
  end
166
198
 
167
- # Method to output non-array value in the form of hash
199
+ # Outputs non-array value in the form of hash
168
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
169
203
  def _to_hash(value)
170
204
  if value.is_a?(Array)
171
205
  value.compact.map{ |v| _to_hash(v) }
@@ -181,4 +215,5 @@ module SimplyRetsClient
181
215
  end
182
216
 
183
217
  end
218
+
184
219
  end
@@ -1,12 +1,23 @@
1
1
  =begin
2
2
  SimplyRETS API
3
3
 
4
- The SimplyRETS API is an exciting step towards making it easier for\ndevelopers and real estate agents to build something awesome with\nreal estate data!\n\nThe documentation below makes live requests to our API using the\ntrial data. To get set up with the API using live MLS data, you\nmust have RETS credentials from your MLS, which you can then use to\ncreate an app with SimplyRETS. For more information on that\nprocess, please see our [FAQ](https://simplyrets.com/faq), [Getting\nStarted](https://simplyrets.com/blog/getting-set-up.html) page, or\n[contact us](https://simplyrets.com/\\#home-contact).\n\nBelow you'll find the API endpoints, query parameters, response bodies,\nand other information about using the SimplyRETS API. You can run\nqueries by clicking the 'Try it Out' button at the bottom of each\nsection.\n\n### Authentication\nThe SimplyRETS API uses Basic Authentication. When you create an\napp, you'll get a set of API credentials to access your\nlistings. If you're trying out the test data, you can use\n`simplyrets:simplyrets` for connecting to the API.\n\n### Media Types\nThe SimplyRETS API uses the `Accept` header to allow clients to\ncontrol media types (content versions). We maintain backwards\ncompatibility with API clients by allowing them to specify a\ncontent version. We highly recommend setting and explicity media\ntype when your application reaches production. Both the structure\nand content of our API response bodies is subject to change so we\ncan add new features while respecting the stability of applications\nwhich have already been developed.\n\nTo always use the latest SimplyRETS content version, simply use\n`application/json` in your application `Accept` header.\n\nIf you want to pin your clients media type to a specific version,\nyou can use the vendor-specific SimplyRETS media type, e.g.\n`application/vnd.simplyrets-v0.1+json\"`\n\nTo view all valid content-types for making an `OPTIONS`, make a\nrequest to the SimplyRETS api root\n\n`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n\nThe default media types used in our API responses may change in the\nfuture. If you're building an application and care about the\nstability of the API, be sure to request a specific media type in the\nAccept header as shown in the examples below.\n\nThe wordpress plugin automatically sets the `Accept` header for the\ncompatible SimplyRETS media types.\n\n### Pagination\nThere a few pieces of useful information about each request stored\nin the HTTP Headers:\n\n- `X-Total-Count` shows you the total amount of listings that match\n your current query.\n- `Link` contains pre-built pagination links for accessing the next\n'page' of listings that match your query. Read more about that\n[here](https://simplyrets.com/blog/api-pagination.html).\n
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
5
 
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
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.
10
21
 
11
22
  =end
12
23
 
@@ -33,7 +44,7 @@ module SimplyRetsClient
33
44
  # Number of half bathrooms
34
45
  attr_accessor :baths_half
35
46
 
36
- # Number of stories or levels. Represented as a `double' to\naccount for half stories.\n
47
+ # Number of stories or levels. Represented as a `double' to account for half stories.
37
48
  attr_accessor :stories
38
49
 
39
50
  # Number of fireplaces
@@ -55,10 +66,10 @@ module SimplyRetsClient
55
66
 
56
67
  attr_accessor :lot_description
57
68
 
58
- # Lot size in acres\n\n**Added on 2016/05/04 - Not available for all RETS vendors**\n
69
+ # Lot size in acres **Added on 2016/05/04 - Not available for all RETS vendors**
59
70
  attr_accessor :lot_size_acres
60
71
 
61
- # The property's sub-type, i.e. SingleFamilyResidential,\nCondo, etc. Or a list of Sub Types for Mobile, such as\nExpando, Manufactured, Modular, etc.\n
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.
62
73
  attr_accessor :sub_type
63
74
 
64
75
  # Number of bedrooms
@@ -67,7 +78,7 @@ module SimplyRetsClient
67
78
  # The properties interior features
68
79
  attr_accessor :interior_features
69
80
 
70
- # Lot size dimensions or square footage as a text. This\nfield is generally used to show the pretty formatted\nlot size.\n
81
+ # Lot size dimensions or square footage as a text. This field is generally used to show the pretty formatted lot size.
71
82
  attr_accessor :lot_size
72
83
 
73
84
  attr_accessor :area_source
@@ -78,7 +89,7 @@ module SimplyRetsClient
78
89
  # Additional room information
79
90
  attr_accessor :additional_rooms
80
91
 
81
- # Exterior Features for the listing\n
92
+ # Exterior Features for the listing
82
93
  attr_accessor :exterior_features
83
94
 
84
95
  # Water description and details
@@ -87,7 +98,7 @@ module SimplyRetsClient
87
98
  # View details and description
88
99
  attr_accessor :view
89
100
 
90
- # The total area of the lot. See `lotSizeUnits` for the units\nof measurement (Square Feet, Square Meters, Acres, etc.).\n\n**Added on 2016/05/04 - Not available for all RETS vendors**\n
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**
91
102
  attr_accessor :lot_size_area
92
103
 
93
104
  # The subdivision or community name
@@ -98,10 +109,10 @@ module SimplyRetsClient
98
109
 
99
110
  attr_accessor :parking
100
111
 
101
- # Unit of measurement for the lotSizeArea field. e.g. Square\nFeet, Square Meters, Acres, etc.\n\nIf this field is `null` the units is the default unit\nof measure specified by your RETS provider.\n\n**Added on 2016/05/04 - Not available for all RETS vendors**\n
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**
102
113
  attr_accessor :lot_size_area_units
103
114
 
104
- # Abbreviated property type. RES is Residential, CND is CondoOrTownhome,\nRNT is Rental, MLF is Multi-Family, CRE is Commercial, LND is Land,\nFRM is Farm. See the `propertySubType` field for more information.\n
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.
105
116
  attr_accessor :type
106
117
 
107
118
  # Number of garage spaces
@@ -114,82 +125,67 @@ module SimplyRetsClient
114
125
  # Year the property was built
115
126
  attr_accessor :year_built
116
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
+
117
150
  # Attribute mapping from ruby-style variable name to JSON key.
118
151
  def self.attribute_map
119
152
  {
120
-
121
153
  :'roof' => :'roof',
122
-
123
154
  :'cooling' => :'cooling',
124
-
125
155
  :'style' => :'style',
126
-
127
156
  :'area' => :'area',
128
-
129
157
  :'baths_full' => :'bathsFull',
130
-
131
158
  :'baths_half' => :'bathsHalf',
132
-
133
159
  :'stories' => :'stories',
134
-
135
160
  :'fireplaces' => :'fireplaces',
136
-
137
161
  :'flooring' => :'flooring',
138
-
139
162
  :'heating' => :'heating',
140
-
141
163
  :'foundation' => :'foundation',
142
-
143
164
  :'pool_features' => :'poolFeatures',
144
-
145
165
  :'laundry_features' => :'laundryFeatures',
146
-
147
166
  :'occupant_name' => :'occupantName',
148
-
149
167
  :'lot_description' => :'lotDescription',
150
-
151
168
  :'lot_size_acres' => :'lotSizeAcres',
152
-
153
169
  :'sub_type' => :'subType',
154
-
155
170
  :'bedrooms' => :'bedrooms',
156
-
157
171
  :'interior_features' => :'interiorFeatures',
158
-
159
172
  :'lot_size' => :'lotSize',
160
-
161
173
  :'area_source' => :'areaSource',
162
-
163
174
  :'maintenance_expense' => :'maintenanceExpense',
164
-
165
175
  :'additional_rooms' => :'additionalRooms',
166
-
167
176
  :'exterior_features' => :'exteriorFeatures',
168
-
169
177
  :'water' => :'water',
170
-
171
178
  :'view' => :'view',
172
-
173
179
  :'lot_size_area' => :'lotSizeArea',
174
-
175
180
  :'subdivision' => :'subdivision',
176
-
177
181
  :'construction' => :'construction',
178
-
179
182
  :'parking' => :'parking',
180
-
181
183
  :'lot_size_area_units' => :'lotSizeAreaUnits',
182
-
183
184
  :'type' => :'type',
184
-
185
185
  :'garage_spaces' => :'garageSpaces',
186
-
187
186
  :'accessibility' => :'accessibility',
188
-
189
187
  :'occupant_type' => :'occupantType',
190
-
191
188
  :'year_built' => :'yearBuilt'
192
-
193
189
  }
194
190
  end
195
191
 
@@ -225,214 +221,197 @@ module SimplyRetsClient
225
221
  :'lot_size_area' => :'Float',
226
222
  :'subdivision' => :'String',
227
223
  :'construction' => :'String',
228
- :'parking' => :'School',
224
+ :'parking' => :'Parking',
229
225
  :'lot_size_area_units' => :'String',
230
226
  :'type' => :'String',
231
227
  :'garage_spaces' => :'Float',
232
228
  :'accessibility' => :'String',
233
229
  :'occupant_type' => :'String',
234
230
  :'year_built' => :'Integer'
235
-
236
231
  }
237
232
  end
238
233
 
234
+ # Initializes the object
235
+ # @param [Hash] attributes Model attributes in the form of hash
239
236
  def initialize(attributes = {})
240
237
  return unless attributes.is_a?(Hash)
241
238
 
242
239
  # convert string to symbol for hash key
243
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
244
-
240
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
245
241
 
246
- if attributes[:'roof']
242
+ if attributes.has_key?(:'roof')
247
243
  self.roof = attributes[:'roof']
248
- else
249
- self.roof = "Composition"
250
244
  end
251
245
 
252
- if attributes[:'cooling']
246
+ if attributes.has_key?(:'cooling')
253
247
  self.cooling = attributes[:'cooling']
254
248
  end
255
249
 
256
- if attributes[:'style']
250
+ if attributes.has_key?(:'style')
257
251
  self.style = attributes[:'style']
258
- else
259
- self.style = "Ranch, Traditional"
260
252
  end
261
253
 
262
- if attributes[:'area']
254
+ if attributes.has_key?(:'area')
263
255
  self.area = attributes[:'area']
264
- else
265
- self.area = 5984
266
256
  end
267
257
 
268
- if attributes[:'bathsFull']
258
+ if attributes.has_key?(:'bathsFull')
269
259
  self.baths_full = attributes[:'bathsFull']
270
260
  end
271
261
 
272
- if attributes[:'bathsHalf']
262
+ if attributes.has_key?(:'bathsHalf')
273
263
  self.baths_half = attributes[:'bathsHalf']
274
264
  end
275
265
 
276
- if attributes[:'stories']
266
+ if attributes.has_key?(:'stories')
277
267
  self.stories = attributes[:'stories']
278
- else
279
- self.stories = 2.0
280
268
  end
281
269
 
282
- if attributes[:'fireplaces']
270
+ if attributes.has_key?(:'fireplaces')
283
271
  self.fireplaces = attributes[:'fireplaces']
284
- else
285
- self.fireplaces = 1
286
272
  end
287
273
 
288
- if attributes[:'flooring']
274
+ if attributes.has_key?(:'flooring')
289
275
  self.flooring = attributes[:'flooring']
290
276
  end
291
277
 
292
- if attributes[:'heating']
278
+ if attributes.has_key?(:'heating')
293
279
  self.heating = attributes[:'heating']
294
- else
295
- self.heating = "Central System, Forced Air, Gas"
296
280
  end
297
281
 
298
- if attributes[:'foundation']
282
+ if attributes.has_key?(:'foundation')
299
283
  self.foundation = attributes[:'foundation']
300
284
  end
301
285
 
302
- if attributes[:'poolFeatures']
286
+ if attributes.has_key?(:'poolFeatures')
303
287
  self.pool_features = attributes[:'poolFeatures']
304
288
  end
305
289
 
306
- if attributes[:'laundryFeatures']
290
+ if attributes.has_key?(:'laundryFeatures')
307
291
  self.laundry_features = attributes[:'laundryFeatures']
308
292
  end
309
293
 
310
- if attributes[:'occupantName']
294
+ if attributes.has_key?(:'occupantName')
311
295
  self.occupant_name = attributes[:'occupantName']
312
296
  end
313
297
 
314
- if attributes[:'lotDescription']
298
+ if attributes.has_key?(:'lotDescription')
315
299
  self.lot_description = attributes[:'lotDescription']
316
300
  end
317
301
 
318
- if attributes[:'lotSizeAcres']
302
+ if attributes.has_key?(:'lotSizeAcres')
319
303
  self.lot_size_acres = attributes[:'lotSizeAcres']
320
- else
321
- self.lot_size_acres = 10.0
322
304
  end
323
305
 
324
- if attributes[:'subType']
306
+ if attributes.has_key?(:'subType')
325
307
  self.sub_type = attributes[:'subType']
326
308
  end
327
309
 
328
- if attributes[:'bedrooms']
310
+ if attributes.has_key?(:'bedrooms')
329
311
  self.bedrooms = attributes[:'bedrooms']
330
- else
331
- self.bedrooms = 5
332
312
  end
333
313
 
334
- if attributes[:'interiorFeatures']
314
+ if attributes.has_key?(:'interiorFeatures')
335
315
  self.interior_features = attributes[:'interiorFeatures']
336
- else
337
- self.interior_features = "2-Story Foyer,9 ft + Ceil Main,Cathedral Ceiling,Double Vnty\nOther,High Speed Internet Available,Entrance Foyer,Hardwood\nFloors,Trey Ceilings,Walk-In Closet(s),Wall/Wall Carpet\n"
338
316
  end
339
317
 
340
- if attributes[:'lotSize']
318
+ if attributes.has_key?(:'lotSize')
341
319
  self.lot_size = attributes[:'lotSize']
342
- else
343
- self.lot_size = "3/4 Up To 1 Acre"
344
320
  end
345
321
 
346
- if attributes[:'areaSource']
322
+ if attributes.has_key?(:'areaSource')
347
323
  self.area_source = attributes[:'areaSource']
348
- else
349
- self.area_source = "Tax Record"
350
324
  end
351
325
 
352
- if attributes[:'maintenanceExpense']
326
+ if attributes.has_key?(:'maintenanceExpense')
353
327
  self.maintenance_expense = attributes[:'maintenanceExpense']
354
328
  end
355
329
 
356
- if attributes[:'additionalRooms']
330
+ if attributes.has_key?(:'additionalRooms')
357
331
  self.additional_rooms = attributes[:'additionalRooms']
358
332
  end
359
333
 
360
- if attributes[:'exteriorFeatures']
334
+ if attributes.has_key?(:'exteriorFeatures')
361
335
  self.exterior_features = attributes[:'exteriorFeatures']
362
- else
363
- self.exterior_features = "1-2 Step Entry,Barn(s),Fenced Yard,Front Porch,Garden\nArea,Guest House,Out-Buildings,Patio,Prof Landscaping\n"
364
336
  end
365
337
 
366
- if attributes[:'water']
338
+ if attributes.has_key?(:'water')
367
339
  self.water = attributes[:'water']
368
340
  end
369
341
 
370
- if attributes[:'view']
342
+ if attributes.has_key?(:'view')
371
343
  self.view = attributes[:'view']
372
344
  end
373
345
 
374
- if attributes[:'lotSizeArea']
346
+ if attributes.has_key?(:'lotSizeArea')
375
347
  self.lot_size_area = attributes[:'lotSizeArea']
376
- else
377
- self.lot_size_area = 5000.0
378
348
  end
379
349
 
380
- if attributes[:'subdivision']
350
+ if attributes.has_key?(:'subdivision')
381
351
  self.subdivision = attributes[:'subdivision']
382
- else
383
- self.subdivision = "River Oaks"
384
352
  end
385
353
 
386
- if attributes[:'construction']
354
+ if attributes.has_key?(:'construction')
387
355
  self.construction = attributes[:'construction']
388
356
  end
389
357
 
390
- if attributes[:'parking']
358
+ if attributes.has_key?(:'parking')
391
359
  self.parking = attributes[:'parking']
392
360
  end
393
361
 
394
- if attributes[:'lotSizeAreaUnits']
362
+ if attributes.has_key?(:'lotSizeAreaUnits')
395
363
  self.lot_size_area_units = attributes[:'lotSizeAreaUnits']
396
- else
397
- self.lot_size_area_units = "Sq Ft"
398
364
  end
399
365
 
400
- if attributes[:'type']
366
+ if attributes.has_key?(:'type')
401
367
  self.type = attributes[:'type']
402
- else
403
- self.type = "RES"
404
368
  end
405
369
 
406
- if attributes[:'garageSpaces']
370
+ if attributes.has_key?(:'garageSpaces')
407
371
  self.garage_spaces = attributes[:'garageSpaces']
408
372
  end
409
373
 
410
- if attributes[:'accessibility']
374
+ if attributes.has_key?(:'accessibility')
411
375
  self.accessibility = attributes[:'accessibility']
412
376
  end
413
377
 
414
- if attributes[:'occupantType']
378
+ if attributes.has_key?(:'occupantType')
415
379
  self.occupant_type = attributes[:'occupantType']
416
380
  end
417
381
 
418
- if attributes[:'yearBuilt']
382
+ if attributes.has_key?(:'yearBuilt')
419
383
  self.year_built = attributes[:'yearBuilt']
420
- else
421
- self.year_built = 2007
422
384
  end
423
385
 
424
386
  end
425
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
+
426
403
  # Custom attribute writer method checking allowed values (enum).
404
+ # @param [Object] type Object to be assigned
427
405
  def type=(type)
428
- allowed_values = ["RES", "CND", "RNT", "MLF", "CRE", "LND", "FRM"]
429
- if type && !allowed_values.include?(type)
430
- fail "invalid value for 'type', must be one of #{allowed_values}"
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}."
431
409
  end
432
410
  @type = type
433
411
  end
434
412
 
435
- # Check equality by comparing each attribute.
413
+ # Checks equality by comparing each attribute.
414
+ # @param [Object] Object to be compared
436
415
  def ==(o)
437
416
  return true if self.equal?(o)
438
417
  self.class == o.class &&
@@ -475,35 +454,41 @@ module SimplyRetsClient
475
454
  end
476
455
 
477
456
  # @see the `==` method
457
+ # @param [Object] Object to be compared
478
458
  def eql?(o)
479
459
  self == o
480
460
  end
481
461
 
482
- # Calculate hash code according to all attributes.
462
+ # Calculates hash code according to all attributes.
463
+ # @return [Fixnum] Hash code
483
464
  def hash
484
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
485
466
  end
486
467
 
487
- # build the object from hash
468
+ # Builds the object from hash
469
+ # @param [Hash] attributes Model attributes in the form of hash
470
+ # @return [Object] Returns the model itself
488
471
  def build_from_hash(attributes)
489
472
  return nil unless attributes.is_a?(Hash)
490
473
  self.class.swagger_types.each_pair do |key, type|
491
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
492
477
  if attributes[self.class.attribute_map[key]].is_a?(Array)
493
478
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
494
- else
495
- #TODO show warning in debug mode
496
479
  end
497
480
  elsif !attributes[self.class.attribute_map[key]].nil?
498
481
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
499
- else
500
- # data not found in attributes(hash), not an issue as the data can be optional
501
- end
482
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
502
483
  end
503
484
 
504
485
  self
505
486
  end
506
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
507
492
  def _deserialize(type, value)
508
493
  case type.to_sym
509
494
  when :DateTime
@@ -537,21 +522,25 @@ module SimplyRetsClient
537
522
  end
538
523
  end
539
524
  else # model
540
- _model = SimplyRetsClient.const_get(type).new
541
- _model.build_from_hash(value)
525
+ temp_model = SimplyRetsClient.const_get(type).new
526
+ temp_model.build_from_hash(value)
542
527
  end
543
528
  end
544
529
 
530
+ # Returns the string representation of the object
531
+ # @return [String] String presentation of the object
545
532
  def to_s
546
533
  to_hash.to_s
547
534
  end
548
535
 
549
- # to_body is an alias to to_body (backward compatibility))
536
+ # to_body is an alias to to_hash (backward compatibility)
537
+ # @return [Hash] Returns the object in the form of hash
550
538
  def to_body
551
539
  to_hash
552
540
  end
553
541
 
554
- # return the object in the form of hash
542
+ # Returns the object in the form of hash
543
+ # @return [Hash] Returns the object in the form of hash
555
544
  def to_hash
556
545
  hash = {}
557
546
  self.class.attribute_map.each_pair do |attr, param|
@@ -562,8 +551,10 @@ module SimplyRetsClient
562
551
  hash
563
552
  end
564
553
 
565
- # Method to output non-array value in the form of hash
554
+ # Outputs non-array value in the form of hash
566
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
567
558
  def _to_hash(value)
568
559
  if value.is_a?(Array)
569
560
  value.compact.map{ |v| _to_hash(v) }
@@ -579,4 +570,5 @@ module SimplyRetsClient
579
570
  end
580
571
 
581
572
  end
573
+
582
574
  end