simplyrets 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
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
 
@@ -30,20 +41,15 @@ module SimplyRetsClient
30
41
  # RETS Sales data contract date
31
42
  attr_accessor :contract_date
32
43
 
44
+
33
45
  # Attribute mapping from ruby-style variable name to JSON key.
34
46
  def self.attribute_map
35
47
  {
36
-
37
48
  :'close_date' => :'closeDate',
38
-
39
49
  :'office' => :'office',
40
-
41
50
  :'close_price' => :'closePrice',
42
-
43
51
  :'agent' => :'agent',
44
-
45
52
  :'contract_date' => :'contractDate'
46
-
47
53
  }
48
54
  end
49
55
 
@@ -55,40 +61,54 @@ module SimplyRetsClient
55
61
  :'close_price' => :'Integer',
56
62
  :'agent' => :'String',
57
63
  :'contract_date' => :'DateTime'
58
-
59
64
  }
60
65
  end
61
66
 
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
62
69
  def initialize(attributes = {})
63
70
  return unless attributes.is_a?(Hash)
64
71
 
65
72
  # convert string to symbol for hash key
66
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
67
-
73
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
68
74
 
69
- if attributes[:'closeDate']
75
+ if attributes.has_key?(:'closeDate')
70
76
  self.close_date = attributes[:'closeDate']
71
77
  end
72
78
 
73
- if attributes[:'office']
79
+ if attributes.has_key?(:'office')
74
80
  self.office = attributes[:'office']
75
81
  end
76
82
 
77
- if attributes[:'closePrice']
83
+ if attributes.has_key?(:'closePrice')
78
84
  self.close_price = attributes[:'closePrice']
79
85
  end
80
86
 
81
- if attributes[:'agent']
87
+ if attributes.has_key?(:'agent')
82
88
  self.agent = attributes[:'agent']
83
89
  end
84
90
 
85
- if attributes[:'contractDate']
91
+ if attributes.has_key?(:'contractDate')
86
92
  self.contract_date = attributes[:'contractDate']
87
93
  end
88
94
 
89
95
  end
90
96
 
91
- # Check equality by comparing each attribute.
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properies with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ return invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ return true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
92
112
  def ==(o)
93
113
  return true if self.equal?(o)
94
114
  self.class == o.class &&
@@ -100,35 +120,41 @@ module SimplyRetsClient
100
120
  end
101
121
 
102
122
  # @see the `==` method
123
+ # @param [Object] Object to be compared
103
124
  def eql?(o)
104
125
  self == o
105
126
  end
106
127
 
107
- # Calculate hash code according to all attributes.
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Fixnum] Hash code
108
130
  def hash
109
131
  [close_date, office, close_price, agent, contract_date].hash
110
132
  end
111
133
 
112
- # build the object from hash
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
113
137
  def build_from_hash(attributes)
114
138
  return nil unless attributes.is_a?(Hash)
115
139
  self.class.swagger_types.each_pair do |key, type|
116
140
  if type =~ /^Array<(.*)>/i
141
+ # check to ensure the input is an array given that the the attribute
142
+ # is documented as an array but the input is not
117
143
  if attributes[self.class.attribute_map[key]].is_a?(Array)
118
144
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
119
- else
120
- #TODO show warning in debug mode
121
145
  end
122
146
  elsif !attributes[self.class.attribute_map[key]].nil?
123
147
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
- else
125
- # data not found in attributes(hash), not an issue as the data can be optional
126
- end
148
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
127
149
  end
128
150
 
129
151
  self
130
152
  end
131
153
 
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
132
158
  def _deserialize(type, value)
133
159
  case type.to_sym
134
160
  when :DateTime
@@ -162,21 +188,25 @@ module SimplyRetsClient
162
188
  end
163
189
  end
164
190
  else # model
165
- _model = SimplyRetsClient.const_get(type).new
166
- _model.build_from_hash(value)
191
+ temp_model = SimplyRetsClient.const_get(type).new
192
+ temp_model.build_from_hash(value)
167
193
  end
168
194
  end
169
195
 
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
170
198
  def to_s
171
199
  to_hash.to_s
172
200
  end
173
201
 
174
- # to_body is an alias to to_body (backward compatibility))
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
175
204
  def to_body
176
205
  to_hash
177
206
  end
178
207
 
179
- # return the object in the form of hash
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
180
210
  def to_hash
181
211
  hash = {}
182
212
  self.class.attribute_map.each_pair do |attr, param|
@@ -187,8 +217,10 @@ module SimplyRetsClient
187
217
  hash
