simplyrets 1.0.7 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +23 -21
- data/Makefile +48 -0
- data/README.org +5 -58
- data/example.rb +14 -4
- data/lib/simplyrets.rb +42 -21
- data/lib/simplyrets/api/default_api.rb +292 -59
- data/lib/simplyrets/api_client.rb +370 -0
- data/lib/simplyrets/api_error.rb +36 -0
- data/lib/simplyrets/configuration.rb +170 -0
- data/lib/simplyrets/models/agent.rb +146 -11
- data/lib/simplyrets/models/broker.rb +133 -7
- data/lib/simplyrets/models/contact_information.rb +149 -17
- data/lib/simplyrets/models/error.rb +138 -9
- data/lib/simplyrets/models/geographic_data.rb +150 -12
- data/lib/simplyrets/models/listing.rb +248 -49
- data/lib/simplyrets/models/mls_information.rb +148 -12
- data/lib/simplyrets/models/office.rb +146 -11
- data/lib/simplyrets/models/open_house.rb +215 -12
- data/lib/simplyrets/models/parking.rb +148 -17
- data/lib/simplyrets/models/property.rb +353 -129
- data/lib/simplyrets/models/sales.rb +163 -25
- data/lib/simplyrets/models/school.rb +167 -24
- data/lib/simplyrets/models/street_address.rb +204 -26
- data/lib/simplyrets/models/tax.rb +150 -18
- data/lib/simplyrets/version.rb +15 -0
- data/multi-query-param.patch +44 -0
- data/simplyrets.gemspec +4 -4
- data/spec/api/default_api_spec.rb +172 -0
- data/spec/models/agent_spec.rb +75 -0
- data/spec/models/broker_spec.rb +45 -0
- data/spec/models/contact_information_spec.rb +65 -0
- data/spec/models/error_spec.rb +55 -0
- data/spec/models/geographic_data_spec.rb +85 -0
- data/spec/models/listing_spec.rb +245 -0
- data/spec/models/mls_information_spec.rb +75 -0
- data/spec/models/office_spec.rb +75 -0
- data/spec/models/open_house_spec.rb +115 -0
- data/spec/models/parking_spec.rb +65 -0
- data/spec/models/property_spec.rb +365 -0
- data/spec/models/sales_spec.rb +85 -0
- data/spec/models/school_spec.rb +75 -0
- data/spec/models/street_address_spec.rb +105 -0
- data/spec/models/tax_spec.rb +65 -0
- data/spec/spec_helper.rb +78 -0
- metadata +33 -18
- data/lib/simplyrets.rb~ +0 -34
- data/lib/simplyrets/api/#default_api.rb# +0 -146
- data/lib/simplyrets/simplyrets/api_error.rb +0 -26
- data/lib/simplyrets/simplyrets/configuration.rb +0 -101
- data/lib/simplyrets/simplyrets/request.rb +0 -248
- data/lib/simplyrets/simplyrets/response.rb +0 -156
- data/lib/simplyrets/simplyrets/version.rb +0 -5
- data/simplyrets-1.0.6.gem +0 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
=begin
|
2
|
+
SimplyRETS API
|
3
|
+
|
4
|
+
The SimplyRETS API is an exciting step towards making it easier for\ndevelopers and real estate agents to build something awesome with\nreal estate data!\n\nThe documentation below makes live requests to our API using the\ntrial data. To get set up with the API using live MLS data, you\nmust have RETS credentials from your MLS, which you can then use to\ncreate an app with SimplyRETS. For more information on that\nprocess, please see our [FAQ](https://simplyrets.com/faq), [Getting\nStarted](https://simplyrets.com/blog/getting-set-up.html) page, or\n[contact us](https://simplyrets.com/\\#home-contact).\n\nBelow you'll find the API endpoints, query parameters, response bodies,\nand other information about using the SimplyRETS API. You can run\nqueries by clicking the 'Try it Out' button at the bottom of each\nsection.\n\n### Authentication\nThe SimplyRETS API uses Basic Authentication. When you create an\napp, you'll get a set of API credentials to access your\nlistings. If you're trying out the test data, you can use\n`simplyrets:simplyrets` for connecting to the API.\n\n### Media Types\nThe SimplyRETS API uses the `Accept` header to allow clients to\ncontrol media types (content versions). We maintain backwards\ncompatibility with API clients by allowing them to specify a\ncontent version. We highly recommend setting and explicity media\ntype when your application reaches production. Both the structure\nand content of our API response bodies is subject to change so we\ncan add new features while respecting the stability of applications\nwhich have already been developed.\n\nTo always use the latest SimplyRETS content version, simply use\n`application/json` in your application `Accept` header.\n\nIf you want to pin your clients media type to a specific version,\nyou can use the vendor-specific SimplyRETS media type, e.g.\n`application/vnd.simplyrets-v0.1+json\"`\n\nTo view all valid content-types for making an `OPTIONS`, make a\nrequest to the SimplyRETS api root\n\n`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n\nThe default media types used in our API responses may change in the\nfuture. If you're building an application and care about the\nstability of the API, be sure to request a specific media type in the\nAccept header as shown in the examples below.\n\nThe wordpress plugin automatically sets the `Accept` header for the\ncompatible SimplyRETS media types.\n\n### Pagination\nThere a few pieces of useful information about each request stored\nin the HTTP Headers:\n\n- `X-Total-Count` shows you the total amount of listings that match\n your current query.\n- `Link` contains pre-built pagination links for accessing the next\n'page' of listings that match your query. Read more about that\n[here](https://simplyrets.com/blog/api-pagination.html).\n
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module SimplyRetsClient
|
14
|
+
VERSION = "2.0.0"
|
15
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
diff --git a/lib/simplyrets/api_client.rb b/lib/simplyrets/api_client.rb
|
2
|
+
index 84b814b..678ec23 100644
|
3
|
+
--- a/lib/simplyrets/api_client.rb
|
4
|
+
+++ b/lib/simplyrets/api_client.rb
|
5
|
+
@@ -332,3 +332,39 @@ module SimplyRetsClient
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
+
|
10
|
+
+
|
11
|
+
+# PATCH: array parameter rendering
|
12
|
+
+#
|
13
|
+
+# Typheous defaults to rendering array query parameters with
|
14
|
+
+# an index:
|
15
|
+
+#
|
16
|
+
+# ?points[0]=23.232,-98.232&points[1]=23.232,-98.232
|
17
|
+
+#
|
18
|
+
+# The simplyrets api uses the form:
|
19
|
+
+#
|
20
|
+
+# ?points=23.232,-98.232&points=23.232,-98.232
|
21
|
+
+#
|
22
|
+
+# this monkey-patch removes the array index when the query
|
23
|
+
+# parameter is rendered.
|
24
|
+
+module Ethon
|
25
|
+
+ class Easy
|
26
|
+
+ module Queryable
|
27
|
+
+ private
|
28
|
+
+ def recursively_generate_pairs(h, prefix, pairs)
|
29
|
+
+ case h
|
30
|
+
+ when Hash
|
31
|
+
+ h.each_pair do |k,v|
|
32
|
+
+ key = prefix.nil? ? k : "#{prefix}"
|
33
|
+
+ pairs_for(v, key, pairs)
|
34
|
+
+ end
|
35
|
+
+ when Array
|
36
|
+
+ h.each_with_index do |v, i|
|
37
|
+
+ key = "#{prefix}"
|
38
|
+
+ pairs_for(v, key, pairs)
|
39
|
+
+ end
|
40
|
+
+ end
|
41
|
+
+ end
|
42
|
+
+ end
|
43
|
+
+ end
|
44
|
+
+end
|
data/simplyrets.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "simplyrets/
|
3
|
+
require "simplyrets/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
|
7
7
|
s.name = "simplyrets"
|
8
|
-
s.version = SimplyRetsClient::
|
8
|
+
s.version = SimplyRetsClient::VERSION
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.authors = ["Christopher Reichert", "Cody Reichert"]
|
11
11
|
s.email = ["christopher@simplyrets.com", "cody@simplyrets.com"]
|
@@ -14,8 +14,8 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.description = %q{This gem provides a SimplyRETS SDK for creating real estate software with RETS data}
|
15
15
|
s.license = "MIT"
|
16
16
|
|
17
|
-
s.add_runtime_dependency 'typhoeus', '~> 0.
|
18
|
-
s.add_runtime_dependency 'json', '~> 1.
|
17
|
+
s.add_runtime_dependency 'typhoeus', '~> 0.8', '>= 0.8'
|
18
|
+
s.add_runtime_dependency 'json', '~> 1.8', '>= 1.8.3'
|
19
19
|
|
20
20
|
s.add_development_dependency 'rspec', '~> 3.2', '>= 3.2.0'
|
21
21
|
s.add_development_dependency 'vcr', '~> 2.9', '>= 2.9.3'
|
@@ -0,0 +1,172 @@
|
|
1
|
+
=begin
|
2
|
+
SimplyRETS API
|
3
|
+
|
4
|
+
The SimplyRETS API is an exciting step towards making it easier for\ndevelopers and real estate agents to build something awesome with\nreal estate data!\n\nThe documentation below makes live requests to our API using the\ntrial data. To get set up with the API using live MLS data, you\nmust have RETS credentials from your MLS, which you can then use to\ncreate an app with SimplyRETS. For more information on that\nprocess, please see our [FAQ](https://simplyrets.com/faq), [Getting\nStarted](https://simplyrets.com/blog/getting-set-up.html) page, or\n[contact us](https://simplyrets.com/\\#home-contact).\n\nBelow you'll find the API endpoints, query parameters, response bodies,\nand other information about using the SimplyRETS API. You can run\nqueries by clicking the 'Try it Out' button at the bottom of each\nsection.\n\n### Authentication\nThe SimplyRETS API uses Basic Authentication. When you create an\napp, you'll get a set of API credentials to access your\nlistings. If you're trying out the test data, you can use\n`simplyrets:simplyrets` for connecting to the API.\n\n### Media Types\nThe SimplyRETS API uses the 'Accept' header to allow clients to\ncontrol media types (content versions). We maintain backwards\ncompatibility with API clients by allowing them to specify a\ncontent version. We highly recommend setting and explicity media\ntype when your application reaches production. Both the structure\nand content of our API response bodies is subject to change so we\ncan add new features while respecting the stability of applications\nwhich have already been developed.\n\nTo always use the latest SimplyRETS content version, simply use\n`application/json` in your application `Accept` header.\n\nIf you want to pin your clients media type to a specific version,\nyou can use the vendor-specific SimplyRETS media type, e.g.\n`application/vnd.simplyrets-v0.1+json\"`\n\nTo view all valid content-types for making an `OPTIONS`, make a\nrequest to the SimplyRETS api root\n\n`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n\nThe default media types used in our API responses may change in the\nfuture. If you're building an application and care about the\nstability of the API, be sure to request a specific media type in the\nAccept header as shown in the examples below.\n\nThe wordpress plugin automatically sets the `Accept` header for the\ncompatible SimplyRETS media types.\n\n### Pagination\nThere a few pieces of useful information about each request stored\nin the HTTP Headers:\n\n- `X-Total-Count` shows you the total amount of listings that match\n your current query.\n- `Link` contains pre-built pagination links for accessing the next\n'page' of listings that match your query. Read more about that\n[here](https://simplyrets.com/blog/api-pagination.html).\n
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for SimplyRetsClient::DefaultApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'DefaultApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = SimplyRetsClient::DefaultApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of DefaultApi' do
|
30
|
+
it 'should create an instact of DefaultApi' do
|
31
|
+
@instance.should be_a(SimplyRetsClient::DefaultApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for openhouses_get
|
36
|
+
# The SimplyRETS OpenHouses API
|
37
|
+
# This is the main endpoint for accessing openhouses.\n
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @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
|
40
|
+
# @option opts [String] :listing_id Request openhouses for a specific `listingId`.\n
|
41
|
+
# @option opts [Array<String>] :cities Filter the openhouses returned by a list of valid cities. A\nlist of valid cities can be found by making an OPTIONS\nrequest to the `/openhouses` endpoint.\n
|
42
|
+
# @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
|
43
|
+
# @option opts [String] :agent Filter the listings returned by an agent ID. Note, the\nAgent ID is provided by your MLS.\n
|
44
|
+
# @option opts [Integer] :minprice Filter listings by a minimum price.\n
|
45
|
+
# @option opts [DateTime] :startdate Scheduled date and time of the open house showing
|
46
|
+
# @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
|
47
|
+
# @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
|
48
|
+
# @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
|
49
|
+
# @return [Array<OpenHouse>]
|
50
|
+
describe 'openhouses_get test' do
|
51
|
+
it "should work" do
|
52
|
+
# assertion here
|
53
|
+
# should be_a()
|
54
|
+
# should be_nil
|
55
|
+
# should ==
|
56
|
+
# should_not ==
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# unit tests for openhouses_open_house_key_get
|
61
|
+
# Single OpenHouse Endpoint
|
62
|
+
# Use this endpoint for accessing a single OpenHouse.\n
|
63
|
+
# @param open_house_key A unique OpenHouse identification key
|
64
|
+
# @param [Hash] opts the optional parameters
|
65
|
+
# @return [OpenHouse]
|
66
|
+
describe 'openhouses_open_house_key_get test' do
|
67
|
+
it "should work" do
|
68
|
+
# assertion here
|
69
|
+
# should be_a()
|
70
|
+
# should be_nil
|
71
|
+
# should ==
|
72
|
+
# should_not ==
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# unit tests for properties_get
|
77
|
+
# The SimplyRETS Listings API
|
78
|
+
# This is the main endpoint for accessing your properties. View\nall of the available query parameters and make requests below!\nThe API uses Basic Authentication, which most HTTP libraries\nwill handle for you. To use the test data (which is what this\npages uses), you can use the api key `simplyrets` and secret\n`simplyrets`. Note that these test listings are not live MLS\nlistings but the data, query parameters, and response bodies\nwill all work the same.\n
|
79
|
+
# @param [Hash] opts the optional parameters
|
80
|
+
# @option opts [String] :q A textual keyword search. This parameter will search the following\nfields, when available:\n\n - listingId (This does _not_ search the 'mlsId' field in the\nSimplyRETS response body)\n\n - street number\n\n - street name\n\n - mls area (major)\n\n - city\n\n - subdivision name\n\n - postal code\n\nNOTE\n
|
81
|
+
# @option opts [Array<String>] :status Request listings by a specific status. This parameter\ndefaults to active and you can specify multiple statuses\nin a single query.\n\n\nListing statuses depend on your MLS's availability. Below is\na brief description of each status with possible synonyms which\nmay map to your MLS-specific statuses\n- *Active*: Active Listing which is still on the market\n- *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\n- *Pending*: An offer has been accepted and the listing is no longer on market. Synonyms: Offer Accepted, Under Contract\n- *Hold*: The listing has been withdrawn from the market, but a contract\n\n still exists between the seller and the listing member. Synonyms:\nHold, Hold Do Not Show, Temp Off Market\n- *Withdrawn*: The listing has been withdrawn from the market, but a contract\n\n still exists between the seller and the listing member. Synonyms:\nHold, Hold Do Not Show, Temp Off Market\n- *Closed*: The purchase agreement has been fulfilled or the lease\n\n agreement has been executed. Synonyms: Sold, Leased, Rented, Closed\nSale\n- *Expired*: The listing contract has expired\n- *Delete*: The listing contract was never valid or other reason for the contract to be nullified. Synonyms: Kill, Zap\n- *Incomplete*: The listing has not yet be completely entered and is not yet\n\n published in the MLS. Synonyms: Draft, Partially Complted\n\n- *ComingSoon*\n
|
82
|
+
# @option opts [Array<String>] :type Request listings by a specific property type. This\ndefaults to Residential and Rental. You can specify\nmultiple property types in a single query.\n
|
83
|
+
# @option opts [String] :agent Filter the listings returned by an agent ID. Note, the\nAgent ID is provided by your MLS.\n
|
84
|
+
# @option opts [Array<String>] :brokers Filter the listings returned by brokerage with a Broker\nID. For some MLS areas, this is the ListOfficeId (Listing\nOffice ID). You can specific multiple broker\nparameters. Note, this query parameter is only available\nif a Broker ID is provided by your MLS.\n
|
85
|
+
# @option opts [Integer] :minprice Filter listings by a minimum price.\n
|
86
|
+
# @option opts [Integer] :maxprice Filter listings by a maximum price\n
|
87
|
+
# @option opts [Integer] :minarea Filter listings by a minimum area size in Sq Ft.\n
|
88
|
+
# @option opts [Integer] :maxarea Filter listings by a maximum area size in Sq Ft.\n
|
89
|
+
# @option opts [Integer] :minbaths Filter listings by a minimum number of bathrooms.\n
|
90
|
+
# @option opts [Integer] :maxbaths Filter listings by a maximum number of bathrooms.\n
|
91
|
+
# @option opts [Integer] :minbeds Filter listings by a minimum number of bedrooms.\n
|
92
|
+
# @option opts [Integer] :maxbeds Filter listings by a maximum number of bedrooms.\n
|
93
|
+
# @option opts [Integer] :maxdom Filter listings by a maximum number of days on market.\n_Note that your MLS must provide Days on Market data._\n
|
94
|
+
# @option opts [Integer] :minyear Filter listings by a setting a minimum year built.\n
|
95
|
+
# @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
|
96
|
+
# @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset\nparameter by the limit to go to the next \"page\" of\nlistings. Also take a look at the Link HTTP Header for\npre-built pagination.\n
|
97
|
+
# @option opts [String] :vendor Used to specify the vendor (MLS) to search from. This\nparameter is required on multi-MLS apps, and you can only\nquery one vendor at a time. To get your vendor id's make\nan OPTIONS request to https://api.simplyrets.com.\n
|
98
|
+
# @option opts [Array<String>] :postal_codes Filter the listings returned by postal codes / zip\ncode. You can specify multiple.\n
|
99
|
+
# @option opts [Array<String>] :features Filter the listings by specific interior features. You\ncan filter by multiple. For example, to filter trial listings\nby multiple features you can use,\nReturn listings that are within a set of latitude\nlongitude coordinates. For example,\n\n\n```\nWet Bar\nHigh Ceiling\n```\n\n\ne.g. `https://simplyrets.com/services?features=Wet%20Bar&features=High%20Ceiling`\n\n\nThe features provided by your MLS can be seen in your\nOPTIONS request. To view all valid features, make a\nrequest to the SimplyRETS api root\n\n\n`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n
|
100
|
+
# @option opts [String] :water Query water/waterfront listings only. Specify 'true' to\nfilter waterfront listings.\n
|
101
|
+
# @option opts [Array<String>] :neighborhoods Filter the listings returned by specific neighborhoods and\nsubdivisions. You can specify multiple.\n
|
102
|
+
# @option opts [Array<String>] :cities Filter the listings returned by specific cities. You can\nspecify multiple.\n
|
103
|
+
# @option opts [Array<String>] :counties Filter the listings returned by specific counties. You can\nspecify multiple.\n
|
104
|
+
# @option opts [Array<String>] :points Return listings that are within a set of latitude\nlongitude coordinates. For example;\n```\n29.723837,-95.69778\n29.938275,-95.69778\n29.938275,-95.32974\n29.723837,-95.32974\n```\nNote that some MLS's do not provide latitude and longitude\nfor their listings, which is required for this parameter\nto work. In these cases, SimplyRETS offers a [Geocoding\nAddon](https://simplyrets.com/services#geocoding).\n\n\nCheck out our\n[blog post](https://simplyrets.com/blog/interactive-map-search.html)\non using the `points` parameter to build a map-based app\nin javascript.\n
|
105
|
+
# @option opts [Array<String>] :include Include a extra fields which are not in the default\nresponse body\n- 'association' includes additional HOA data\n- 'agreement' information on the listing agreement\n- 'garageSpaces' additional garage data\n- 'maintenanceExpense' data on maintenance expenses\n- 'parking' additional parking data\n- 'pool' includes an additional pool description\n- 'taxAnnualAmount' include the annual tax amount\n- 'taxYear' include the tax year data\n- 'rooms' include parameter will include\n any additional rooms as a list.\n\nNote that your MLS must provide these fields in their RETS\ndata for them to be available in the API response.\n
|
106
|
+
# @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
|
107
|
+
# @return [Array<Listing>]
|
108
|
+
describe 'properties_get test' do
|
109
|
+
it "should work" do
|
110
|
+
SimplyRetsClient.configure do |config|
|
111
|
+
config.username = 'simplyrets'
|
112
|
+
config.password = 'simplyrets'
|
113
|
+
end
|
114
|
+
|
115
|
+
api = SimplyRetsClient::DefaultApi.new
|
116
|
+
listings = api.properties_get({:minbeds => 2, :limit => 50, :type => []})
|
117
|
+
|
118
|
+
# Ensure the
|
119
|
+
listings.should_not == []
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
describe 'properties_get property type query param' do
|
124
|
+
it "should work" do
|
125
|
+
SimplyRetsClient.configure do |config|
|
126
|
+
config.username = 'simplyrets'
|
127
|
+
config.password = 'simplyrets'
|
128
|
+
end
|
129
|
+
|
130
|
+
api = SimplyRetsClient::DefaultApi.new
|
131
|
+
listings = api.properties_get({:limit => 1, :type => ["RNT"]})
|
132
|
+
|
133
|
+
listings.find { |l| l.property.type == "RNT" }.should_not be_nil
|
134
|
+
listings.find { |l| l.property.type == "RES" }.should be_nil
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
|
139
|
+
describe 'properties_get multiple property types query param' do
|
140
|
+
it "should work" do
|
141
|
+
SimplyRetsClient.configure do |config|
|
142
|
+
config.username = 'simplyrets'
|
143
|
+
config.password = 'simplyrets'
|
144
|
+
end
|
145
|
+
|
146
|
+
api = SimplyRetsClient::DefaultApi.new
|
147
|
+
listings = api.properties_get({:limit => 20, :type => ["RNT","LND"]})
|
148
|
+
|
149
|
+
listings.find { |l| l.property.type == "RNT" }.should_not be_nil
|
150
|
+
listings.find { |l| l.property.type == "LND" }.should_not be_nil
|
151
|
+
listings.find { |l| l.property.type == "RES" }.should be_nil
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# unit tests for properties_mls_id_get
|
156
|
+
# Single Listing Endpoint
|
157
|
+
# Use this endpoint for accessing a single listing. When you\nmake a search to the `/properties` endpoint, each listing in\nthe response will contain a unique `mlsId` field which should\nbe used to request that listing on this route.\n\nThe `mlsId` field is a unique identifier for a listing which\nis specific to the SimplyRETS API only. It is different from\nthe `listingId` field is the public number given to a listing\nby the MLS and is not used here.\n
|
158
|
+
# @param mls_id The `mlsId` field is a unique identifier which is specific\nto the SimplyRETS API only. This field is different from\nthe `listingId` field (which is the public number given to\na listing by the MLS and is not used here).\n
|
159
|
+
# @param [Hash] opts the optional parameters
|
160
|
+
# @option opts [Array<String>] :include Include a extra fields which are not in the default\nresponse body\n- 'association' includes additional HOA data\n- 'agreement' information on the listing agreement\n- 'garageSpaces' additional garage data\n- 'maintenanceExpense' data on maintenance expenses\n- 'parking' additional parking data\n- 'pool' includes an additional pool description\n- 'rooms' include parameter will include\n any additional rooms as a list.\n\nNote that your MLS must provide these fields in their RETS\ndata for them to be available with valid data in the API\nresponse. If your MLS does not offer these fields, they will\ncontain 'null'.\n
|
161
|
+
# @return [Listing]
|
162
|
+
describe 'properties_mls_id_get test' do
|
163
|
+
it "should work" do
|
164
|
+
# assertion here
|
165
|
+
# should be_a()
|
166
|
+
# should be_nil
|
167
|
+
# should ==
|
168
|
+
# should_not ==
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
=begin
|
2
|
+
SimplyRETS API
|
3
|
+
|
4
|
+
The SimplyRETS API is an exciting step towards making it easier for\ndevelopers and real estate agents to build something awesome with\nreal estate data!\n\nThe documentation below makes live requests to our API using the\ntrial data. To get set up with the API using live MLS data, you\nmust have RETS credentials from your MLS, which you can then use to\ncreate an app with SimplyRETS. For more information on that\nprocess, please see our [FAQ](https://simplyrets.com/faq), [Getting\nStarted](https://simplyrets.com/blog/getting-set-up.html) page, or\n[contact us](https://simplyrets.com/\\#home-contact).\n\nBelow you'll find the API endpoints, query parameters, response bodies,\nand other information about using the SimplyRETS API. You can run\nqueries by clicking the 'Try it Out' button at the bottom of each\nsection.\n\n### Authentication\nThe SimplyRETS API uses Basic Authentication. When you create an\napp, you'll get a set of API credentials to access your\nlistings. If you're trying out the test data, you can use\n`simplyrets:simplyrets` for connecting to the API.\n\n### Media Types\nThe SimplyRETS API uses the 'Accept' header to allow clients to\ncontrol media types (content versions). We maintain backwards\ncompatibility with API clients by allowing them to specify a\ncontent version. We highly recommend setting and explicity media\ntype when your application reaches production. Both the structure\nand content of our API response bodies is subject to change so we\ncan add new features while respecting the stability of applications\nwhich have already been developed.\n\nTo always use the latest SimplyRETS content version, simply use\n`application/json` in your application `Accept` header.\n\nIf you want to pin your clients media type to a specific version,\nyou can use the vendor-specific SimplyRETS media type, e.g.\n`application/vnd.simplyrets-v0.1+json\"`\n\nTo view all valid content-types for making an `OPTIONS`, make a\nrequest to the SimplyRETS api root\n\n`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n\nThe default media types used in our API responses may change in the\nfuture. If you're building an application and care about the\nstability of the API, be sure to request a specific media type in the\nAccept header as shown in the examples below.\n\nThe wordpress plugin automatically sets the `Accept` header for the\ncompatible SimplyRETS media types.\n\n### Pagination\nThere a few pieces of useful information about each request stored\nin the HTTP Headers:\n\n- `X-Total-Count` shows you the total amount of listings that match\n your current query.\n- `Link` contains pre-built pagination links for accessing the next\n'page' of listings that match your query. Read more about that\n[here](https://simplyrets.com/blog/api-pagination.html).\n
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for SimplyRetsClient::Agent
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'Agent' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = SimplyRetsClient::Agent.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of Agent' do
|
31
|
+
it 'should create an instact of Agent' do
|
32
|
+
@instance.should be_a(SimplyRetsClient::Agent)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "last_name"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here
|
38
|
+
# should be_a()
|
39
|
+
# should be_nil
|
40
|
+
# should ==
|
41
|
+
# should_not ==
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe 'test attribute "contact"' do
|
46
|
+
it 'should work' do
|
47
|
+
# assertion here
|
48
|
+
# should be_a()
|
49
|
+
# should be_nil
|
50
|
+
# should ==
|
51
|
+
# should_not ==
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe 'test attribute "first_name"' do
|
56
|
+
it 'should work' do
|
57
|
+
# assertion here
|
58
|
+
# should be_a()
|
59
|
+
# should be_nil
|
60
|
+
# should ==
|
61
|
+
# should_not ==
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe 'test attribute "id"' do
|
66
|
+
it 'should work' do
|
67
|
+
# assertion here
|
68
|
+
# should be_a()
|
69
|
+
# should be_nil
|
70
|
+
# should ==
|
71
|
+
# should_not ==
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
=begin
|
2
|
+
SimplyRETS API
|
3
|
+
|
4
|
+
The SimplyRETS API is an exciting step towards making it easier for\ndevelopers and real estate agents to build something awesome with\nreal estate data!\n\nThe documentation below makes live requests to our API using the\ntrial data. To get set up with the API using live MLS data, you\nmust have RETS credentials from your MLS, which you can then use to\ncreate an app with SimplyRETS. For more information on that\nprocess, please see our [FAQ](https://simplyrets.com/faq), [Getting\nStarted](https://simplyrets.com/blog/getting-set-up.html) page, or\n[contact us](https://simplyrets.com/\\#home-contact).\n\nBelow you'll find the API endpoints, query parameters, response bodies,\nand other information about using the SimplyRETS API. You can run\nqueries by clicking the 'Try it Out' button at the bottom of each\nsection.\n\n### Authentication\nThe SimplyRETS API uses Basic Authentication. When you create an\napp, you'll get a set of API credentials to access your\nlistings. If you're trying out the test data, you can use\n`simplyrets:simplyrets` for connecting to the API.\n\n### Media Types\nThe SimplyRETS API uses the 'Accept' header to allow clients to\ncontrol media types (content versions). We maintain backwards\ncompatibility with API clients by allowing them to specify a\ncontent version. We highly recommend setting and explicity media\ntype when your application reaches production. Both the structure\nand content of our API response bodies is subject to change so we\ncan add new features while respecting the stability of applications\nwhich have already been developed.\n\nTo always use the latest SimplyRETS content version, simply use\n`application/json` in your application `Accept` header.\n\nIf you want to pin your clients media type to a specific version,\nyou can use the vendor-specific SimplyRETS media type, e.g.\n`application/vnd.simplyrets-v0.1+json\"`\n\nTo view all valid content-types for making an `OPTIONS`, make a\nrequest to the SimplyRETS api root\n\n`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n\nThe default media types used in our API responses may change in the\nfuture. If you're building an application and care about the\nstability of the API, be sure to request a specific media type in the\nAccept header as shown in the examples below.\n\nThe wordpress plugin automatically sets the `Accept` header for the\ncompatible SimplyRETS media types.\n\n### Pagination\nThere a few pieces of useful information about each request stored\nin the HTTP Headers:\n\n- `X-Total-Count` shows you the total amount of listings that match\n your current query.\n- `Link` contains pre-built pagination links for accessing the next\n'page' of listings that match your query. Read more about that\n[here](https://simplyrets.com/blog/api-pagination.html).\n
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for SimplyRetsClient::Broker
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'Broker' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = SimplyRetsClient::Broker.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of Broker' do
|
31
|
+
it 'should create an instact of Broker' do
|
32
|
+
@instance.should be_a(SimplyRetsClient::Broker)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "startdate"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here
|
38
|
+
# should be_a()
|
39
|
+
# should be_nil
|
40
|
+
# should ==
|
41
|
+
# should_not ==
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
=begin
|
2
|
+
SimplyRETS API
|
3
|
+
|
4
|
+
The SimplyRETS API is an exciting step towards making it easier for\ndevelopers and real estate agents to build something awesome with\nreal estate data!\n\nThe documentation below makes live requests to our API using the\ntrial data. To get set up with the API using live MLS data, you\nmust have RETS credentials from your MLS, which you can then use to\ncreate an app with SimplyRETS. For more information on that\nprocess, please see our [FAQ](https://simplyrets.com/faq), [Getting\nStarted](https://simplyrets.com/blog/getting-set-up.html) page, or\n[contact us](https://simplyrets.com/\\#home-contact).\n\nBelow you'll find the API endpoints, query parameters, response bodies,\nand other information about using the SimplyRETS API. You can run\nqueries by clicking the 'Try it Out' button at the bottom of each\nsection.\n\n### Authentication\nThe SimplyRETS API uses Basic Authentication. When you create an\napp, you'll get a set of API credentials to access your\nlistings. If you're trying out the test data, you can use\n`simplyrets:simplyrets` for connecting to the API.\n\n### Media Types\nThe SimplyRETS API uses the 'Accept' header to allow clients to\ncontrol media types (content versions). We maintain backwards\ncompatibility with API clients by allowing them to specify a\ncontent version. We highly recommend setting and explicity media\ntype when your application reaches production. Both the structure\nand content of our API response bodies is subject to change so we\ncan add new features while respecting the stability of applications\nwhich have already been developed.\n\nTo always use the latest SimplyRETS content version, simply use\n`application/json` in your application `Accept` header.\n\nIf you want to pin your clients media type to a specific version,\nyou can use the vendor-specific SimplyRETS media type, e.g.\n`application/vnd.simplyrets-v0.1+json\"`\n\nTo view all valid content-types for making an `OPTIONS`, make a\nrequest to the SimplyRETS api root\n\n`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n\nThe default media types used in our API responses may change in the\nfuture. If you're building an application and care about the\nstability of the API, be sure to request a specific media type in the\nAccept header as shown in the examples below.\n\nThe wordpress plugin automatically sets the `Accept` header for the\ncompatible SimplyRETS media types.\n\n### Pagination\nThere a few pieces of useful information about each request stored\nin the HTTP Headers:\n\n- `X-Total-Count` shows you the total amount of listings that match\n your current query.\n- `Link` contains pre-built pagination links for accessing the next\n'page' of listings that match your query. Read more about that\n[here](https://simplyrets.com/blog/api-pagination.html).\n
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for SimplyRetsClient::ContactInformation
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'ContactInformation' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = SimplyRetsClient::ContactInformation.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of ContactInformation' do
|
31
|
+
it 'should create an instact of ContactInformation' do
|
32
|
+
@instance.should be_a(SimplyRetsClient::ContactInformation)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "office"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here
|
38
|
+
# should be_a()
|
39
|
+
# should be_nil
|
40
|
+
# should ==
|
41
|
+
# should_not ==
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe 'test attribute "cell"' do
|
46
|
+
it 'should work' do
|
47
|
+
# assertion here
|
48
|
+
# should be_a()
|
49
|
+
# should be_nil
|
50
|
+
# should ==
|
51
|
+
# should_not ==
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe 'test attribute "full"' do
|
56
|
+
it 'should work' do
|
57
|
+
# assertion here
|
58
|
+
# should be_a()
|
59
|
+
# should be_nil
|
60
|
+
# should ==
|
61
|
+
# should_not ==
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
=begin
|
2
|
+
SimplyRETS API
|
3
|
+
|
4
|
+
The SimplyRETS API is an exciting step towards making it easier for\ndevelopers and real estate agents to build something awesome with\nreal estate data!\n\nThe documentation below makes live requests to our API using the\ntrial data. To get set up with the API using live MLS data, you\nmust have RETS credentials from your MLS, which you can then use to\ncreate an app with SimplyRETS. For more information on that\nprocess, please see our [FAQ](https://simplyrets.com/faq), [Getting\nStarted](https://simplyrets.com/blog/getting-set-up.html) page, or\n[contact us](https://simplyrets.com/\\#home-contact).\n\nBelow you'll find the API endpoints, query parameters, response bodies,\nand other information about using the SimplyRETS API. You can run\nqueries by clicking the 'Try it Out' button at the bottom of each\nsection.\n\n### Authentication\nThe SimplyRETS API uses Basic Authentication. When you create an\napp, you'll get a set of API credentials to access your\nlistings. If you're trying out the test data, you can use\n`simplyrets:simplyrets` for connecting to the API.\n\n### Media Types\nThe SimplyRETS API uses the 'Accept' header to allow clients to\ncontrol media types (content versions). We maintain backwards\ncompatibility with API clients by allowing them to specify a\ncontent version. We highly recommend setting and explicity media\ntype when your application reaches production. Both the structure\nand content of our API response bodies is subject to change so we\ncan add new features while respecting the stability of applications\nwhich have already been developed.\n\nTo always use the latest SimplyRETS content version, simply use\n`application/json` in your application `Accept` header.\n\nIf you want to pin your clients media type to a specific version,\nyou can use the vendor-specific SimplyRETS media type, e.g.\n`application/vnd.simplyrets-v0.1+json\"`\n\nTo view all valid content-types for making an `OPTIONS`, make a\nrequest to the SimplyRETS api root\n\n`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n\nThe default media types used in our API responses may change in the\nfuture. If you're building an application and care about the\nstability of the API, be sure to request a specific media type in the\nAccept header as shown in the examples below.\n\nThe wordpress plugin automatically sets the `Accept` header for the\ncompatible SimplyRETS media types.\n\n### Pagination\nThere a few pieces of useful information about each request stored\nin the HTTP Headers:\n\n- `X-Total-Count` shows you the total amount of listings that match\n your current query.\n- `Link` contains pre-built pagination links for accessing the next\n'page' of listings that match your query. Read more about that\n[here](https://simplyrets.com/blog/api-pagination.html).\n
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for SimplyRetsClient::Error
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'Error' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = SimplyRetsClient::Error.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of Error' do
|
31
|
+
it 'should create an instact of Error' do
|
32
|
+
@instance.should be_a(SimplyRetsClient::Error)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "error"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here
|
38
|
+
# should be_a()
|
39
|
+
# should be_nil
|
40
|
+
# should ==
|
41
|
+
# should_not ==
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe 'test attribute "message"' do
|
46
|
+
it 'should work' do
|
47
|
+
# assertion here
|
48
|
+
# should be_a()
|
49
|
+
# should be_nil
|
50
|
+
# should ==
|
51
|
+
# should_not ==
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|