simplyrets 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -3
- data/Makefile +1 -2
- data/README.org +2 -0
- data/lib/simplyrets.rb +12 -1
- data/lib/simplyrets/api/default_api.rb +132 -128
- data/lib/simplyrets/api_client.rb +48 -9
- data/lib/simplyrets/api_client.rb.orig +373 -0
- data/lib/simplyrets/api_error.rb +12 -1
- data/lib/simplyrets/configuration.rb +23 -0
- data/lib/simplyrets/models/agent.rb +61 -27
- data/lib/simplyrets/models/broker.rb +57 -20
- data/lib/simplyrets/models/contact_information.rb +62 -27
- data/lib/simplyrets/models/error.rb +59 -23
- data/lib/simplyrets/models/geographic_data.rb +61 -28
- data/lib/simplyrets/models/listing.rb +94 -70
- data/lib/simplyrets/models/mls_information.rb +95 -37
- data/lib/simplyrets/models/office.rb +62 -28
- data/lib/simplyrets/models/open_house.rb +66 -36
- data/lib/simplyrets/models/parking.rb +59 -24
- data/lib/simplyrets/models/property.rb +128 -136
- data/lib/simplyrets/models/sales.rb +61 -28
- data/lib/simplyrets/models/school.rb +60 -34
- data/lib/simplyrets/models/street_address.rb +66 -55
- data/lib/simplyrets/models/tax.rb +70 -35
- data/lib/simplyrets/version.rb +13 -2
- data/ruby-client.meta +1 -0
- data/ruby-client.zip +0 -0
- data/ruby-client/.gitignore +50 -0
- data/ruby-client/.rspec +2 -0
- data/ruby-client/.swagger-codegen-ignore +23 -0
- data/ruby-client/LICENSE +201 -0
- data/ruby-client/README.md +128 -0
- data/ruby-client/docs/Agent.md +11 -0
- data/ruby-client/docs/Broker.md +8 -0
- data/ruby-client/docs/ContactInformation.md +10 -0
- data/ruby-client/docs/DefaultApi.md +306 -0
- data/ruby-client/docs/Error.md +9 -0
- data/ruby-client/docs/GeographicData.md +12 -0
- data/ruby-client/docs/Listing.md +30 -0
- data/ruby-client/docs/MlsInformation.md +11 -0
- data/ruby-client/docs/Office.md +11 -0
- data/ruby-client/docs/OpenHouse.md +15 -0
- data/ruby-client/docs/Parking.md +10 -0
- data/ruby-client/docs/Property.md +43 -0
- data/ruby-client/docs/Sales.md +12 -0
- data/ruby-client/docs/School.md +11 -0
- data/ruby-client/docs/StreetAddress.md +16 -0
- data/ruby-client/docs/Tax.md +10 -0
- data/ruby-client/git_push.sh +67 -0
- data/ruby-client/lib/swagger_client.rb +66 -0
- data/ruby-client/lib/swagger_client/api/default_api.rb +383 -0
- data/ruby-client/lib/swagger_client/api_client.rb +373 -0
- data/ruby-client/lib/swagger_client/api_error.rb +47 -0
- data/ruby-client/lib/swagger_client/configuration.rb +193 -0
- data/ruby-client/lib/swagger_client/models/agent.rb +230 -0
- data/ruby-client/lib/swagger_client/models/broker.rb +200 -0
- data/ruby-client/lib/swagger_client/models/contact_information.rb +220 -0
- data/ruby-client/lib/swagger_client/models/error.rb +210 -0
- data/ruby-client/lib/swagger_client/models/geographic_data.rb +240 -0
- data/ruby-client/lib/swagger_client/models/listing.rb +422 -0
- data/ruby-client/lib/swagger_client/models/mls_information.rb +263 -0
- data/ruby-client/lib/swagger_client/models/office.rb +230 -0
- data/ruby-client/lib/swagger_client/models/open_house.rb +270 -0
- data/ruby-client/lib/swagger_client/models/parking.rb +219 -0
- data/ruby-client/lib/swagger_client/models/property.rb +574 -0
- data/ruby-client/lib/swagger_client/models/sales.rb +240 -0
- data/ruby-client/lib/swagger_client/models/school.rb +230 -0
- data/ruby-client/lib/swagger_client/models/street_address.rb +280 -0
- data/ruby-client/lib/swagger_client/models/tax.rb +220 -0
- data/ruby-client/lib/swagger_client/version.rb +26 -0
- data/ruby-client/spec/api/default_api_spec.rb +132 -0
- data/ruby-client/spec/api_client_spec.rb +296 -0
- data/ruby-client/spec/configuration_spec.rb +48 -0
- data/ruby-client/spec/models/agent_spec.rb +71 -0
- data/ruby-client/spec/models/broker_spec.rb +53 -0
- data/ruby-client/spec/models/contact_information_spec.rb +65 -0
- data/ruby-client/spec/models/error_spec.rb +59 -0
- data/ruby-client/spec/models/geographic_data_spec.rb +77 -0
- data/ruby-client/spec/models/listing_spec.rb +185 -0
- data/ruby-client/spec/models/mls_information_spec.rb +74 -0
- data/ruby-client/spec/models/office_spec.rb +71 -0
- data/ruby-client/spec/models/open_house_spec.rb +95 -0
- data/ruby-client/spec/models/parking_spec.rb +65 -0
- data/ruby-client/spec/models/property_spec.rb +266 -0
- data/ruby-client/spec/models/sales_spec.rb +77 -0
- data/ruby-client/spec/models/school_spec.rb +71 -0
- data/ruby-client/spec/models/street_address_spec.rb +101 -0
- data/ruby-client/spec/models/tax_spec.rb +65 -0
- data/ruby-client/spec/spec_helper.rb +122 -0
- data/ruby-client/swagger_client.gemspec +55 -0
- data/simplyrets.gemspec +1 -1
- 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
|
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.
|
67
|
-
|
73
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
68
74
|
|
69
|
-
if attributes
|
75
|
+
if attributes.has_key?(:'closeDate')
|
70
76
|
self.close_date = attributes[:'closeDate']
|
71
77
|
end
|
72
78
|
|
73
|
-
if attributes
|
79
|
+
if attributes.has_key?(:'office')
|
74
80
|
self.office = attributes[:'office']
|
75
81
|
end
|
76
82
|
|
77
|
-
if attributes
|
83
|
+
if attributes.has_key?(:'closePrice')
|
78
84
|
self.close_price = attributes[:'closePrice']
|
79
85
|
end
|
80
86
|
|
81
|
-
if attributes
|
87
|
+
if attributes.has_key?(:'agent')
|
82
88
|
self.agent = attributes[:'agent']
|
83
89
|
end
|
84
90
|
|
85
|
-
if attributes
|
91
|
+
if attributes.has_key?(:'contractDate')
|
86
92
|
self.contract_date = attributes[:'contractDate']
|
87
93
|
end
|
88
94
|
|
89
95
|
end
|
90
96
|
|
91
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
|
166
|
-
|
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
|
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
|
-
#
|
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
|
-
#
|
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
|
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.
|
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
|
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
|
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
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
|
163
|
-
|
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
|
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
|
-
#
|
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
|
-
#
|
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
|
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
|
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.
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
|
228
|
-
|
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
|
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
|
-
#
|
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
|
-
#
|
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
|