simplyrets 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,7 +26,7 @@ require 'date'
|
|
|
15
26
|
module SimplyRetsClient
|
|
16
27
|
# RETS MLS Vendor Data
|
|
17
28
|
class MlsInformation
|
|
18
|
-
# MLS Status Code. Compliant with data dictionary v1.3 ListingStatus
|
|
29
|
+
# MLS Status Code. Compliant with data dictionary v1.3 ListingStatus Listing statuses depend on your MLS's availability. Below is a brief description of each status with possible synonyms which may map to your MLS-specific statuses - Active: Active Listing which is still on the market - ActiveUnderContract: An offer has been accepted but the listing is still on market. Synonyms: Accepting Backup Offers, Backup Offer, Active With Accepted. Synonyms: Offer, Backup, Contingent - Pending: An offer has been accepted and the listing is no longer on market. Synonyms: Offer Accepted, Under Contract - Hold: The listing has been withdrawn from the market, but a contract still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market - Withdrawn: The listing has been withdrawn from the market, but a contract still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market - Closed: The purchase agreement has been fulfilled or the lease agreement has been executed. Synonyms: Sold, Leased, Rented, Closed Sale - Expired: The listing contract has expired - Delete: The listing contract was never valid or other reason for the contract to be nullified. Synonyms: Kill, Zap - Incomplete: The listing has not yet be completely entered and is not yet published in the MLS. Synonyms: Draft, Partially Complted - ComingSoon
|
|
19
30
|
attr_accessor :status
|
|
20
31
|
|
|
21
32
|
# MLS Area. Generally a subdivision or community name.
|
|
@@ -24,21 +35,38 @@ module SimplyRetsClient
|
|
|
24
35
|
# Amount of days the property has been Active
|
|
25
36
|
attr_accessor :days_on_market
|
|
26
37
|
|
|
27
|
-
# Alias for the listing office or brokerage
|
|
28
|
-
attr_accessor :
|
|
38
|
+
# Alias for the listing office or brokerage This field corresponds to the data-dictionary `OriginatingSystemName` field The name of the originating record provider. Most commonly the name of the MLS. The place where the listing is originally input by the member. The legal name of the company. To be used for display. If you're RETS provider aggregates feeds from multiple MLS's, this will be the name of the corresponding MLS.
|
|
39
|
+
attr_accessor :originating_system_name
|
|
40
|
+
|
|
41
|
+
class EnumAttributeValidator
|
|
42
|
+
attr_reader :datatype
|
|
43
|
+
attr_reader :allowable_values
|
|
44
|
+
|
|
45
|
+
def initialize(datatype, allowable_values)
|
|
46
|
+
@allowable_values = allowable_values.map do |value|
|
|
47
|
+
case datatype.to_s
|
|
48
|
+
when /Integer/i
|
|
49
|
+
value.to_i
|
|
50
|
+
when /Float/i
|
|
51
|
+
value.to_f
|
|
52
|
+
else
|
|
53
|
+
value
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def valid?(value)
|
|
59
|
+
!value || allowable_values.include?(value)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
29
62
|
|
|
30
63
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
64
|
def self.attribute_map
|
|
32
65
|
{
|
|
33
|
-
|
|
34
66
|
:'status' => :'status',
|
|
35
|
-
|
|
36
67
|
:'area' => :'area',
|
|
37
|
-
|
|
38
68
|
:'days_on_market' => :'daysOnMarket',
|
|
39
|
-
|
|
40
|
-
:'serving_name' => :'servingName'
|
|
41
|
-
|
|
69
|
+
:'originating_system_name' => :'originatingSystemName'
|
|
42
70
|
}
|
|
43
71
|
end
|
|
44
72
|
|
|
@@ -48,85 +76,108 @@ module SimplyRetsClient
|
|
|
48
76
|
:'status' => :'String',
|
|
49
77
|
:'area' => :'String',
|
|
50
78
|
:'days_on_market' => :'Integer',
|
|
51
|
-
:'
|
|
52
|
-
|
|
79
|
+
:'originating_system_name' => :'String'
|
|
53
80
|
}
|
|
54
81
|
end
|
|
55
82
|
|
|
83
|
+
# Initializes the object
|
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
85
|
def initialize(attributes = {})
|
|
57
86
|
return unless attributes.is_a?(Hash)
|
|
58
87
|
|
|
59
88
|
# convert string to symbol for hash key
|
|
60
|
-
attributes = attributes.
|
|
89
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
61
90
|
|
|
62
|
-
|
|
63
|
-
if attributes[:'status']
|
|
91
|
+
if attributes.has_key?(:'status')
|
|
64
92
|
self.status = attributes[:'status']
|
|
65
93
|
end
|
|
66
94
|
|
|
67
|
-
if attributes
|
|
95
|
+
if attributes.has_key?(:'area')
|
|
68
96
|
self.area = attributes[:'area']
|
|
69
97
|
end
|
|
70
98
|
|
|
71
|
-
if attributes
|
|
99
|
+
if attributes.has_key?(:'daysOnMarket')
|
|
72
100
|
self.days_on_market = attributes[:'daysOnMarket']
|
|
73
101
|
end
|
|
74
102
|
|
|
75
|
-
if attributes
|
|
76
|
-
self.
|
|
103
|
+
if attributes.has_key?(:'originatingSystemName')
|
|
104
|
+
self.originating_system_name = attributes[:'originatingSystemName']
|
|
77
105
|
end
|
|
78
106
|
|
|
79
107
|
end
|
|
80
108
|
|
|
109
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
110
|
+
# @return Array for valid properies with the reasons
|
|
111
|
+
def list_invalid_properties
|
|
112
|
+
invalid_properties = Array.new
|
|
113
|
+
return invalid_properties
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Check to see if the all the properties in the model are valid
|
|
117
|
+
# @return true if the model is valid
|
|
118
|
+
def valid?
|
|
119
|
+
status_validator = EnumAttributeValidator.new('String', ["Active", "ActiveUnderContract (Backup-Offer)", "Pending", "Hold", "Withdrawn", "Closed", "Expired", "Delete", "Incomplete", "ComingSoon"])
|
|
120
|
+
return false unless status_validator.valid?(@status)
|
|
121
|
+
return true
|
|
122
|
+
end
|
|
123
|
+
|
|
81
124
|
# Custom attribute writer method checking allowed values (enum).
|
|
125
|
+
# @param [Object] status Object to be assigned
|
|
82
126
|
def status=(status)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
fail "invalid value for 'status', must be one of #{
|
|
127
|
+
validator = EnumAttributeValidator.new('String', ["Active", "ActiveUnderContract (Backup-Offer)", "Pending", "Hold", "Withdrawn", "Closed", "Expired", "Delete", "Incomplete", "ComingSoon"])
|
|
128
|
+
unless validator.valid?(status)
|
|
129
|
+
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
|
86
130
|
end
|
|
87
131
|
@status = status
|
|
88
132
|
end
|
|
89
133
|
|
|
90
|
-
#
|
|
134
|
+
# Checks equality by comparing each attribute.
|
|
135
|
+
# @param [Object] Object to be compared
|
|
91
136
|
def ==(o)
|
|
92
137
|
return true if self.equal?(o)
|
|
93
138
|
self.class == o.class &&
|
|
94
139
|
status == o.status &&
|
|
95
140
|
area == o.area &&
|
|
96
141
|
days_on_market == o.days_on_market &&
|
|
97
|
-
|
|
142
|
+
originating_system_name == o.originating_system_name
|
|
98
143
|
end
|
|
99
144
|
|
|
100
145
|
# @see the `==` method
|
|
146
|
+
# @param [Object] Object to be compared
|
|
101
147
|
def eql?(o)
|
|
102
148
|
self == o
|
|
103
149
|
end
|
|
104
150
|
|
|
105
|
-
#
|
|
151
|
+
# Calculates hash code according to all attributes.
|
|
152
|
+
# @return [Fixnum] Hash code
|
|
106
153
|
def hash
|
|
107
|
-
[status, area, days_on_market,
|
|
154
|
+
[status, area, days_on_market, originating_system_name].hash
|
|
108
155
|
end
|
|
109
156
|
|
|
110
|
-
#
|
|
157
|
+
# Builds the object from hash
|
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
159
|
+
# @return [Object] Returns the model itself
|
|
111
160
|
def build_from_hash(attributes)
|
|
112
161
|
return nil unless attributes.is_a?(Hash)
|
|
113
162
|
self.class.swagger_types.each_pair do |key, type|
|
|
114
163
|
if type =~ /^Array<(.*)>/i
|
|
164
|
+
# check to ensure the input is an array given that the the attribute
|
|
165
|
+
# is documented as an array but the input is not
|
|
115
166
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
116
167
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
117
|
-
else
|
|
118
|
-
#TODO show warning in debug mode
|
|
119
168
|
end
|
|
120
169
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
121
170
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
122
|
-
else
|
|
123
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
|
124
|
-
end
|
|
171
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
125
172
|
end
|
|
126
173
|
|
|
127
174
|
self
|
|
128
175
|
end
|
|
129
176
|
|
|
177
|
+
# Deserializes the data based on type
|
|
178
|
+
# @param string type Data type
|
|
179
|
+
# @param string value Value to be deserialized
|
|
180
|
+
# @return [Object] Deserialized data
|
|
130
181
|
def _deserialize(type, value)
|
|
131
182
|
case type.to_sym
|
|
132
183
|
when :DateTime
|
|
@@ -160,21 +211,25 @@ module SimplyRetsClient
|
|
|
160
211
|
end
|
|
161
212
|
end
|
|
162
213
|
else # model
|
|
163
|
-
|
|
164
|
-
|
|
214
|
+
temp_model = SimplyRetsClient.const_get(type).new
|
|
215
|
+
temp_model.build_from_hash(value)
|
|
165
216
|
end
|
|
166
217
|
end
|
|
167
218
|
|
|
219
|
+
# Returns the string representation of the object
|
|
220
|
+
# @return [String] String presentation of the object
|
|
168
221
|
def to_s
|
|
169
222
|
to_hash.to_s
|
|
170
223
|
end
|
|
171
224
|
|
|
172
|
-
# to_body is an alias to
|
|
225
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
226
|
+
# @return [Hash] Returns the object in the form of hash
|
|
173
227
|
def to_body
|
|
174
228
|
to_hash
|
|
175
229
|
end
|
|
176
230
|
|
|
177
|
-
#
|
|
231
|
+
# Returns the object in the form of hash
|
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
|
178
233
|
def to_hash
|
|
179
234
|
hash = {}
|
|
180
235
|
self.class.attribute_map.each_pair do |attr, param|
|
|
@@ -185,8 +240,10 @@ module SimplyRetsClient
|
|
|
185
240
|
hash
|
|
186
241
|
end
|
|
187
242
|
|
|
188
|
-
#
|
|
243
|
+
# Outputs non-array value in the form of hash
|
|
189
244
|
# For object, use to_hash. Otherwise, just return the value
|
|
245
|
+
# @param [Object] value Any valid value
|
|
246
|
+
# @return [Hash] Returns the value in the form of hash
|
|
190
247
|
def _to_hash(value)
|
|
191
248
|
if value.is_a?(Array)
|
|
192
249
|
value.compact.map{ |v| _to_hash(v) }
|
|
@@ -202,4 +259,5 @@ module SimplyRetsClient
|
|
|
202
259
|
end
|
|
203
260
|
|
|
204
261
|
end
|
|
262
|
+
|
|
205
263
|
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
|
|
|
@@ -15,7 +26,7 @@ require 'date'
|
|
|
15
26
|
module SimplyRetsClient
|
|
16
27
|
# RETS MLS Office
|
|
17
28
|
class Office
|
|
18
|
-
# Associated contact details for the office. The availability of this
|
|
29
|
+
# Associated contact details for the office. The availability of this information depends on your MLS rules and regulations *Contact information is not available for all RETS Vendors.*
|
|
19
30
|
attr_accessor :contact
|
|
20
31
|
|
|
21
32
|
# Pimary office name
|
|
@@ -24,21 +35,17 @@ module SimplyRetsClient
|
|
|
24
35
|
# Primary office or brokerage name
|
|
25
36
|
attr_accessor :serving_name
|
|
26
37
|
|
|
27
|
-
# Office or brokerage MLS identifier
|
|
38
|
+
# Office or brokerage MLS identifier **Not available for all RETS vendors**
|
|
28
39
|
attr_accessor :brokerid
|
|
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
|
:'contact' => :'contact',
|
|
35
|
-
|
|
36
46
|
:'name' => :'name',
|
|
37
|
-
|
|
38
47
|
:'serving_name' => :'servingName',
|
|
39
|
-
|
|
40
48
|
:'brokerid' => :'brokerid'
|
|
41
|
-
|
|
42
49
|
}
|
|
43
50
|
end
|
|
44
51
|
|
|
@@ -49,36 +56,50 @@ module SimplyRetsClient
|
|
|
49
56
|
:'name' => :'String',
|
|
50
57
|
:'serving_name' => :'String',
|
|
51
58
|
:'brokerid' => :'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[:'contact']
|
|
70
|
+
if attributes.has_key?(:'contact')
|
|
64
71
|
self.contact = attributes[:'contact']
|
|
65
72
|
end
|
|
66
73
|
|
|
67
|
-
if attributes
|
|
74
|
+
if attributes.has_key?(:'name')
|
|
68
75
|
self.name = attributes[:'name']
|
|
69
76
|
end
|
|
70
77
|
|
|
71
|
-
if attributes
|
|
78
|
+
if attributes.has_key?(:'servingName')
|
|
72
79
|
self.serving_name = attributes[:'servingName']
|
|
73
80
|
end
|
|
74
81
|
|
|
75
|
-
if attributes
|
|
82
|
+
if attributes.has_key?(:'brokerid')
|
|
76
83
|
self.brokerid = attributes[:'brokerid']
|
|
77
84
|
end
|
|
78
85
|
|
|
79
86
|
end
|
|
80
87
|
|
|
81
|
-
#
|
|
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
|
|
82
103
|
def ==(o)
|
|
83
104
|
return true if self.equal?(o)
|
|
84
105
|
self.class == o.class &&
|
|
@@ -89,35 +110,41 @@ module SimplyRetsClient
|
|
|
89
110
|
end
|
|
90
111
|
|
|
91
112
|
# @see the `==` method
|
|
113
|
+
# @param [Object] Object to be compared
|
|
92
114
|
def eql?(o)
|
|
93
115
|
self == o
|
|
94
116
|
end
|
|
95
117
|
|
|
96
|
-
#
|
|
118
|
+
# Calculates hash code according to all attributes.
|
|
119
|
+
# @return [Fixnum] Hash code
|
|
97
120
|
def hash
|
|
98
121
|
[contact, name, serving_name, brokerid].hash
|
|
99
122
|
end
|
|
100
123
|
|
|
101
|
-
#
|
|
124
|
+
# Builds the object from hash
|
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
126
|
+
# @return [Object] Returns the model itself
|
|
102
127
|
def build_from_hash(attributes)
|
|
103
128
|
return nil unless attributes.is_a?(Hash)
|
|
104
129
|
self.class.swagger_types.each_pair do |key, type|
|
|
105
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
|
|
106
133
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
107
134
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
108
|
-
else
|
|
109
|
-
#TODO show warning in debug mode
|
|
110
135
|
end
|
|
111
136
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
112
137
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
113
|
-
else
|
|
114
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
|
115
|
-
end
|
|
138
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
116
139
|
end
|
|
117
140
|
|
|
118
141
|
self
|
|
119
142
|
end
|
|
120
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
|
|
121
148
|
def _deserialize(type, value)
|
|
122
149
|
case type.to_sym
|
|
123
150
|
when :DateTime
|
|
@@ -151,21 +178,25 @@ module SimplyRetsClient
|
|
|
151
178
|
end
|
|
152
179
|
end
|
|
153
180
|
else # model
|
|
154
|
-
|
|
155
|
-
|
|
181
|
+
temp_model = SimplyRetsClient.const_get(type).new
|
|
182
|
+
temp_model.build_from_hash(value)
|
|
156
183
|
end
|
|
157
184
|
end
|
|
158
185
|
|
|
186
|
+
# Returns the string representation of the object
|
|
187
|
+
# @return [String] String presentation of the object
|
|
159
188
|
def to_s
|
|
160
189
|
to_hash.to_s
|
|
161
190
|
end
|
|
162
191
|
|
|
163
|
-
# 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
|
|
164
194
|
def to_body
|
|
165
195
|
to_hash
|
|
166
196
|
end
|
|
167
197
|
|
|
168
|
-
#
|
|
198
|
+
# Returns the object in the form of hash
|
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
|
169
200
|
def to_hash
|
|
170
201
|
hash = {}
|
|
171
202
|
self.class.attribute_map.each_pair do |attr, param|
|
|
@@ -176,8 +207,10 @@ module SimplyRetsClient
|
|
|
176
207
|
hash
|
|
177
208
|
end
|
|
178
209
|
|
|
179
|
-
#
|
|
210
|
+
# Outputs non-array value in the form of hash
|
|
180
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
|
|
181
214
|
def _to_hash(value)
|
|
182
215
|
if value.is_a?(Array)
|
|
183
216
|
value.compact.map{ |v| _to_hash(v) }
|
|
@@ -193,4 +226,5 @@ module SimplyRetsClient
|
|
|
193
226
|
end
|
|
194
227
|
|
|
195
228
|
end
|
|
229
|
+
|
|
196
230
|
end
|