188
218
  end
189
219
 
190
- # Method to output non-array value in the form of hash
220
+ # Outputs non-array value in the form of hash
191
221
  # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
192
224
  def _to_hash(value)
193
225
  if value.is_a?(Array)
194
226
  value.compact.map{ |v| _to_hash(v) }
@@ -204,4 +236,5 @@ module SimplyRetsClient
204
236
  end
205
237
 
206
238
  end
239
+
207
240
  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
 
@@ -27,18 +38,14 @@ module SimplyRetsClient
27
38
  # School district name.
28
39
  attr_accessor :district
29
40
 
41
+
30
42
  # Attribute mapping from ruby-style variable name to JSON key.
31
43
  def self.attribute_map
32
44
  {
33
-
34
45
  :'middle_school' => :'middleSchool',
35
-
36
46
  :'high_school' => :'highSchool',
37
-
38
47
  :'elementary_school' => :'elementarySchool',
39
-
40
48
  :'district' => :'district'
41
-
42
49
  }
43
50
  end
44
51
 
@@ -49,44 +56,50 @@ module SimplyRetsClient
49
56
  :'high_school' => :'String',
50
57
  :'elementary_school' => :'String',
51
58
  :'district' => :'String'
52
-
53
59
  }
54
60
  end
55
61
 
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
56
64
  def initialize(attributes = {})
57
65
  return unless attributes.is_a?(Hash)
58
66
 
59
67
  # convert string to symbol for hash key
60
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
68
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
61
69
 
62
-
63
- if attributes[:'middleSchool']
70
+ if attributes.has_key?(:'middleSchool')
64
71
  self.middle_school = attributes[:'middleSchool']
65
- else
66
- self.middle_school = "Middle School"
67
72
  end
68
73
 
69
- if attributes[:'highSchool']
74
+ if attributes.has_key?(:'highSchool')
70
75
  self.high_school = attributes[:'highSchool']
71
- else
72
- self.high_school = "High School"
73
76
  end
74
77
 
75
- if attributes[:'elementarySchool']
78
+ if attributes.has_key?(:'elementarySchool')
76
79
  self.elementary_school = attributes[:'elementarySchool']
77
- else
78
- self.elementary_school = "Elementary School"
79
80
  end
80
81
 
81
- if attributes[:'district']
82
+ if attributes.has_key?(:'district')
82
83
  self.district = attributes[:'district']
83
- else
84
- self.district = "School District"
85
84
  end
86
85
 
87
86
  end
88
87
 
89
- # Check equality by comparing each attribute.
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properies with the reasons
90
+ def list_invalid_properties
91
+ invalid_properties = Array.new
92
+ return invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ return true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
90
103
  def ==(o)
91
104
  return true if self.equal?(o)
92
105
  self.class == o.class &&
@@ -97,35 +110,41 @@ module SimplyRetsClient
97
110
  end
98
111
 
99
112
  # @see the `==` method
113
+ # @param [Object] Object to be compared
100
114
  def eql?(o)
101
115
  self == o
102
116
  end
103
117
 
104
- # Calculate hash code according to all attributes.
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Fixnum] Hash code
105
120
  def hash
106
121
  [middle_school, high_school, elementary_school, district].hash
107
122
  end
108
123
 
109
- # build the object from hash
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
110
127
  def build_from_hash(attributes)
111
128
  return nil unless attributes.is_a?(Hash)
112
129
  self.class.swagger_types.each_pair do |key, type|
113
130
  if type =~ /^Array<(.*)>/i
131
+ # check to ensure the input is an array given that the the attribute
132
+ # is documented as an array but the input is not
114
133
  if attributes[self.class.attribute_map[key]].is_a?(Array)
115
134
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
116
- else
117
- #TODO show warning in debug mode
118
135
  end
119
136
  elsif !attributes[self.class.attribute_map[key]].nil?
120
137
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
- else
122
- # data not found in attributes(hash), not an issue as the data can be optional
123
- end
138
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
124
139
  end
125
140
 
126
141
  self
127
142
  end
128
143
 
144
+ # Deserializes the data based on type
145
+ # @param string type Data type
146
+ # @param string value Value to be deserialized
147
+ # @return [Object] Deserialized data
129
148
  def _deserialize(type, value)
130
149
  case type.to_sym
131
150
  when :DateTime
@@ -159,21 +178,25 @@ module SimplyRetsClient
159
178
  end
160
179
  end
161
180
  else # model
