simplyrets 1.0.3 → 1.0.4
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 +1 -1
- data/example.rb +1 -1
- data/example.rb~ +28 -0
- data/lib/simplyrets/models/.mls_information.rb.un~ +0 -0
- data/lib/simplyrets/models/mls_information.rb +1 -1
- data/lib/simplyrets/models/mls_information.rb~ +69 -0
- data/lib/simplyrets/simplyrets/.configuration.rb.un~ +0 -0
- data/lib/simplyrets/simplyrets/.version.rb.un~ +0 -0
- data/lib/simplyrets/simplyrets/configuration.rb~ +101 -0
- data/lib/simplyrets/simplyrets/version.rb +1 -1
- data/lib/simplyrets/simplyrets/version.rb~ +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f91144cb40da4077ea84da51993fcb80b2d96fe6
|
4
|
+
data.tar.gz: 461a19aaa9a63187a146b38631461a1c05d0f17f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e442e4ff3f96ee5a8b7a673dc5463ed15150be199f85242c98c5141bcad14911eb6212070382ae8624c3923b0eedeb3f1394795b192c094823914060f02c525c
|
7
|
+
data.tar.gz: 1c56752615c2f1cc2b639b15c0c8b1321986195399563207c350581283d8e4e52d399b146a8a893f051d754eed6506a2b96adc75a5b7620fd4984e2a9ec01bae
|
data/Gemfile.lock
CHANGED
data/example.rb
CHANGED
data/example.rb~
ADDED
@@ -0,0 +1,28 @@
|
|
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
|
@@ -58,7 +58,7 @@ module SimplyRetsClient
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def status=(status)
|
61
|
-
allowed_values = ["Active", "Pending", "Closed", "Expired", "Cancelled"]
|
61
|
+
allowed_values = ["Active", "ActiveUnderContract", "Pending", "Hold", "Withdrawn", "Closed", "Expired", "Cancelled", "Delete", "Incomplete", "ComingSoon"]
|
62
62
|
if status && !allowed_values.include?(status)
|
63
63
|
fail "invalid value for 'status', must be one of #{allowed_values}"
|
64
64
|
end
|
@@ -0,0 +1,69 @@
|
|
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
|
Binary file
|
@@ -0,0 +1,101 @@
|
|
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
|
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.4
|
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: 2015-09
|
12
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: typhoeus
|
@@ -206,10 +206,12 @@ files:
|
|
206
206
|
- README.org
|
207
207
|
- Rakefile
|
208
208
|
- example.rb
|
209
|
+
- example.rb~
|
209
210
|
- lib/simplyrets.rb
|
210
211
|
- lib/simplyrets/api/.default_api.rb.un~
|
211
212
|
- lib/simplyrets/api/default_api.rb
|
212
213
|
- lib/simplyrets/api/default_api.rb~
|
214
|
+
- lib/simplyrets/models/.mls_information.rb.un~
|
213
215
|
- lib/simplyrets/models/agent.rb
|
214
216
|
- lib/simplyrets/models/base_object.rb
|
215
217
|
- lib/simplyrets/models/broker.rb
|
@@ -218,6 +220,7 @@ files:
|
|
218
220
|
- lib/simplyrets/models/geographic_data.rb
|
219
221
|
- lib/simplyrets/models/listing.rb
|
220
222
|
- lib/simplyrets/models/mls_information.rb
|
223
|
+
- lib/simplyrets/models/mls_information.rb~
|
221
224
|
- lib/simplyrets/models/office.rb
|
222
225
|
- lib/simplyrets/models/open_house.rb
|
223
226
|
- lib/simplyrets/models/parking.rb
|
@@ -227,9 +230,11 @@ files:
|
|
227
230
|
- lib/simplyrets/models/street_address.rb
|
228
231
|
- lib/simplyrets/models/tax.rb
|
229
232
|
- lib/simplyrets/simplyrets.rb
|
233
|
+
- lib/simplyrets/simplyrets/.configuration.rb.un~
|
230
234
|
- lib/simplyrets/simplyrets/.version.rb.un~
|
231
235
|
- lib/simplyrets/simplyrets/api_error.rb
|
232
236
|
- lib/simplyrets/simplyrets/configuration.rb
|
237
|
+
- lib/simplyrets/simplyrets/configuration.rb~
|
233
238
|
- lib/simplyrets/simplyrets/request.rb
|
234
239
|
- lib/simplyrets/simplyrets/response.rb
|
235
240
|
- lib/simplyrets/simplyrets/version.rb
|