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
|
|
@@ -15,20 +26,18 @@ require 'date'
|
|
15
26
|
module SimplyRetsClient
|
16
27
|
# Error information
|
17
28
|
class Error
|
18
|
-
# Error code. In general, we try to adhere to HTTP status code
|
29
|
+
# Error code. In general, we try to adhere to HTTP status code and use these error statuses for detailed reporting.
|
19
30
|
attr_accessor :error
|
20
31
|
|
21
32
|
# Status message with an explanation of the error
|
22
33
|
attr_accessor :message
|
23
34
|
|
35
|
+
|
24
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
25
37
|
def self.attribute_map
|
26
38
|
{
|
27
|
-
|
28
39
|
:'error' => :'error',
|
29
|
-
|
30
40
|
:'message' => :'message'
|
31
|
-
|
32
41
|
}
|
33
42
|
end
|
34
43
|
|
@@ -37,28 +46,42 @@ module SimplyRetsClient
|
|
37
46
|
{
|
38
47
|
:'error' => :'Integer',
|
39
48
|
:'message' => :'String'
|
40
|
-
|
41
49
|
}
|
42
50
|
end
|
43
51
|
|
52
|
+
# Initializes the object
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
44
54
|
def initialize(attributes = {})
|
45
55
|
return unless attributes.is_a?(Hash)
|
46
56
|
|
47
57
|
# convert string to symbol for hash key
|
48
|
-
attributes = attributes.
|
49
|
-
|
58
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
50
59
|
|
51
|
-
if attributes
|
60
|
+
if attributes.has_key?(:'error')
|
52
61
|
self.error = attributes[:'error']
|
53
62
|
end
|
54
63
|
|
55
|
-
if attributes
|
64
|
+
if attributes.has_key?(:'message')
|
56
65
|
self.message = attributes[:'message']
|
57
66
|
end
|
58
67
|
|
59
68
|
end
|
60
69
|
|
61
|
-
#
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properies with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
return invalid_properties
|
75
|
+
end
|
76
|
+
|
77
|
+
# Check to see if the all the properties in the model are valid
|
78
|
+
# @return true if the model is valid
|
79
|
+
def valid?
|
80
|
+
return true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
62
85
|
def ==(o)
|
63
86
|
return true if self.equal?(o)
|
64
87
|
self.class == o.class &&
|
@@ -67,35 +90,41 @@ module SimplyRetsClient
|
|
67
90
|
end
|
68
91
|
|
69
92
|
# @see the `==` method
|
93
|
+
# @param [Object] Object to be compared
|
70
94
|
def eql?(o)
|
71
95
|
self == o
|
72
96
|
end
|
73
97
|
|
74
|
-
#
|
98
|
+
# Calculates hash code according to all attributes.
|
99
|
+
# @return [Fixnum] Hash code
|
75
100
|
def hash
|
76
101
|
[error, message].hash
|
77
102
|
end
|
78
103
|
|
79
|
-
#
|
104
|
+
# Builds the object from hash
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
# @return [Object] Returns the model itself
|
80
107
|
def build_from_hash(attributes)
|
81
108
|
return nil unless attributes.is_a?(Hash)
|
82
109
|
self.class.swagger_types.each_pair do |key, type|
|
83
110
|
if type =~ /^Array<(.*)>/i
|
111
|
+
# check to ensure the input is an array given that the the attribute
|
112
|
+
# is documented as an array but the input is not
|
84
113
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
85
114
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
86
|
-
else
|
87
|
-
#TODO show warning in debug mode
|
88
115
|
end
|
89
116
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
90
117
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
91
|
-
else
|
92
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
93
|
-
end
|
118
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
94
119
|
end
|
95
120
|
|
96
121
|
self
|
97
122
|
end
|
98
123
|
|
124
|
+
# Deserializes the data based on type
|
125
|
+
# @param string type Data type
|
126
|
+
# @param string value Value to be deserialized
|
127
|
+
# @return [Object] Deserialized data
|
99
128
|
def _deserialize(type, value)
|
100
129
|
case type.to_sym
|
101
130
|
when :DateTime
|
@@ -129,21 +158,25 @@ module SimplyRetsClient
|
|
129
158
|
end
|
130
159
|
end
|
131
160
|
else # model
|
132
|
-
|
133
|
-
|
161
|
+
temp_model = SimplyRetsClient.const_get(type).new
|
162
|
+
temp_model.build_from_hash(value)
|
134
163
|
end
|
135
164
|
end
|
136
165
|
|
166
|
+
# Returns the string representation of the object
|
167
|
+
# @return [String] String presentation of the object
|
137
168
|
def to_s
|
138
169
|
to_hash.to_s
|
139
170
|
end
|
140
171
|
|
141
|
-
# to_body is an alias to
|
172
|
+
# to_body is an alias to to_hash (backward compatibility)
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
142
174
|
def to_body
|
143
175
|
to_hash
|
144
176
|
end
|
145
177
|
|
146
|
-
#
|
178
|
+
# Returns the object in the form of hash
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
147
180
|
def to_hash
|
148
181
|
hash = {}
|
149
182
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -154,8 +187,10 @@ module SimplyRetsClient
|
|
154
187
|
hash
|
155
188
|
end
|
156
189
|
|
157
|
-
#
|
190
|
+
# Outputs non-array value in the form of hash
|
158
191
|
# For object, use to_hash. Otherwise, just return the value
|
192
|
+
# @param [Object] value Any valid value
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
159
194
|
def _to_hash(value)
|
160
195
|
if value.is_a?(Array)
|
161
196
|
value.compact.map{ |v| _to_hash(v) }
|
@@ -171,4 +206,5 @@ module SimplyRetsClient
|
|
171
206
|
end
|
172
207
|
|
173
208
|
end
|
209
|
+
|
174
210
|
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,20 +41,15 @@ module SimplyRetsClient
|
|
30
41
|
# Directions to the property
|
31
42
|
attr_accessor :directions
|
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
|
:'county' => :'county',
|
38
|
-
|
39
49
|
:'lat' => :'lat',
|
40
|
-
|
41
50
|
:'lng' => :'lng',
|
42
|
-
|
43
51
|
:'market_area' => :'marketArea',
|
44
|
-
|
45
52
|
:'directions' => :'directions'
|
46
|
-
|
47
53
|
}
|
48
54
|
end
|
49
55
|
|
@@ -55,40 +61,54 @@ module SimplyRetsClient
|
|
55
61
|
:'lng' => :'Float',
|
56
62
|
:'market_area' => :'String',
|
57
63
|
:'directions' => :'String'
|
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?(:'county')
|
70
76
|
self.county = attributes[:'county']
|
71
77
|
end
|
72
78
|
|
73
|
-
if attributes
|
79
|
+
if attributes.has_key?(:'lat')
|
74
80
|
self.lat = attributes[:'lat']
|
75
81
|
end
|
76
82
|
|
77
|
-
if attributes
|
83
|
+
if attributes.has_key?(:'lng')
|
78
84
|
self.lng = attributes[:'lng']
|
79
85
|
end
|
80
86
|
|
81
|
-
if attributes
|
87
|
+
if attributes.has_key?(:'marketArea')
|
82
88
|
self.market_area = attributes[:'marketArea']
|
83
89
|
end
|
84
90
|
|
85
|
-
if attributes
|
91
|
+
if attributes.has_key?(:'directions')
|
86
92
|
self.directions = attributes[:'directions']
|
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
|
[county, lat, lng, market_area, directions].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
|
|
@@ -21,7 +32,7 @@ module SimplyRetsClient
|
|
21
32
|
# Specific property data associated with listing.
|
22
33
|
attr_accessor :property
|
23
34
|
|
24
|
-
# A unique identifier for this listing specific to the
|
35
|
+
# A unique identifier for this listing specific to the SimplyRETS API. Thie identifier is specific to the SimplyRETS api and has no correlation with the MLS number. Use this id when making requests to the single listing endpoint (eg, `/properties/{mlsId}`). Applications should not rely on specific `mlsId`s being present. Instead, apps should dynamically use the `mlsId` after using other more general query parameters. Many mls vendors require listings which are expired, terminated or sold to be purged, which will render calls to specific `mlsId`s to return nothing (or possibly a 404).
|
25
36
|
attr_accessor :mls_id
|
26
37
|
|
27
38
|
# Public instructions for showing the property.
|
@@ -33,7 +44,7 @@ module SimplyRetsClient
|
|
33
44
|
# Represents the length of the lease.
|
34
45
|
attr_accessor :lease_term
|
35
46
|
|
36
|
-
# Data accuracy disclaimer. The value in the disclaimer may
|
47
|
+
# Data accuracy disclaimer. The value in the disclaimer may change depending on your MLS vendors rules.
|
37
48
|
attr_accessor :disclaimer
|
38
49
|
|
39
50
|
# Comprehensive property address information
|
@@ -51,13 +62,13 @@ module SimplyRetsClient
|
|
51
62
|
# Comprehensive school zone data
|
52
63
|
attr_accessor :school
|
53
64
|
|
54
|
-
# Photos of the property. Images are served over https and are
|
65
|
+
# Photos of the property. Images are served over https and are suitable for production use on secure websites
|
55
66
|
attr_accessor :photos
|
56
67
|
|
57
68
|
# Price of the listing
|
58
69
|
attr_accessor :list_price
|
59
70
|
|
60
|
-
# Data Dictionary v1.3 ListingId. The well known identifier
|
71
|
+
# Data Dictionary v1.3 ListingId. The well known identifier for the listing. The value is the id or number by the MLS as a public identifier for the listing. This identifier should not be confused with the `mlsId`, which is specific to the SimplyRETS API.
|
61
72
|
attr_accessor :listing_id
|
62
73
|
|
63
74
|
# MLS vendor information and data
|
@@ -69,66 +80,48 @@ module SimplyRetsClient
|
|
69
80
|
# Associate tax data
|
70
81
|
attr_accessor :tax
|
71
82
|
|
83
|
+
# co-listing agent information. *NOTE*: If your RETS feed stores co-list information outside of the `Property` resource, co-list agent information will not be available.
|
84
|
+
attr_accessor :co_agent
|
85
|
+
|
72
86
|
# Sales data
|
73
87
|
attr_accessor :sales
|
74
88
|
|
75
89
|
# Information about the status of the existing lease on the property.
|
76
90
|
attr_accessor :lease_type
|
77
91
|
|
78
|
-
# The URL for an unbranded virtual tour of the property
|
92
|
+
# The URL for an unbranded virtual tour of the property. **Added on 2016/05/04 - Not available for all RETS vendors**
|
79
93
|
attr_accessor :virtual_tour_url
|
80
94
|
|
81
95
|
# Description or remarks
|
82
96
|
attr_accessor :remarks
|
83
97
|
|
98
|
+
|
84
99
|
# Attribute mapping from ruby-style variable name to JSON key.
|
85
100
|
def self.attribute_map
|
86
101
|
{
|
87
|
-
|
88
102
|
:'private_remarks' => :'privateRemarks',
|
89
|
-
|
90
103
|
:'property' => :'property',
|
91
|
-
|
92
104
|
:'mls_id' => :'mlsId',
|
93
|
-
|
94
105
|
:'showing_instructions' => :'showingInstructions',
|
95
|
-
|
96
106
|
:'office' => :'office',
|
97
|
-
|
98
107
|
:'lease_term' => :'leaseTerm',
|
99
|
-
|
100
108
|
:'disclaimer' => :'disclaimer',
|
101
|
-
|
102
109
|
:'address' => :'address',
|
103
|
-
|
104
110
|
:'list_date' => :'listDate',
|
105
|
-
|
106
111
|
:'agent' => :'agent',
|
107
|
-
|
108
112
|
:'modified' => :'modified',
|
109
|
-
|
110
113
|
:'school' => :'school',
|
111
|
-
|
112
114
|
:'photos' => :'photos',
|
113
|
-
|
114
115
|
:'list_price' => :'listPrice',
|
115
|
-
|
116
116
|
:'listing_id' => :'listingId',
|
117
|
-
|
118
117
|
:'mls' => :'mls',
|
119
|
-
|
120
118
|
:'geo' => :'geo',
|
121
|
-
|
122
119
|
:'tax' => :'tax',
|
123
|
-
|
120
|
+
:'co_agent' => :'coAgent',
|
124
121
|
:'sales' => :'sales',
|
125
|
-
|
126
122
|
:'lease_type' => :'leaseType',
|
127
|
-
|
128
123
|
:'virtual_tour_url' => :'virtualTourUrl',
|
129
|
-
|
130
124
|
:'remarks' => :'remarks'
|
131
|
-
|
132
125
|
}
|
133
126
|
end
|
134
127
|
|
@@ -153,116 +146,133 @@ module SimplyRetsClient
|
|
153
146
|
:'mls' => :'MlsInformation',
|
154
147
|
:'geo' => :'GeographicData',
|
155
148
|
:'tax' => :'Tax',
|
149
|
+
:'co_agent' => :'Agent',
|
156
150
|
:'sales' => :'Sales',
|
157
151
|
:'lease_type' => :'String',
|
158
152
|
:'virtual_tour_url' => :'String',
|
159
153
|
:'remarks' => :'String'
|
160
|
-
|
161
154
|
}
|
162
155
|
end
|
163
156
|
|
157
|
+
# Initializes the object
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
164
159
|
def initialize(attributes = {})
|
165
160
|
return unless attributes.is_a?(Hash)
|
166
161
|
|
167
162
|
# convert string to symbol for hash key
|
168
|
-
attributes = attributes.
|
163
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
169
164
|
|
170
|
-
|
171
|
-
if attributes[:'privateRemarks']
|
165
|
+
if attributes.has_key?(:'privateRemarks')
|
172
166
|
self.private_remarks = attributes[:'privateRemarks']
|
173
167
|
end
|
174
168
|
|
175
|
-
if attributes
|
169
|
+
if attributes.has_key?(:'property')
|
176
170
|
self.property = attributes[:'property']
|
177
171
|
end
|
178
172
|
|
179
|
-
if attributes
|
173
|
+
if attributes.has_key?(:'mlsId')
|
180
174
|
self.mls_id = attributes[:'mlsId']
|
181
|
-
else
|
182
|
-
self.mls_id = 329479823
|
183
175
|
end
|
184
176
|
|
185
|
-
if attributes
|
177
|
+
if attributes.has_key?(:'showingInstructions')
|
186
178
|
self.showing_instructions = attributes[:'showingInstructions']
|
187
179
|
end
|
188
180
|
|
189
|
-
if attributes
|
181
|
+
if attributes.has_key?(:'office')
|
190
182
|
self.office = attributes[:'office']
|
191
183
|
end
|
192
184
|
|
193
|
-
if attributes
|
185
|
+
if attributes.has_key?(:'leaseTerm')
|
194
186
|
self.lease_term = attributes[:'leaseTerm']
|
195
187
|
end
|
196
188
|
|
197
|
-
if attributes
|
189
|
+
if attributes.has_key?(:'disclaimer')
|
198
190
|
self.disclaimer = attributes[:'disclaimer']
|
199
191
|
end
|
200
192
|
|
201
|
-
if attributes
|
193
|
+
if attributes.has_key?(:'address')
|
202
194
|
self.address = attributes[:'address']
|
203
195
|
end
|
204
196
|
|
205
|
-
if attributes
|
197
|
+
if attributes.has_key?(:'listDate')
|
206
198
|
self.list_date = attributes[:'listDate']
|
207
199
|
end
|
208
200
|
|
209
|
-
if attributes
|
201
|
+
if attributes.has_key?(:'agent')
|
210
202
|
self.agent = attributes[:'agent']
|
211
203
|
end
|
212
204
|
|
213
|
-
if attributes
|
205
|
+
if attributes.has_key?(:'modified')
|
214
206
|
self.modified = attributes[:'modified']
|
215
207
|
end
|
216
208
|
|
217
|
-
if attributes
|
209
|
+
if attributes.has_key?(:'school')
|
218
210
|
self.school = attributes[:'school']
|
219
211
|
end
|
220
212
|
|
221
|
-
if attributes
|
213
|
+
if attributes.has_key?(:'photos')
|
222
214
|
if (value = attributes[:'photos']).is_a?(Array)
|
223
215
|
self.photos = value
|
224
216
|
end
|
225
217
|
end
|
226
218
|
|
227
|
-
if attributes
|
219
|
+
if attributes.has_key?(:'listPrice')
|
228
220
|
self.list_price = attributes[:'listPrice']
|
229
221
|
end
|
230
222
|
|
231
|
-
if attributes
|
223
|
+
if attributes.has_key?(:'listingId')
|
232
224
|
self.listing_id = attributes[:'listingId']
|
233
225
|
end
|
234
226
|
|
235
|
-
if attributes
|
227
|
+
if attributes.has_key?(:'mls')
|
236
228
|
self.mls = attributes[:'mls']
|
237
229
|
end
|
238
230
|
|
239
|
-
if attributes
|
231
|
+
if attributes.has_key?(:'geo')
|
240
232
|
self.geo = attributes[:'geo']
|
241
233
|
end
|
242
234
|
|
243
|
-
if attributes
|
235
|
+
if attributes.has_key?(:'tax')
|
244
236
|
self.tax = attributes[:'tax']
|
245
237
|
end
|
246
238
|
|
247
|
-
if attributes
|
239
|
+
if attributes.has_key?(:'coAgent')
|
240
|
+
self.co_agent = attributes[:'coAgent']
|
241
|
+
end
|
242
|
+
|
243
|
+
if attributes.has_key?(:'sales')
|
248
244
|
self.sales = attributes[:'sales']
|
249
245
|
end
|
250
246
|
|
251
|
-
if attributes
|
247
|
+
if attributes.has_key?(:'leaseType')
|
252
248
|
self.lease_type = attributes[:'leaseType']
|
253
249
|
end
|
254
250
|
|
255
|
-
if attributes
|
251
|
+
if attributes.has_key?(:'virtualTourUrl')
|
256
252
|
self.virtual_tour_url = attributes[:'virtualTourUrl']
|
257
253
|
end
|
258
254
|
|
259
|
-
if attributes
|
255
|
+
if attributes.has_key?(:'remarks')
|
260
256
|
self.remarks = attributes[:'remarks']
|
261
257
|
end
|
262
258
|
|
263
259
|
end
|
264
260
|
|
265
|
-
#
|
261
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
262
|
+
# @return Array for valid properies with the reasons
|
263
|
+
def list_invalid_properties
|
264
|
+
invalid_properties = Array.new
|
265
|
+
return invalid_properties
|
266
|
+
end
|
267
|
+
|
268
|
+
# Check to see if the all the properties in the model are valid
|
269
|
+
# @return true if the model is valid
|
270
|
+
def valid?
|
271
|
+
return true
|
272
|
+
end
|
273
|
+
|
274
|
+
# Checks equality by comparing each attribute.
|
275
|
+
# @param [Object] Object to be compared
|
266
276
|
def ==(o)
|
267
277
|
return true if self.equal?(o)
|
268
278
|
self.class == o.class &&
|
@@ -284,6 +294,7 @@ module SimplyRetsClient
|
|
284
294
|
mls == o.mls &&
|
285
295
|
geo == o.geo &&
|
286
296
|
tax == o.tax &&
|
297
|
+
co_agent == o.co_agent &&
|
287
298
|
sales == o.sales &&
|
288
299
|
lease_type == o.lease_type &&
|
289
300
|
virtual_tour_url == o.virtual_tour_url &&
|
@@ -291,35 +302,41 @@ module SimplyRetsClient
|
|
291
302
|
end
|
292
303
|
|
293
304
|
# @see the `==` method
|
305
|
+
# @param [Object] Object to be compared
|
294
306
|
def eql?(o)
|
295
307
|
self == o
|
296
308
|
end
|
297
309
|
|
298
|
-
#
|
310
|
+
# Calculates hash code according to all attributes.
|
311
|
+
# @return [Fixnum] Hash code
|
299
312
|
def hash
|
300
|
-
[private_remarks, property, mls_id, showing_instructions, office, lease_term, disclaimer, address, list_date, agent, modified, school, photos, list_price, listing_id, mls, geo, tax, sales, lease_type, virtual_tour_url, remarks].hash
|
313
|
+
[private_remarks, property, mls_id, showing_instructions, office, lease_term, disclaimer, address, list_date, agent, modified, school, photos, list_price, listing_id, mls, geo, tax, co_agent, sales, lease_type, virtual_tour_url, remarks].hash
|
301
314
|
end
|
302
315
|
|
303
|
-
#
|
316
|
+
# Builds the object from hash
|
317
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
318
|
+
# @return [Object] Returns the model itself
|
304
319
|
def build_from_hash(attributes)
|
305
320
|
return nil unless attributes.is_a?(Hash)
|
306
321
|
self.class.swagger_types.each_pair do |key, type|
|
307
322
|
if type =~ /^Array<(.*)>/i
|
323
|
+
# check to ensure the input is an array given that the the attribute
|
324
|
+
# is documented as an array but the input is not
|
308
325
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
309
326
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
310
|
-
else
|
311
|
-
#TODO show warning in debug mode
|
312
327
|
end
|
313
328
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
314
329
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
315
|
-
else
|
316
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
317
|
-
end
|
330
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
318
331
|
end
|
319
332
|
|
320
333
|
self
|
321
334
|
end
|
322
335
|
|
336
|
+
# Deserializes the data based on type
|
337
|
+
# @param string type Data type
|
338
|
+
# @param string value Value to be deserialized
|
339
|
+
# @return [Object] Deserialized data
|
323
340
|
def _deserialize(type, value)
|
324
341
|
case type.to_sym
|
325
342
|
when :DateTime
|
@@ -353,21 +370,25 @@ module SimplyRetsClient
|
|
353
370
|
end
|
354
371
|
end
|
355
372
|
else # model
|
356
|
-
|
357
|
-
|
373
|
+
temp_model = SimplyRetsClient.const_get(type).new
|
374
|
+
temp_model.build_from_hash(value)
|
358
375
|
end
|
359
376
|
end
|
360
377
|
|
378
|
+
# Returns the string representation of the object
|
379
|
+
# @return [String] String presentation of the object
|
361
380
|
def to_s
|
362
381
|
to_hash.to_s
|
363
382
|
end
|
364
383
|
|
365
|
-
# to_body is an alias to
|
384
|
+
# to_body is an alias to to_hash (backward compatibility)
|
385
|
+
# @return [Hash] Returns the object in the form of hash
|
366
386
|
def to_body
|
367
387
|
to_hash
|
368
388
|
end
|
369
389
|
|
370
|
-
#
|
390
|
+
# Returns the object in the form of hash
|
391
|
+
# @return [Hash] Returns the object in the form of hash
|
371
392
|
def to_hash
|
372
393
|
hash = {}
|
373
394
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -378,8 +399,10 @@ module SimplyRetsClient
|
|
378
399
|
hash
|
379
400
|
end
|
380
401
|
|
381
|
-
#
|
402
|
+
# Outputs non-array value in the form of hash
|
382
403
|
# For object, use to_hash. Otherwise, just return the value
|
404
|
+
# @param [Object] value Any valid value
|
405
|
+
# @return [Hash] Returns the value in the form of hash
|
383
406
|
def _to_hash(value)
|
384
407
|
if value.is_a?(Array)
|
385
408
|
value.compact.map{ |v| _to_hash(v) }
|
@@ -395,4 +418,5 @@ module SimplyRetsClient
|
|
395
418
|
end
|
396
419
|
|
397
420
|
end
|
421
|
+
|
398
422
|
end
|