162
- _model = SimplyRetsClient.const_get(type).new
163
- _model.build_from_hash(value)
181
+ temp_model = SimplyRetsClient.const_get(type).new
182
+ temp_model.build_from_hash(value)
164
183
  end
165
184
  end
166
185
 
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
167
188
  def to_s
168
189
  to_hash.to_s
169
190
  end
170
191
 
171
- # to_body is an alias to to_body (backward compatibility))
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
172
194
  def to_body
173
195
  to_hash
174
196
  end
175
197
 
176
- # return the object in the form of hash
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
177
200
  def to_hash
178
201
  hash = {}
179
202
  self.class.attribute_map.each_pair do |attr, param|
@@ -184,8 +207,10 @@ module SimplyRetsClient
184
207
  hash
185
208
  end
186
209
 
187
- # Method to output non-array value in the form of hash
210
+ # Outputs non-array value in the form of hash
188
211
  # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
189
214
  def _to_hash(value)
190
215
  if value.is_a?(Array)
191
216
  value.compact.map{ |v| _to_hash(v) }
@@ -201,4 +226,5 @@ module SimplyRetsClient
201
226
  end
202
227
 
203
228
  end
229
+
204
230
  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
 
@@ -30,7 +41,7 @@ module SimplyRetsClient
30
41
  # Name of the street
31
42
  attr_accessor :street_name
32
43
 
33
- # Textual representation of the street number. This field\nis usually redundant with what's in `streetNumber` but is\noccassionally usefuly for street number which are actually\nalpha-numerical. For example, \"N63453\" or \"34556B\".\n\n**Added on 2016/05/02**\n
44
+ # Textual representation of the street number. This field is usually redundant with what's in `streetNumber` but is occassionally usefuly for street number which are actually alpha-numerical. For example, \"N63453\" or \"34556B\". **Added on 2016/05/02**
34
45
  attr_accessor :street_number_text
35
46
 
36
47
  # City name
@@ -42,28 +53,19 @@ module SimplyRetsClient
42
53
  # Full pretty-printed address with suffix (if available)
43
54
  attr_accessor :full
44
55
 
56
+
45
57
  # Attribute mapping from ruby-style variable name to JSON key.
46
58
  def self.attribute_map
47
59
  {
48
-
49
60
  :'cross_street' => :'crossStreet',
50
-
51
61
  :'state' => :'state',
52
-
53
62
  :'country' => :'country',
54
-
55
63
  :'postal_code' => :'postalCode',
56
-
57
64
  :'street_name' => :'streetName',
58
-
59
65
  :'street_number_text' => :'streetNumberText',
60
-
61
66
  :'city' => :'city',
62
-
63
67
  :'street_number' => :'streetNumber',
64
-
65
68
  :'full' => :'full'
66
-
67
69
  }
68
70
  end
69
71
 
@@ -79,74 +81,70 @@ module SimplyRetsClient
79
81
  :'city' => :'String',
80
82
  :'street_number' => :'Integer',
81
83
  :'full' => :'String'
82
-
83
84
  }
84
85
  end
85
86
 
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
86
89
  def initialize(attributes = {})
87
90
  return unless attributes.is_a?(Hash)
88
91
 
89
92
  # convert string to symbol for hash key
90
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
93
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
91
94
 
92
-
93
- if attributes[:'crossStreet']
95
+ if attributes.has_key?(:'crossStreet')
94
96
  self.cross_street = attributes[:'crossStreet']
95
- else
96
- self.cross_street = "456 Cross Rd"
97
97
  end
98
98
 
99
- if attributes[:'state']
99
+ if attributes.has_key?(:'state')
100
100
  self.state = attributes[:'state']
101
- else
102
- self.state = "Texas"
103
101
  end
104
102
 
105
- if attributes[:'country']
103
+ if attributes.has_key?(:'country')
106
104
  self.country = attributes[:'country']
107
- else
108
- self.country = "United States"
109
105
  end
110
106
 
111
- if attributes[:'postalCode']
107
+ if attributes.has_key?(:'postalCode')
112
108
  self.postal_code = attributes[:'postalCode']
113
- else
114
- self.postal_code = "77324"
115
109
  end
116
110
 
117
- if attributes[:'streetName']
111
+ if attributes.has_key?(:'streetName')
118
112
  self.street_name = attributes[:'streetName']
119
- else
120
- self.street_name = "SimplyRETS Drive"
121
113
  end
122
114
 
123
- if attributes[:'streetNumberText']
115
+ if attributes.has_key?(:'streetNumberText')
124
116
  self.street_number_text = attributes[:'streetNumberText']
