simplyrets 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Gemfile.lock~ +60 -0
- data/README.org +3 -1
- data/lib/simplyrets/models/property.rb +119 -38
- data/lib/simplyrets/simplyrets/.version.rb.un~ +0 -0
- data/lib/simplyrets/simplyrets/version.rb +1 -1
- metadata +3 -9
- data/example.rb~ +0 -28
- data/lib/simplyrets/api/.default_api.rb.un~ +0 -0
- data/lib/simplyrets/api/default_api.rb~ +0 -150
- data/lib/simplyrets/models/.mls_information.rb.un~ +0 -0
- data/lib/simplyrets/models/mls_information.rb~ +0 -69
- data/lib/simplyrets/simplyrets/.configuration.rb.un~ +0 -0
- data/lib/simplyrets/simplyrets/configuration.rb~ +0 -101
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90a59ca40a1e7c63f5ab266d9f4baeb30f3fa4b1
|
4
|
+
data.tar.gz: d782f2ff55622a78f3969c7dacca653e0477b70c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eeeb7bae6a1f62855a0acff3eca131a0e22773ad1e720b6a91efd52027daf367129990c328a39b85ff30386f4bc8b17f643ceb24223c155fa993842f4808a72
|
7
|
+
data.tar.gz: a7f29eb5a90c39d5a414f8f785e830314708cba2708d896c4881dc264c0e52d83d98dcb07bce8bcc6ebd710f9c5ceaf0529b711b2687376945251b49aa429ff5
|
data/Gemfile.lock
CHANGED
data/Gemfile.lock~
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
simplyrets (1.0.5)
|
5
|
+
json (~> 1.4, >= 1.4.6)
|
6
|
+
typhoeus (~> 0.2, >= 0.2.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ZenTest (4.11.0)
|
12
|
+
addressable (2.3.8)
|
13
|
+
autotest (4.4.6)
|
14
|
+
ZenTest (>= 4.4.1)
|
15
|
+
autotest-fsevent (0.2.10)
|
16
|
+
sys-uname
|
17
|
+
autotest-growl (0.2.16)
|
18
|
+
autotest-rails-pure (4.1.2)
|
19
|
+
crack (0.4.2)
|
20
|
+
safe_yaml (~> 1.0.0)
|
21
|
+
diff-lcs (1.2.5)
|
22
|
+
ethon (0.7.4)
|
23
|
+
ffi (>= 1.3.0)
|
24
|
+
ffi (1.9.10)
|
25
|
+
json (1.8.3)
|
26
|
+
rspec (3.3.0)
|
27
|
+
rspec-core (~> 3.3.0)
|
28
|
+
rspec-expectations (~> 3.3.0)
|
29
|
+
rspec-mocks (~> 3.3.0)
|
30
|
+
rspec-core (3.3.2)
|
31
|
+
rspec-support (~> 3.3.0)
|
32
|
+
rspec-expectations (3.3.1)
|
33
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
+
rspec-support (~> 3.3.0)
|
35
|
+
rspec-mocks (3.3.2)
|
36
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
+
rspec-support (~> 3.3.0)
|
38
|
+
rspec-support (3.3.0)
|
39
|
+
safe_yaml (1.0.4)
|
40
|
+
sys-uname (1.0.2)
|
41
|
+
ffi (>= 1.0.0)
|
42
|
+
typhoeus (0.7.3)
|
43
|
+
ethon (>= 0.7.4)
|
44
|
+
vcr (2.9.3)
|
45
|
+
webmock (1.21.0)
|
46
|
+
addressable (>= 2.3.6)
|
47
|
+
crack (>= 0.3.2)
|
48
|
+
|
49
|
+
PLATFORMS
|
50
|
+
ruby
|
51
|
+
|
52
|
+
DEPENDENCIES
|
53
|
+
autotest (~> 4.4, >= 4.4.6)
|
54
|
+
autotest-fsevent (~> 0.2, >= 0.2.10)
|
55
|
+
autotest-growl (~> 0.2, >= 0.2.16)
|
56
|
+
autotest-rails-pure (~> 4.1, >= 4.1.2)
|
57
|
+
rspec (~> 3.2, >= 3.2.0)
|
58
|
+
simplyrets!
|
59
|
+
vcr (~> 2.9, >= 2.9.3)
|
60
|
+
webmock (~> 1.6, >= 1.6.2)
|
data/README.org
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
#+AUTHOR: SimplyRETS, Christopher Reichert, Cody Reichert
|
2
2
|
#+TITLE: SimplyRETS Ruby SDK (Beta)
|
3
3
|
|
4
|
-
The official Ruby SDK for the [[https://
|
4
|
+
The official Ruby SDK for the [[https://simplyrets.com][SimplyRETS]] Listings API.
|
5
5
|
|
6
6
|
SimplyRETS provides a modern and simple interface for building robust
|
7
7
|
applications and websites with Real Estate data.
|
8
8
|
|
9
|
+
You can view the full API Documentation [[https://docs.simplyrets.com/api/index.html][here]].
|
10
|
+
|
9
11
|
** Installation
|
10
12
|
|
11
13
|
Clone the repo or install the =simplyrets= gem:
|
@@ -1,99 +1,164 @@
|
|
1
1
|
module SimplyRetsClient
|
2
|
-
#
|
2
|
+
# Rets MLS Listing Property
|
3
3
|
class Property < BaseObject
|
4
|
-
|
5
|
-
|
4
|
+
# Property roof description
|
5
|
+
attr_accessor :roof
|
6
|
+
|
7
|
+
# Property style description or short string
|
8
|
+
attr_accessor :style
|
9
|
+
|
10
|
+
# Square footage of the building associated with a listing
|
11
|
+
attr_accessor :area
|
12
|
+
|
13
|
+
attr_accessor :area_source
|
14
|
+
|
15
|
+
# Number of full bathrooms
|
16
|
+
attr_accessor :baths_full
|
17
|
+
|
18
|
+
# Number of half bathrooms
|
19
|
+
attr_accessor :baths_half
|
20
|
+
|
21
|
+
# Number of stories or levels. Represented as a `double' to\naccount for half stories.
|
22
|
+
attr_accessor :stories
|
23
|
+
|
24
|
+
# Number of fireplaces
|
25
|
+
attr_accessor :fireplaces
|
26
|
+
|
27
|
+
# Heating description or short string
|
28
|
+
attr_accessor :heating
|
29
|
+
|
30
|
+
# Number of bedrooms
|
31
|
+
attr_accessor :bedrooms
|
32
|
+
|
33
|
+
# The properties interior features
|
34
|
+
attr_accessor :interior_features
|
35
|
+
|
36
|
+
# Square footage of the entire property lot
|
37
|
+
attr_accessor :lot_size
|
38
|
+
|
39
|
+
#
|
40
|
+
attr_accessor :exterior_features
|
41
|
+
|
42
|
+
# The subdivision or community name
|
43
|
+
attr_accessor :subdivision
|
44
|
+
|
45
|
+
# Abbreviated property type. RES is Residential, CND is CondoOrTownhome,\nRNT is Rental, MLF is Multi-Family, CRE is Commercial, LND is Land,\nFRM is Farm. See the 'propertySubType' field for more information.
|
46
|
+
attr_accessor :type
|
47
|
+
|
48
|
+
# The property's sub-type, i.e. SingleFamilyResidential,\nCondo, etc. Or a list of Sub Types for Mobile, such as\nExpando, Manufactured, Modular, etc.
|
49
|
+
attr_accessor :sub_type
|
50
|
+
|
51
|
+
# Year the property was built
|
52
|
+
attr_accessor :year_built
|
53
|
+
|
54
|
+
# Additional room information
|
55
|
+
attr_accessor :additional_rooms
|
56
|
+
|
57
|
+
# Yearly maintenance expense
|
58
|
+
attr_accessor :maintenance_expense
|
59
|
+
|
60
|
+
# Number of garage spaces
|
61
|
+
attr_accessor :garage_spaces
|
62
|
+
|
63
|
+
attr_accessor :pool_features
|
64
|
+
|
65
|
+
attr_accessor :lot_description
|
66
|
+
|
67
|
+
attr_accessor :occupant_type
|
68
|
+
|
69
|
+
attr_accessor :occupant_name
|
70
|
+
|
71
|
+
attr_accessor :foundation
|
72
|
+
|
73
|
+
attr_accessor :laundry_features
|
74
|
+
|
75
|
+
# The materials that were used in the construction of the property.
|
76
|
+
attr_accessor :construction
|
77
|
+
|
78
|
+
# The type(s) of flooring found within the property.
|
79
|
+
attr_accessor :flooring
|
80
|
+
|
81
|
+
# A description of the cooling or air conditioning features of the property.
|
82
|
+
attr_accessor :cooling
|
83
|
+
|
84
|
+
# View details and description
|
85
|
+
attr_accessor :view
|
86
|
+
|
87
|
+
# Water description and details
|
88
|
+
attr_accessor :water
|
89
|
+
|
90
|
+
attr_accessor :accessibility
|
91
|
+
|
92
|
+
attr_accessor :parking
|
93
|
+
|
94
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
6
95
|
def self.attribute_map
|
7
96
|
{
|
8
97
|
|
9
|
-
# Property roof description
|
10
98
|
:'roof' => :'roof',
|
11
99
|
|
12
|
-
# Property style description or short string
|
13
100
|
:'style' => :'style',
|
14
101
|
|
15
|
-
# Square footage of the building associated with a listing
|
16
102
|
:'area' => :'area',
|
17
103
|
|
18
|
-
#
|
19
104
|
:'area_source' => :'areaSource',
|
20
105
|
|
21
|
-
# Number of full bathrooms
|
22
106
|
:'baths_full' => :'bathsFull',
|
23
107
|
|
24
|
-
# Number of half bathrooms
|
25
108
|
:'baths_half' => :'bathsHalf',
|
26
109
|
|
27
|
-
# Number of stories or levels. Represented as a `double' to\naccount for half stories.\n
|
28
110
|
:'stories' => :'stories',
|
29
111
|
|
30
|
-
# Number of fireplaces
|
31
112
|
:'fireplaces' => :'fireplaces',
|
32
113
|
|
33
|
-
# Heating description or short string
|
34
114
|
:'heating' => :'heating',
|
35
115
|
|
36
|
-
# Number of bedrooms
|
37
116
|
:'bedrooms' => :'bedrooms',
|
38
117
|
|
39
|
-
# The properties interior features
|
40
118
|
:'interior_features' => :'interiorFeatures',
|
41
119
|
|
42
|
-
# Square footage of the entire property lot
|
43
120
|
:'lot_size' => :'lotSize',
|
44
121
|
|
45
|
-
#
|
46
122
|
:'exterior_features' => :'exteriorFeatures',
|
47
123
|
|
48
|
-
# The subdivision or community name
|
49
124
|
:'subdivision' => :'subdivision',
|
50
125
|
|
51
|
-
# Property type (Residential, Multi-Family, Rental)
|
52
126
|
:'type' => :'type',
|
53
127
|
|
54
|
-
|
128
|
+
:'sub_type' => :'subType',
|
129
|
+
|
55
130
|
:'year_built' => :'yearBuilt',
|
56
131
|
|
57
|
-
# Additional room information
|
58
132
|
:'additional_rooms' => :'additionalRooms',
|
59
133
|
|
60
|
-
# Yearly maintenance expense
|
61
134
|
:'maintenance_expense' => :'maintenanceExpense',
|
62
135
|
|
63
|
-
# Number of garage spaces
|
64
136
|
:'garage_spaces' => :'garageSpaces',
|
65
137
|
|
66
|
-
#
|
67
138
|
:'pool_features' => :'poolFeatures',
|
68
139
|
|
69
|
-
#
|
70
140
|
:'lot_description' => :'lotDescription',
|
71
141
|
|
72
|
-
#
|
73
142
|
:'occupant_type' => :'occupantType',
|
74
143
|
|
75
|
-
#
|
76
144
|
:'occupant_name' => :'occupantName',
|
77
145
|
|
78
|
-
#
|
79
146
|
:'foundation' => :'foundation',
|
80
147
|
|
81
|
-
#
|
82
148
|
:'laundry_features' => :'laundryFeatures',
|
83
149
|
|
84
|
-
|
85
|
-
|
150
|
+
:'construction' => :'construction',
|
151
|
+
|
152
|
+
:'flooring' => :'flooring',
|
153
|
+
|
154
|
+
:'cooling' => :'cooling',
|
86
155
|
|
87
|
-
# View details and description
|
88
156
|
:'view' => :'view',
|
89
157
|
|
90
|
-
# Water description and details
|
91
158
|
:'water' => :'water',
|
92
159
|
|
93
|
-
#
|
94
160
|
:'accessibility' => :'accessibility',
|
95
161
|
|
96
|
-
#
|
97
162
|
:'parking' => :'parking'
|
98
163
|
|
99
164
|
}
|
@@ -117,6 +182,7 @@ module SimplyRetsClient
|
|
117
182
|
:'exterior_features' => :'String',
|
118
183
|
:'subdivision' => :'String',
|
119
184
|
:'type' => :'String',
|
185
|
+
:'sub_type' => :'String',
|
120
186
|
:'year_built' => :'Integer',
|
121
187
|
:'additional_rooms' => :'String',
|
122
188
|
:'maintenance_expense' => :'Float',
|
@@ -127,7 +193,9 @@ module SimplyRetsClient
|
|
127
193
|
:'occupant_name' => :'String',
|
128
194
|
:'foundation' => :'String',
|
129
195
|
:'laundry_features' => :'String',
|
130
|
-
:'
|
196
|
+
:'construction' => :'String',
|
197
|
+
:'flooring' => :'String',
|
198
|
+
:'cooling' => :'String',
|
131
199
|
:'view' => :'String',
|
132
200
|
:'water' => :'String',
|
133
201
|
:'accessibility' => :'String',
|
@@ -203,6 +271,10 @@ module SimplyRetsClient
|
|
203
271
|
self.type = attributes[:'type']
|
204
272
|
end
|
205
273
|
|
274
|
+
if attributes[:'subType']
|
275
|
+
self.type = attributes[:'subType']
|
276
|
+
end
|
277
|
+
|
206
278
|
if attributes[:'yearBuilt']
|
207
279
|
self.year_built = attributes[:'yearBuilt']
|
208
280
|
end
|
@@ -243,8 +315,16 @@ module SimplyRetsClient
|
|
243
315
|
self.laundry_features = attributes[:'laundryFeatures']
|
244
316
|
end
|
245
317
|
|
246
|
-
if attributes[:'
|
247
|
-
self.
|
318
|
+
if attributes[:'construction']
|
319
|
+
self.construction = attributes[:'construction']
|
320
|
+
end
|
321
|
+
|
322
|
+
if attributes[:'flooring']
|
323
|
+
self.flooring = attributes[:'flooring']
|
324
|
+
end
|
325
|
+
|
326
|
+
if attributes[:'cooling']
|
327
|
+
self.cooling = attributes[:'cooling']
|
248
328
|
end
|
249
329
|
|
250
330
|
if attributes[:'view']
|
@@ -265,8 +345,9 @@ module SimplyRetsClient
|
|
265
345
|
|
266
346
|
end
|
267
347
|
|
348
|
+
# Custom attribute writer method checking allowed values (enum).
|
268
349
|
def type=(type)
|
269
|
-
allowed_values = ["RES", "CND", "RNT"]
|
350
|
+
allowed_values = ["RES", "CND", "RNT", "MLF", "CRE", "LND", "FRM"]
|
270
351
|
if type && !allowed_values.include?(type)
|
271
352
|
fail "invalid value for 'type', must be one of #{allowed_values}"
|
272
353
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplyrets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Reichert
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: typhoeus
|
@@ -202,16 +202,13 @@ extra_rdoc_files: []
|
|
202
202
|
files:
|
203
203
|
- Gemfile
|
204
204
|
- Gemfile.lock
|
205
|
+
- Gemfile.lock~
|
205
206
|
- LICENSE
|
206
207
|
- README.org
|
207
208
|
- Rakefile
|
208
209
|
- example.rb
|
209
|
-
- example.rb~
|
210
210
|
- lib/simplyrets.rb
|
211
|
-
- lib/simplyrets/api/.default_api.rb.un~
|
212
211
|
- lib/simplyrets/api/default_api.rb
|
213
|
-
- lib/simplyrets/api/default_api.rb~
|
214
|
-
- lib/simplyrets/models/.mls_information.rb.un~
|
215
212
|
- lib/simplyrets/models/agent.rb
|
216
213
|
- lib/simplyrets/models/base_object.rb
|
217
214
|
- lib/simplyrets/models/broker.rb
|
@@ -220,7 +217,6 @@ files:
|
|
220
217
|
- lib/simplyrets/models/geographic_data.rb
|
221
218
|
- lib/simplyrets/models/listing.rb
|
222
219
|
- lib/simplyrets/models/mls_information.rb
|
223
|
-
- lib/simplyrets/models/mls_information.rb~
|
224
220
|
- lib/simplyrets/models/office.rb
|
225
221
|
- lib/simplyrets/models/open_house.rb
|
226
222
|
- lib/simplyrets/models/parking.rb
|
@@ -230,11 +226,9 @@ files:
|
|
230
226
|
- lib/simplyrets/models/street_address.rb
|
231
227
|
- lib/simplyrets/models/tax.rb
|
232
228
|
- lib/simplyrets/simplyrets.rb
|
233
|
-
- lib/simplyrets/simplyrets/.configuration.rb.un~
|
234
229
|
- lib/simplyrets/simplyrets/.version.rb.un~
|
235
230
|
- lib/simplyrets/simplyrets/api_error.rb
|
236
231
|
- lib/simplyrets/simplyrets/configuration.rb
|
237
|
-
- lib/simplyrets/simplyrets/configuration.rb~
|
238
232
|
- lib/simplyrets/simplyrets/request.rb
|
239
233
|
- lib/simplyrets/simplyrets/response.rb
|
240
234
|
- lib/simplyrets/simplyrets/version.rb
|
data/example.rb~
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
%w(rubygems simplyrets).each {|lib| require lib}
|
4
|
-
%w(rubygems simplyrets).each {|models| require models}
|
5
|
-
|
6
|
-
require "simplyrets"
|
7
|
-
|
8
|
-
p "SimplyRets Ruby SDK"
|
9
|
-
|
10
|
-
SimplyRetsClient::SimplyRets.configure do |config|
|
11
|
-
config.username = 'simplyrets'
|
12
|
-
config.password = 'simplyrets'
|
13
|
-
end
|
14
|
-
|
15
|
-
points = [ "29.723837146389066,-95.69778442382812", "29.938275329718987,-95.69778442382812", "29.938275329718987,-95.32974243164061", "29.723837146389066,-95.32974243164061" ]
|
16
|
-
|
17
|
-
# Properties
|
18
|
-
listings = SimplyRetsClient::Properties_api.properties({:minbeds => 2, :points => points})
|
19
|
-
listings.each do |l|
|
20
|
-
p l.property
|
21
|
-
p l.property.bedrooms
|
22
|
-
p l.office.brokerid
|
23
|
-
end
|
24
|
-
|
25
|
-
# Single Listing
|
26
|
-
prop = SimplyRetsClient::Properties_api.property(1005221)
|
27
|
-
p prop
|
28
|
-
p prop.geo.lat
|
Binary file
|
@@ -1,150 +0,0 @@
|
|
1
|
-
require "uri"
|
2
|
-
|
3
|
-
module SimplyRetsClient
|
4
|
-
class Properties_api
|
5
|
-
|
6
|
-
# The SimplyRets Listings API
|
7
|
-
# This is the main endpoint for accessing your properties. View\nall of the available query parameters and make requests below!\nThe API uses Basic Authorization, which most HTTP libraries\nwill handle for you. To use the test test data (which is what\nthis pages uses), you can use the api key `simplyrets` and\nsecret `simplyrets`. Note that the test listings are not live\nMLS listings but the data, query parameters, and response\nbodies will all work the same.\n
|
8
|
-
# @param [Hash] opts the optional parameters
|
9
|
-
# @option opts [String] :q A fuzzy keyword search.\n
|
10
|
-
# @option opts [Integer] :minprice Filter listings by a minimum price.\n
|
11
|
-
# @option opts [Integer] :maxprice Filter listings by a maximum price\n
|
12
|
-
# @option opts [String] :agent Filter the listings returned by an agent ID. Note, the\nAgent ID is provided by your MLS.\n
|
13
|
-
# @option opts [Integer] :minarea Filter listings by a minimum area size in Sq Ft.\n
|
14
|
-
# @option opts [Integer] :maxarea Filter listings by a maximum area size in Sq Ft.\n
|
15
|
-
# @option opts [Integer] :minbaths Filter listings by a minimum number of bathrooms.\n
|
16
|
-
# @option opts [Integer] :maxbaths Filter listings by a maximum number of bathrooms.\n
|
17
|
-
# @option opts [Integer] :minbeds Filter listings by a minimum number of bedrooms.\n
|
18
|
-
# @option opts [Integer] :maxbeds Filter listings by a maximum number of bedrooms.\n
|
19
|
-
# @option opts [Integer] :limit Set the number of listings to return in the response.\nThis defaults to 20 listings, and can be a maximum of 50.\nTo paginate through to the next page of listings, take a\nlook at the `offset` parameter, or the Link in the HTTP\nHeader.\n
|
20
|
-
# @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset parameter\nby the limit to go to the next \"page\" of listings. Also take\na look at the Link HTTP Header for pre-built pagination.\n
|
21
|
-
# @option opts [Array<String>] :brokers Filter the listings returned by brokerage with a Broker ID.\nYou can specific multiple broker parameters. Note, the Broker\nID is provided by your MLS.\n
|
22
|
-
# @option opts [Array<String>] :features Filter the listings returned by specific features. You\ncan specify multiple.\n
|
23
|
-
# @option opts [Array<String>] :amenities Filter the listings returned by specific amenities. You\ncan specify multiple amenities.\n
|
24
|
-
# @option opts [Array<String>] :neighborhoods Filter the listings returned by specific neighborhoods and\nsubdivisions. You can specify multiple.\n
|
25
|
-
# @option opts [Array<String>] :points A list of latitude longitude coordinates which contain\nthe property. Our documentation generator does not yet\nsupport using a list of parameters.\n
|
26
|
-
# @option opts [Array<String>] :counties Filter the listings returned by specific counties. You can\nspecify multiple.\n
|
27
|
-
# @option opts [Array<String>] :status Filter the listings returned by a specific status. You can\nspecify multiple.\n
|
28
|
-
# @option opts [String] :type Request listings by a specific property type. This\ndefaults to Residential, and you can only specify one type\nin a single query.\n
|
29
|
-
# @option opts [String] :sort Sort the response by a specific field. Values starting\nwith a minus (-) denote descending order, while the others\nare ascending.\n
|
30
|
-
# @option opts [String] :include Include a limited set of extra fields which are not found\nin the default response body\n- 'rooms' include parameter will include\n any additional rooms as a list.\n- 'pool' includes an additional pool description\n- 'association' includes additional home owners association data\n
|
31
|
-
# @return [Array<Listing>]
|
32
|
-
def self.properties(opts = {})
|
33
|
-
if SimplyRets.configuration.debug
|
34
|
-
SimplyRets.logger.debug "Calling API: DefaultApi#properties ..."
|
35
|
-
end
|
36
|
-
|
37
|
-
if opts[:'type'] && !['Residential', 'Rential', 'Multifamily', 'Condominium', 'Commercial', 'Land'].include?(opts[:'type'])
|
38
|
-
fail 'invalid value for "type", must be one of Residential, Rential, Multifamily, Condominium, Commercial, Land'
|
39
|
-
end
|
40
|
-
|
41
|
-
if opts[:'sort'] && !['listprice', '-listprice', 'listdate', '-listdate', 'beds', '-beds', 'baths', '-baths'].include?(opts[:'sort'])
|
42
|
-
fail 'invalid value for "sort", must be one of listprice, -listprice, listdate, -listdate, beds, -beds, baths, -baths'
|
43
|
-
end
|
44
|
-
|
45
|
-
if opts[:'include'] && !['pool', 'rooms', 'association'].include?(opts[:'include'])
|
46
|
-
fail 'invalid value for "include", must be one of pool, rooms, association'
|
47
|
-
end
|
48
|
-
|
49
|
-
# resource path
|
50
|
-
path = "/properties".sub('{format}','json')
|
51
|
-
|
52
|
-
# query parameters
|
53
|
-
query_params = {}
|
54
|
-
query_params[:'q'] = opts[:'q'] if opts[:'q']
|
55
|
-
query_params[:'minprice'] = opts[:'minprice'] if opts[:'minprice']
|
56
|
-
query_params[:'maxprice'] = opts[:'maxprice'] if opts[:'maxprice']
|
57
|
-
query_params[:'agent'] = opts[:'agent'] if opts[:'agent']
|
58
|
-
query_params[:'minarea'] = opts[:'minarea'] if opts[:'minarea']
|
59
|
-
query_params[:'maxarea'] = opts[:'maxarea'] if opts[:'maxarea']
|
60
|
-
query_params[:'minbaths'] = opts[:'minbaths'] if opts[:'minbaths']
|
61
|
-
query_params[:'maxbaths'] = opts[:'maxbaths'] if opts[:'maxbaths']
|
62
|
-
query_params[:'minbeds'] = opts[:'minbeds'] if opts[:'minbeds']
|
63
|
-
query_params[:'maxbeds'] = opts[:'maxbeds'] if opts[:'maxbeds']
|
64
|
-
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
65
|
-
query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
|
66
|
-
query_params[:'brokers'] = opts[:'brokers'] if opts[:'brokers']
|
67
|
-
query_params[:'features'] = opts[:'features'] if opts[:'features']
|
68
|
-
query_params[:'amenities'] = opts[:'amenities'] if opts[:'amenities']
|
69
|
-
query_params[:'neighborhoods'] = opts[:'neighborhoods'] if opts[:'neighborhoods']
|
70
|
-
query_params[:'points'] = opts[:'points'] if opts[:'points']
|
71
|
-
query_params[:'counties'] = opts[:'counties'] if opts[:'counties']
|
72
|
-
query_params[:'status'] = opts[:'status'] if opts[:'status']
|
73
|
-
query_params[:'type'] = opts[:'type'] if opts[:'type']
|
74
|
-
query_params[:'sort'] = opts[:'sort'] if opts[:'sort']
|
75
|
-
query_params[:'include'] = opts[:'include'] if opts[:'include']
|
76
|
-
|
77
|
-
# header parameters
|
78
|
-
header_params = {}
|
79
|
-
|
80
|
-
# HTTP header 'Accept' (if needed)
|
81
|
-
_header_accept = []
|
82
|
-
_header_accept_result = SimplyRets::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
83
|
-
|
84
|
-
# HTTP header 'Content-Type'
|
85
|
-
_header_content_type = []
|
86
|
-
header_params['Content-Type'] = SimplyRets::Request.select_header_content_type(_header_content_type)
|
87
|
-
|
88
|
-
# form parameters
|
89
|
-
form_params = {}
|
90
|
-
|
91
|
-
# http body (model)
|
92
|
-
post_body = nil
|
93
|
-
|
94
|
-
|
95
|
-
auth_names = ['basicAuth']
|
96
|
-
response = SimplyRets::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make
|
97
|
-
result = response.deserialize('Array<Listing>')
|
98
|
-
if SimplyRets.configuration.debug
|
99
|
-
SimplyRets.logger.debug "API called: DefaultApi#properties. Result: #{result.inspect}"
|
100
|
-
end
|
101
|
-
result
|
102
|
-
end
|
103
|
-
|
104
|
-
# Single Listing Endpoint
|
105
|
-
# Use this endpoint for accessing a single listing.\n
|
106
|
-
# @param listing_id A listings listingId (unique indentifier).
|
107
|
-
# @param [Hash] opts the optional parameters
|
108
|
-
# @return [Listing]
|
109
|
-
def self.property(listing_id, opts = {})
|
110
|
-
if SimplyRets.configuration.debug
|
111
|
-
SimplyRets.logger.debug "Calling API: DefaultApi#property ..."
|
112
|
-
end
|
113
|
-
|
114
|
-
# verify the required parameter 'listing_id' is set
|
115
|
-
fail "Missing the required parameter 'listing_id' when calling property" if listing_id.nil?
|
116
|
-
|
117
|
-
# resource path
|
118
|
-
path = "/properties/{listingId}".sub('{format}','json').sub('{' + 'listingId' + '}', listing_id.to_s)
|
119
|
-
|
120
|
-
# query parameters
|
121
|
-
query_params = {}
|
122
|
-
|
123
|
-
# header parameters
|
124
|
-
header_params = {}
|
125
|
-
|
126
|
-
# HTTP header 'Accept' (if needed)
|
127
|
-
_header_accept = []
|
128
|
-
_header_accept_result = SimplyRets::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
129
|
-
|
130
|
-
# HTTP header 'Content-Type'
|
131
|
-
_header_content_type = []
|
132
|
-
header_params['Content-Type'] = SimplyRets::Request.select_header_content_type(_header_content_type)
|
133
|
-
|
134
|
-
# form parameters
|
135
|
-
form_params = {}
|
136
|
-
|
137
|
-
# http body (model)
|
138
|
-
post_body = nil
|
139
|
-
|
140
|
-
|
141
|
-
auth_names = ['basicAuth']
|
142
|
-
response = SimplyRets::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make
|
143
|
-
result = response.deserialize('Listing')
|
144
|
-
if SimplyRets.configuration.debug
|
145
|
-
SimplyRets.logger.debug "API called: DefaultApi#property. Result: #{result.inspect}"
|
146
|
-
end
|
147
|
-
result
|
148
|
-
end
|
149
|
-
end
|
150
|
-
end
|
Binary file
|
@@ -1,69 +0,0 @@
|
|
1
|
-
module SimplyRetsClient
|
2
|
-
#
|
3
|
-
class MlsInformation < BaseObject
|
4
|
-
attr_accessor :status, :area, :days_on_market, :serving_name
|
5
|
-
# attribute mapping from ruby-style variable name to JSON key
|
6
|
-
def self.attribute_map
|
7
|
-
{
|
8
|
-
|
9
|
-
# MLS Status Code. Compliant with data dictionary v1.3 ListingStatus
|
10
|
-
:'status' => :'status',
|
11
|
-
|
12
|
-
# MLS Area. Generally a subdivision or community name.
|
13
|
-
:'area' => :'area',
|
14
|
-
|
15
|
-
# Amount of days the property has been Active
|
16
|
-
:'days_on_market' => :'daysOnMarket',
|
17
|
-
|
18
|
-
# Alias for the listing office or brokerage
|
19
|
-
:'serving_name' => :'servingName'
|
20
|
-
|
21
|
-
}
|
22
|
-
end
|
23
|
-
|
24
|
-
# attribute type
|
25
|
-
def self.simplyrets_types
|
26
|
-
{
|
27
|
-
:'status' => :'String',
|
28
|
-
:'area' => :'String',
|
29
|
-
:'days_on_market' => :'Integer',
|
30
|
-
:'serving_name' => :'String'
|
31
|
-
|
32
|
-
}
|
33
|
-
end
|
34
|
-
|
35
|
-
def initialize(attributes = {})
|
36
|
-
return if !attributes.is_a?(Hash) || attributes.empty?
|
37
|
-
|
38
|
-
# convert string to symbol for hash key
|
39
|
-
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
40
|
-
|
41
|
-
|
42
|
-
if attributes[:'status']
|
43
|
-
self.status = attributes[:'status']
|
44
|
-
end
|
45
|
-
|
46
|
-
if attributes[:'area']
|
47
|
-
self.area = attributes[:'area']
|
48
|
-
end
|
49
|
-
|
50
|
-
if attributes[:'daysOnMarket']
|
51
|
-
self.days_on_market = attributes[:'daysOnMarket']
|
52
|
-
end
|
53
|
-
|
54
|
-
if attributes[:'servingName']
|
55
|
-
self.serving_name = attributes[:'servingName']
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
59
|
-
|
60
|
-
def status=(status)
|
61
|
-
allowed_values = ["Active", "ActiveUnderContract", "Pending", "Hold", "Withdrawn", "Closed", "Expired", "Cancelled", "Delete", "Incomplete", "ComingSoon"]
|
62
|
-
if status && !allowed_values.include?(status)
|
63
|
-
fail "invalid value for 'status', must be one of #{allowed_values}"
|
64
|
-
end
|
65
|
-
@status = status
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
|
-
end
|
Binary file
|
@@ -1,101 +0,0 @@
|
|
1
|
-
require 'logger'
|
2
|
-
|
3
|
-
module SimplyRetsClient
|
4
|
-
module SimplyRets
|
5
|
-
class Configuration
|
6
|
-
attr_accessor :scheme, :host, :base_path, :user_agent, :format, :auth_token, :inject_format, :force_ending_format
|
7
|
-
|
8
|
-
# Defines the username used with HTTP basic authentication.
|
9
|
-
#
|
10
|
-
# @return [String]
|
11
|
-
attr_accessor :username
|
12
|
-
|
13
|
-
# Defines the password used with HTTP basic authentication.
|
14
|
-
#
|
15
|
-
# @return [String]
|
16
|
-
attr_accessor :password
|
17
|
-
|
18
|
-
# Defines API keys used with API Key authentications.
|
19
|
-
#
|
20
|
-
# @return [Hash] key: parameter name, value: parameter value (API key)
|
21
|
-
#
|
22
|
-
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
23
|
-
# config.api_key['api_key'] = 'xxx'
|
24
|
-
attr_accessor :api_key
|
25
|
-
|
26
|
-
# Defines API key prefixes used with API Key authentications.
|
27
|
-
#
|
28
|
-
# @return [Hash] key: parameter name, value: API key prefix
|
29
|
-
#
|
30
|
-
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
31
|
-
# config.api_key_prefix['api_key'] = 'Token'
|
32
|
-
attr_accessor :api_key_prefix
|
33
|
-
|
34
|
-
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
35
|
-
# Default to true.
|
36
|
-
#
|
37
|
-
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
38
|
-
#
|
39
|
-
# @return [true, false]
|
40
|
-
attr_accessor :verify_ssl
|
41
|
-
|
42
|
-
# Set this to customize the certificate file to verify the peer.
|
43
|
-
#
|
44
|
-
# @return [String] the path to the certificate file
|
45
|
-
#
|
46
|
-
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
47
|
-
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
48
|
-
attr_accessor :ssl_ca_cert
|
49
|
-
|
50
|
-
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
51
|
-
# details will be logged with `logger.debug` (see the `logger` attribute).
|
52
|
-
# Default to false.
|
53
|
-
#
|
54
|
-
# @return [true, false]
|
55
|
-
attr_accessor :debug
|
56
|
-
|
57
|
-
# Defines the logger used for debugging.
|
58
|
-
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
59
|
-
#
|
60
|
-
# @return [#debug]
|
61
|
-
attr_accessor :logger
|
62
|
-
|
63
|
-
# Defines the temporary folder to store downloaded files
|
64
|
-
# (for API endpoints that have file response).
|
65
|
-
# Default to use `Tempfile`.
|
66
|
-
#
|
67
|
-
# @return [String]
|
68
|
-
attr_accessor :temp_folder_path
|
69
|
-
|
70
|
-
# Defines the headers to be used in HTTP requests of all API calls by default.
|
71
|
-
#
|
72
|
-
# @return [Hash]
|
73
|
-
attr_accessor :default_headers
|
74
|
-
|
75
|
-
# Defaults go in here..
|
76
|
-
def initialize
|
77
|
-
@format = 'json'
|
78
|
-
@scheme = 'https'
|
79
|
-
@host = 'api.simplyrets.com'
|
80
|
-
@base_path = '/'
|
81
|
-
@user_agent = "ruby-simplyrets-#{SimplyRets::VERSION}"
|
82
|
-
@inject_format = false
|
83
|
-
@force_ending_format = false
|
84
|
-
|
85
|
-
@default_headers = {
|
86
|
-
'Content-Type' => "application/#{@format.downcase}",
|
87
|
-
'User-Agent' => @user_agent
|
88
|
-
}
|
89
|
-
|
90
|
-
# keys for API key authentication (param-name => api-key)
|
91
|
-
@api_key = {}
|
92
|
-
@api_key_prefix = {}
|
93
|
-
|
94
|
-
@verify_ssl = true
|
95
|
-
|
96
|
-
@debug = true
|
97
|
-
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|