125
- else
126
- self.street_number_text = "1234"
127
117
  end
128
118
 
129
- if attributes[:'city']
119
+ if attributes.has_key?(:'city')
130
120
  self.city = attributes[:'city']
131
- else
132
- self.city = "Houston"
133
121
  end
134
122
 
135
- if attributes[:'streetNumber']
123
+ if attributes.has_key?(:'streetNumber')
136
124
  self.street_number = attributes[:'streetNumber']
137
- else
138
- self.street_number = 1234
139
125
  end
140
126
 
141
- if attributes[:'full']
127
+ if attributes.has_key?(:'full')
142
128
  self.full = attributes[:'full']
143
- else
144
- self.full = "1234 SimplyRETS Drive"
145
129
  end
146
130
 
147
131
  end
148
132
 
149
- # Check equality by comparing each attribute.
133
+ # Show invalid properties with the reasons. Usually used together with valid?
134
+ # @return Array for valid properies with the reasons
135
+ def list_invalid_properties
136
+ invalid_properties = Array.new
137
+ return invalid_properties
138
+ end
139
+
140
+ # Check to see if the all the properties in the model are valid
141
+ # @return true if the model is valid
142
+ def valid?
143
+ return true
144
+ end
145
+
146
+ # Checks equality by comparing each attribute.
147
+ # @param [Object] Object to be compared
150
148
  def ==(o)
151
149
  return true if self.equal?(o)
152
150
  self.class == o.class &&
@@ -162,35 +160,41 @@ module SimplyRetsClient
162
160
  end
163
161
 
164
162
  # @see the `==` method
163
+ # @param [Object] Object to be compared
165
164
  def eql?(o)
166
165
  self == o
167
166
  end
168
167
 
169
- # Calculate hash code according to all attributes.
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Fixnum] Hash code
170
170
  def hash
171
171
  [cross_street, state, country, postal_code, street_name, street_number_text, city, street_number, full].hash
172
172
  end
173
173
 
174
- # build the object from hash
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
175
177
  def build_from_hash(attributes)
176
178
  return nil unless attributes.is_a?(Hash)
177
179
  self.class.swagger_types.each_pair do |key, type|
178
180
  if type =~ /^Array<(.*)>/i
181
+ # check to ensure the input is an array given that the the attribute
182
+ # is documented as an array but the input is not
179
183
  if attributes[self.class.attribute_map[key]].is_a?(Array)
180
184
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
181
- else
182
- #TODO show warning in debug mode
183
185
  end
184
186
  elsif !attributes[self.class.attribute_map[key]].nil?
185
187
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
- else
187
- # data not found in attributes(hash), not an issue as the data can be optional
188
- end
188
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
189
189
  end
190
190
 
191
191
  self
192
192
  end
193
193
 
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
194
198
  def _deserialize(type, value)
195
199
  case type.to_sym
196
200
  when :DateTime
@@ -224,21 +228,25 @@ module SimplyRetsClient
224
228
  end
225
229
  end
226
230
  else # model
227
- _model = SimplyRetsClient.const_get(type).new
228
- _model.build_from_hash(value)
231
+ temp_model = SimplyRetsClient.const_get(type).new
232
+ temp_model.build_from_hash(value)
229
233
  end
230
234
  end
231
235
 
236
+ # Returns the string representation of the object
237
+ # @return [String] String presentation of the object
232
238
  def to_s
233
239
  to_hash.to_s
234
240
  end
235
241
 
236
- # to_body is an alias to to_body (backward compatibility))
242
+ # to_body is an alias to to_hash (backward compatibility)
243
+ # @return [Hash] Returns the object in the form of hash
237
244
  def to_body
238
245
  to_hash
239
246
  end
240
247
 
241
- # return the object in the form of hash
248
+ # Returns the object in the form of hash
249
+ # @return [Hash] Returns the object in the form of hash
242
250
  def to_hash
243
251
  hash = {}
244
252
  self.class.attribute_map.each_pair do |attr, param|
@@ -249,8 +257,10 @@ module SimplyRetsClient
249
257
  hash
250
258
  end
251
259
 
252
- # Method to output non-array value in the form of hash
260
+ # Outputs non-array value in the form of hash
253
261
  # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
254
264
  def _to_hash(value)
255
265
  if value.is_a?(Array)
256
266
  value.compact.map{ |v| _to_hash(v) }
@@ -266,4 +276,5 @@ module SimplyRetsClient
266
276
  end
267
277
 
268
278
  end
279
+
269
280
  end