simplyrets 1.0.7 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +23 -21
  3. data/Makefile +48 -0
  4. data/README.org +5 -58
  5. data/example.rb +14 -4
  6. data/lib/simplyrets.rb +42 -21
  7. data/lib/simplyrets/api/default_api.rb +292 -59
  8. data/lib/simplyrets/api_client.rb +370 -0
  9. data/lib/simplyrets/api_error.rb +36 -0
  10. data/lib/simplyrets/configuration.rb +170 -0
  11. data/lib/simplyrets/models/agent.rb +146 -11
  12. data/lib/simplyrets/models/broker.rb +133 -7
  13. data/lib/simplyrets/models/contact_information.rb +149 -17
  14. data/lib/simplyrets/models/error.rb +138 -9
  15. data/lib/simplyrets/models/geographic_data.rb +150 -12
  16. data/lib/simplyrets/models/listing.rb +248 -49
  17. data/lib/simplyrets/models/mls_information.rb +148 -12
  18. data/lib/simplyrets/models/office.rb +146 -11
  19. data/lib/simplyrets/models/open_house.rb +215 -12
  20. data/lib/simplyrets/models/parking.rb +148 -17
  21. data/lib/simplyrets/models/property.rb +353 -129
  22. data/lib/simplyrets/models/sales.rb +163 -25
  23. data/lib/simplyrets/models/school.rb +167 -24
  24. data/lib/simplyrets/models/street_address.rb +204 -26
  25. data/lib/simplyrets/models/tax.rb +150 -18
  26. data/lib/simplyrets/version.rb +15 -0
  27. data/multi-query-param.patch +44 -0
  28. data/simplyrets.gemspec +4 -4
  29. data/spec/api/default_api_spec.rb +172 -0
  30. data/spec/models/agent_spec.rb +75 -0
  31. data/spec/models/broker_spec.rb +45 -0
  32. data/spec/models/contact_information_spec.rb +65 -0
  33. data/spec/models/error_spec.rb +55 -0
  34. data/spec/models/geographic_data_spec.rb +85 -0
  35. data/spec/models/listing_spec.rb +245 -0
  36. data/spec/models/mls_information_spec.rb +75 -0
  37. data/spec/models/office_spec.rb +75 -0
  38. data/spec/models/open_house_spec.rb +115 -0
  39. data/spec/models/parking_spec.rb +65 -0
  40. data/spec/models/property_spec.rb +365 -0
  41. data/spec/models/sales_spec.rb +85 -0
  42. data/spec/models/school_spec.rb +75 -0
  43. data/spec/models/street_address_spec.rb +105 -0
  44. data/spec/models/tax_spec.rb +65 -0
  45. data/spec/spec_helper.rb +78 -0
  46. metadata +33 -18
  47. data/lib/simplyrets.rb~ +0 -34
  48. data/lib/simplyrets/api/#default_api.rb# +0 -146
  49. data/lib/simplyrets/simplyrets/api_error.rb +0 -26
  50. data/lib/simplyrets/simplyrets/configuration.rb +0 -101
  51. data/lib/simplyrets/simplyrets/request.rb +0 -248
  52. data/lib/simplyrets/simplyrets/response.rb +0 -156
  53. data/lib/simplyrets/simplyrets/version.rb +0 -5
  54. data/simplyrets-1.0.6.gem +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 412b35e38999019546945d6529debef414e4844f
4
- data.tar.gz: ad7e6a70f4633e31c0daa4e67dd800030308fb6e
3
+ metadata.gz: fd6ac1b309459141e337958620bea863fb7bee7a
4
+ data.tar.gz: 94eb10e7dcc77dfc5028fa7dbbfd38f2423485c6
5
5
  SHA512:
6
- metadata.gz: 8695c34518124f980b505d15034ad99e2ff34ec227e8e041da470e857d7f06d5f6d402f3dcc267db43d1a33534d2a26c2f79d793671514f3ec4cedd7481eec52
7
- data.tar.gz: be04eb5215c2b210934bad81bbba88473ed7b5f4ba4d461cd1582543ecbd9958e2ba8cd412034a245a7ec8f97d0821bbddf71fd82228bbda67d64870e4a00120
6
+ metadata.gz: fb6ff3e6b1116074b14c484f789b60c93bafb05a14dd243a724fe99135ba84e6c5c370cb3eaea26542f797bf7d809efa066eb82b0faca98da29060dfc0b43190
7
+ data.tar.gz: 68b9672f0ff6eacdd04daa61ed8ce304431888c0e6e833c1ba548f188396263ea92e2b17faa59f7615c3157a1ef858f3c522f47e1891ea7829b77364b8daf2e4
@@ -1,50 +1,52 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simplyrets (1.0.7)
5
- json (~> 1.4, >= 1.4.6)
6
- typhoeus (~> 0.2, >= 0.2.1)
4
+ simplyrets (2.0.0)
5
+ json (~> 1.8, >= 1.8.3)
6
+ typhoeus (~> 0.8, >= 0.8)
7
7
 
8
8
  GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
11
  ZenTest (4.11.0)
12
- addressable (2.3.8)
12
+ addressable (2.4.0)
13
13
  autotest (4.4.6)
14
14
  ZenTest (>= 4.4.1)
15
- autotest-fsevent (0.2.10)
15
+ autotest-fsevent (0.2.11)
16
16
  sys-uname
17
17
  autotest-growl (0.2.16)
18
18
  autotest-rails-pure (4.1.2)
19
- crack (0.4.2)
19
+ crack (0.4.3)
20
20
  safe_yaml (~> 1.0.0)
21
21
  diff-lcs (1.2.5)
22
- ethon (0.7.4)
22
+ ethon (0.9.0)
23
23
  ffi (>= 1.3.0)
24
24
  ffi (1.9.10)
25
+ hashdiff (0.3.0)
25
26
  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)
27
+ rspec (3.4.0)
28
+ rspec-core (~> 3.4.0)
29
+ rspec-expectations (~> 3.4.0)
30
+ rspec-mocks (~> 3.4.0)
31
+ rspec-core (3.4.4)
32
+ rspec-support (~> 3.4.0)
33
+ rspec-expectations (3.4.0)
33
34
  diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.3.0)
35
- rspec-mocks (3.3.2)
35
+ rspec-support (~> 3.4.0)
36
+ rspec-mocks (3.4.1)
36
37
  diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.3.0)
38
- rspec-support (3.3.0)
38
+ rspec-support (~> 3.4.0)
39
+ rspec-support (3.4.1)
39
40
  safe_yaml (1.0.4)
40
41
  sys-uname (1.0.2)
41
42
  ffi (>= 1.0.0)
42
- typhoeus (0.7.3)
43
- ethon (>= 0.7.4)
43
+ typhoeus (0.8.0)
44
+ ethon (>= 0.8.0)
44
45
  vcr (2.9.3)
45
- webmock (1.21.0)
46
+ webmock (1.24.6)
46
47
  addressable (>= 2.3.6)
47
48
  crack (>= 0.3.2)
49
+ hashdiff
48
50
 
49
51
  PLATFORMS
50
52
  ruby
@@ -0,0 +1,48 @@
1
+
2
+ FILES=$(shell git ls-files lib/ spec/ example.rb simplyrets.gemspec)
3
+
4
+ generate: ruby-client.zip
5
+ rm -rf ruby-client/
6
+ unzip ruby-client.zip
7
+ cp -r ruby-client/lib/swagger_client.rb lib/simplyrets.rb
8
+ cp -r ruby-client/lib/swagger_client/* lib/simplyrets/
9
+
10
+ sed -i 's/SwaggerClient/SimplyRetsClient/g' $(FILES)
11
+ sed -i 's/swagger_client/simplyrets/g' $(FILES)
12
+ sed -i 's/VERSION = "1.0.0"/VERSION = "2.0.0"/g' $(FILES)
13
+ sed -i 's/simplyrets (1.0.0)/simplyrets (2.0.0)/g' $(FILES)
14
+
15
+ git grep -I --name-only -z -e '' | \
16
+ xargs -0 sed -i -e 's/[ \t]\+\(\r\?\)$$/\1/'
17
+
18
+ patch -p1 < multi-query-param.patch
19
+
20
+ ruby-client.zip:
21
+ curl -XPOST http://generator.swagger.io/api/gen/clients/ruby \
22
+ --verbose -D - --fail --show-error --insecure -s \
23
+ -H 'Origin: http://editor.swagger.io' \
24
+ -H 'Referer: http://editor.swagger.io' \
25
+ -H 'Accept: application/json' \
26
+ -H 'Content-Type: application/json' \
27
+ -d '{"swaggerUrl": "https://docs.simplyrets.com/api/resources.json"}' \
28
+ -o ruby-client.meta
29
+
30
+ cat ruby-client.meta | \
31
+ jq --raw-output .link | \
32
+ xargs curl --output ruby-client.zip
33
+
34
+ example:
35
+ bundle exec ./example.rb
36
+
37
+ test:
38
+ bundle exec rspec
39
+
40
+ release:
41
+ rm -f simplyrets-2.0.0.gem
42
+ gem build simplyrets.gemspec
43
+ #gem push simplyrets-2.0.0.gem
44
+
45
+ clean:
46
+ rm -f ruby-client.zip
47
+ rm -f ruby-client.meta
48
+ rm -rf ruby-client
data/README.org CHANGED
@@ -30,73 +30,20 @@ You can view the full API Documentation [[https://docs.simplyrets.com/api/index.
30
30
  %w(rubygems simplyrets).each {|models| require models}
31
31
 
32
32
  require "simplyrets"
33
- require "properties_api"
34
- require "listing"
35
33
 
36
- SimplyRetsClient::SimplyRets.configure do |config|
34
+ SimplyRetsClient.configure do |config|
37
35
  config.username = 'simplyrets'
38
36
  config.password = 'simplyrets'
39
37
  end
40
38
 
41
39
  # all properties
42
- ps = Properties_api.properties()
43
- p ps
40
+ listings = SimplyRetsClient::DefaultApi.new.properties_get()
41
+ p listings
44
42
  #+END_SRC
45
43
 
46
44
 
47
- ** Setup the client
48
-
49
- To start using the SDK, require =simplyrets= in your gemspec and
50
- configure a client by setting your API key and API secret (we have
51
- demo credentials available you can use for free!). Here's a short
52
- example:
53
-
54
- #+BEGIN_SRC ruby
55
- require 'simplyrets'
56
-
57
- SimplyRetsClient::SimplyRets.configure do |config|
58
- config.username = 'simplyrets'
59
- config.password = 'simplyrets'
60
- end
61
- #+END_SRC
62
-
63
-
64
- ** Examples: Making Requests
65
-
66
- Once you have instantiated the API Client, you can use the
67
- Properties API to make requests for multiple or single listings.
68
-
69
- Request all listings with no filters:
70
- #+BEGIN_SRC ruby
71
- require 'properties_api'
72
-
73
- ps = SimplyRetsClient::Properties_api.properties()
74
- p ps
75
- #+END_SRC
76
-
77
- Request a single listing by id:
78
- #+BEGIN_SRC ruby
79
- l = SimplyRetsClient::Properties_api.property(mls_id=19548526)
80
- p l.mls
81
- #+END_SRC
82
-
83
-
84
- Multiple query parameters can be sent to the API to request more
85
- refined results:
86
- #+BEGIN_SRC ruby
87
- # listings with minprice of $700,000 and minbeds of 4
88
- ps = SimplyRetsClient::Properties_api.properties({:minprice => 700000, :minbeds => 4})
89
- p ps
90
- #+END_SRC
91
-
92
- Sending back points to get listings in a geographical area:
93
- #+BEGIN_SRC ruby
94
- # listings within geographics points
95
- points = ["29.723837146389066,-95.69778442382812" ,"29.938275329718987,-95.778442382812" ,"29.938275329718987,-95.32974243164061","29.723837146389066,-95.32974243164061"]
96
- ps = SimplyRetsClient::Properties_api.properties({:points => points})
97
- p ps
98
- #+END_SRC
99
-
45
+ See the =examples.rb= file for more examples on how to call the
46
+ api with query parameters.
100
47
 
101
48
  ** Additional Info
102
49
 
data/example.rb CHANGED
@@ -3,26 +3,36 @@
3
3
  %w(rubygems simplyrets).each {|lib| require lib}
4
4
  %w(rubygems simplyrets).each {|models| require models}
5
5
 
6
- require "simplyrets"
6
+ require 'simplyrets'
7
7
 
8
8
  p "SimplyRets Ruby SDK"
9
9
 
10
- SimplyRetsClient::SimplyRets.configure do |config|
10
+ SimplyRetsClient.configure do |config|
11
11
  config.username = 'simplyrets'
12
12
  config.password = 'simplyrets'
13
+ #config.debugging = true
13
14
  end
14
15
 
16
+ # specify a set of latitude/longitude coordinates
15
17
  points = [ "29.723837146389066,-95.69778442382812", "29.938275329718987,-95.69778442382812", "29.938275329718987,-95.32974243164061", "29.723837146389066,-95.32974243164061" ]
16
18
 
17
19
  # Properties
18
- listings = SimplyRetsClient::Properties_api.properties({:minbeds => 2, :points => points})
20
+
21
+ # instantiate a new api client
22
+ api = SimplyRetsClient::DefaultApi.new
23
+
24
+ # call GET /properties
25
+ listings = api.properties_get({:minbeds => 2, :limit => 50, :type => ["Residential", "Rental"]})
19
26
  listings.each do |l|
27
+ p l.property.type
20
28
  p l.property
21
29
  p l.property.bedrooms
22
30
  p l.office.brokerid
23
31
  end
24
32
 
25
33
  # Single Listing
26
- prop = SimplyRetsClient::Properties_api.property(1005221)
34
+
35
+ # call GET /properties/{mlsId}
36
+ prop = api.properties_mls_id_get(1005221)
27
37
  p prop
28
38
  p prop.geo.lat
@@ -1,34 +1,55 @@
1
- # SimplyRets common files
2
- require 'simplyrets/simplyrets'
3
- require 'simplyrets/simplyrets/configuration'
4
- require 'simplyrets/simplyrets/api_error'
5
- require 'simplyrets/simplyrets/request'
6
- require 'simplyrets/simplyrets/response'
7
- require 'simplyrets/simplyrets/version'
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
+ # Common files
14
+ require 'simplyrets/api_client'
15
+ require 'simplyrets/api_error'
16
+ require 'simplyrets/version'
17
+ require 'simplyrets/configuration'
8
18
 
9
19
  # Models
10
- require 'simplyrets/models/base_object'
11
- require 'simplyrets/models/street_address'
12
- require 'simplyrets/models/property'
20
+ require 'simplyrets/models/agent'
21
+ require 'simplyrets/models/broker'
22
+ require 'simplyrets/models/contact_information'
23
+ require 'simplyrets/models/error'
24
+ require 'simplyrets/models/geographic_data'
13
25
  require 'simplyrets/models/listing'
14
- require 'simplyrets/models/open_house'
26
+ require 'simplyrets/models/mls_information'
15
27
  require 'simplyrets/models/office'
16
- require 'simplyrets/models/agent'
28
+ require 'simplyrets/models/open_house'
29
+ require 'simplyrets/models/parking'
30
+ require 'simplyrets/models/property'
17
31
  require 'simplyrets/models/sales'
18
32
  require 'simplyrets/models/school'
19
- require 'simplyrets/models/parking'
20
- require 'simplyrets/models/contact_information'
33
+ require 'simplyrets/models/street_address'
21
34
  require 'simplyrets/models/tax'
22
- require 'simplyrets/models/geographic_data'
23
- require 'simplyrets/models/broker'
24
- require 'simplyrets/models/mls_information'
25
- require 'simplyrets/models/error'
26
35
 
27
36
  # APIs
28
37
  require 'simplyrets/api/default_api'
29
38
 
30
39
  module SimplyRetsClient
31
- # Initialize the default configuration
32
- SimplyRets.configuration = SimplyRets::Configuration.new
33
- SimplyRets.configure { |config| }
40
+ class << self
41
+ # Customize default settings for the SDK using block.
42
+ # SimplyRetsClient.configure do |config|
43
+ # config.username = "xxx"
44
+ # config.password = "xxx"
45
+ # end
46
+ # If no block given, return the default Configuration object.
47
+ def configure
48
+ if block_given?
49
+ yield(Configuration.default)
50
+ else
51
+ Configuration.default
52
+ end
53
+ end
54
+ end
34
55
  end
@@ -1,85 +1,297 @@
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
+
1
13
  require "uri"
2
14
 
3
15
  module SimplyRetsClient
4
- class Properties_api
16
+ class DefaultApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
5
22
 
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
23
+ # The SimplyRETS OpenHouses API
24
+ # This is the main endpoint for accessing openhouses.\n
8
25
  # @param [Hash] opts the optional parameters
9
- # @option opts [String] :q A fuzzy keyword search.\n
26
+ # @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
27
+ # @option opts [String] :listing_id Request openhouses for a specific `listingId`.\n
28
+ # @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
29
+ # @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
30
+ # @option opts [String] :agent Filter the listings returned by an agent ID. Note, the\nAgent ID is provided by your MLS.\n
10
31
  # @option opts [Integer] :minprice Filter listings by a minimum price.\n
11
- # @option opts [Integer] :maxprice Filter listings by a maximum price\n
32
+ # @option opts [DateTime] :startdate Scheduled date and time of the open house showing
33
+ # @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset parameter\nby the limit to go to the next \&quot;page\&quot; of listings. Also take\na look at the Link HTTP Header for pre-built pagination.\n
34
+ # @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
35
+ # @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
36
+ # @return [Array<OpenHouse>]
37
+ def openhouses_get(opts = {})
38
+ data, status_code, headers = openhouses_get_with_http_info(opts)
39
+ return data
40
+ end
41
+
42
+ # The SimplyRETS OpenHouses API
43
+ # This is the main endpoint for accessing openhouses.\n
44
+ # @param [Hash] opts the optional parameters
45
+ # @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
46
+ # @option opts [String] :listing_id Request openhouses for a specific `listingId`.\n
47
+ # @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
48
+ # @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
49
+ # @option opts [String] :agent Filter the listings returned by an agent ID. Note, the\nAgent ID is provided by your MLS.\n
50
+ # @option opts [Integer] :minprice Filter listings by a minimum price.\n
51
+ # @option opts [DateTime] :startdate Scheduled date and time of the open house showing
52
+ # @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset parameter\nby the limit to go to the next \&quot;page\&quot; of listings. Also take\na look at the Link HTTP Header for pre-built pagination.\n
53
+ # @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
54
+ # @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
55
+ # @return [Array<(Array<OpenHouse>, Fixnum, Hash)>] Array<OpenHouse> data, response status code and response headers
56
+ def openhouses_get_with_http_info(opts = {})
57
+ if @api_client.config.debugging
58
+ @api_client.config.logger.debug "Calling API: DefaultApi#openhouses_get ..."
59
+ end
60
+
61
+ if opts[:'type'] && !['Residential', 'Rental', 'Multifamily', 'Condominium', 'Commercial', 'Land'].include?(opts[:'type'])
62
+ fail 'invalid value for "type", must be one of Residential, Rental, Multifamily, Condominium, Commercial, Land'
63
+ end
64
+
65
+ if opts[:'sort'] && !['listprice', '-listprice', 'listdate', '-listdate', 'beds', '-beds', 'baths', '-baths'].include?(opts[:'sort'])
66
+ fail 'invalid value for "sort", must be one of listprice, -listprice, listdate, -listdate, beds, -beds, baths, -baths'
67
+ end
68
+
69
+ # resource path
70
+ local_var_path = "/openhouses".sub('{format}','json')
71
+
72
+ # query parameters
73
+ query_params = {}
74
+ query_params[:'type'] = opts[:'type'] if opts[:'type']
75
+ query_params[:'listingId'] = opts[:'listing_id'] if opts[:'listing_id']
76
+ query_params[:'cities'] = @api_client.build_collection_param(opts[:'cities'], :multi) if opts[:'cities']
77
+ query_params[:'brokers'] = @api_client.build_collection_param(opts[:'brokers'], :multi) if opts[:'brokers']
78
+ query_params[:'agent'] = opts[:'agent'] if opts[:'agent']
79
+ query_params[:'minprice'] = opts[:'minprice'] if opts[:'minprice']
80
+ query_params[:'startdate'] = opts[:'startdate'] if opts[:'startdate']
81
+ query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
82
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
83
+ query_params[:'sort'] = opts[:'sort'] if opts[:'sort']
84
+
85
+ # header parameters
86
+ header_params = {}
87
+
88
+ # HTTP header 'Accept' (if needed)
89
+ _header_accept = ['application/json', 'application/vnd.simplyrets-v0.1+json']
90
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
91
+
92
+ # HTTP header 'Content-Type'
93
+ _header_content_type = ['application/json']
94
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
95
+
96
+ # form parameters
97
+ form_params = {}
98
+
99
+ # http body (model)
100
+ post_body = nil
101
+
102
+ auth_names = ['basicAuth']
103
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
104
+ :header_params => header_params,
105
+ :query_params => query_params,
106
+ :form_params => form_params,
107
+ :body => post_body,
108
+ :auth_names => auth_names,
109
+ :return_type => 'Array<OpenHouse>')
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug "API called: DefaultApi#openhouses_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
112
+ end
113
+ return data, status_code, headers
114
+ end
115
+
116
+ # Single OpenHouse Endpoint
117
+ # Use this endpoint for accessing a single OpenHouse.\n
118
+ # @param open_house_key A unique OpenHouse identification key
119
+ # @param [Hash] opts the optional parameters
120
+ # @return [OpenHouse]
121
+ def openhouses_open_house_key_get(open_house_key, opts = {})
122
+ data, status_code, headers = openhouses_open_house_key_get_with_http_info(open_house_key, opts)
123
+ return data
124
+ end
125
+
126
+ # Single OpenHouse Endpoint
127
+ # Use this endpoint for accessing a single OpenHouse.\n
128
+ # @param open_house_key A unique OpenHouse identification key
129
+ # @param [Hash] opts the optional parameters
130
+ # @return [Array<(OpenHouse, Fixnum, Hash)>] OpenHouse data, response status code and response headers
131
+ def openhouses_open_house_key_get_with_http_info(open_house_key, opts = {})
132
+ if @api_client.config.debugging
133
+ @api_client.config.logger.debug "Calling API: DefaultApi#openhouses_open_house_key_get ..."
134
+ end
135
+
136
+ # verify the required parameter 'open_house_key' is set
137
+ fail "Missing the required parameter 'open_house_key' when calling openhouses_open_house_key_get" if open_house_key.nil?
138
+
139
+ # resource path
140
+ local_var_path = "/openhouses/{openHouseKey}".sub('{format}','json').sub('{' + 'openHouseKey' + '}', open_house_key.to_s)
141
+
142
+ # query parameters
143
+ query_params = {}
144
+
145
+ # header parameters
146
+ header_params = {}
147
+
148
+ # HTTP header 'Accept' (if needed)
149
+ _header_accept = ['application/json', 'application/vnd.simplyrets-v0.1+json']
150
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
151
+
152
+ # HTTP header 'Content-Type'
153
+ _header_content_type = ['application/json']
154
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
155
+
156
+ # form parameters
157
+ form_params = {}
158
+
159
+ # http body (model)
160
+ post_body = nil
161
+
162
+ auth_names = ['basicAuth']
163
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
164
+ :header_params => header_params,
165
+ :query_params => query_params,
166
+ :form_params => form_params,
167
+ :body => post_body,
168
+ :auth_names => auth_names,
169
+ :return_type => 'OpenHouse')
170
+ if @api_client.config.debugging
171
+ @api_client.config.logger.debug "API called: DefaultApi#openhouses_open_house_key_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
172
+ end
173
+ return data, status_code, headers
174
+ end
175
+
176
+ # The SimplyRETS Listings API
177
+ # 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
178
+ # @param [Hash] opts the optional parameters
179
+ # @option opts [String] :q A textual keyword search. This parameter will search the following\nfields, when available:\n - listingId (This does _not_ search the `mlsId` field in the SimplyRETS response body)\n - street number\n - street name\n - mls area (major)\n - city\n - subdivision name\n - postal code\nNOTE\n
180
+ # @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\nListing statuses depend on your MLS&#39;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 still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market\n- *Withdrawn*: The listing has been withdrawn from the market, but a contract\n still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market\n- *Closed*: The purchase agreement has been fulfilled or the lease\n agreement has been executed. Synonyms: Sold, Leased, Rented, Closed Sale\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 published in the MLS. Synonyms: Draft, Partially Complted\n- *ComingSoon*\n
181
+ # @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
12
182
  # @option opts [String] :agent Filter the listings returned by an agent ID. Note, the\nAgent ID is provided by your MLS.\n
183
+ # @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
184
+ # @option opts [Integer] :minprice Filter listings by a minimum price.\n
185
+ # @option opts [Integer] :maxprice Filter listings by a maximum price\n
13
186
  # @option opts [Integer] :minarea Filter listings by a minimum area size in Sq Ft.\n
14
187
  # @option opts [Integer] :maxarea Filter listings by a maximum area size in Sq Ft.\n
15
188
  # @option opts [Integer] :minbaths Filter listings by a minimum number of bathrooms.\n
16
189
  # @option opts [Integer] :maxbaths Filter listings by a maximum number of bathrooms.\n
17
190
  # @option opts [Integer] :minbeds Filter listings by a minimum number of bedrooms.\n
18
191
  # @option opts [Integer] :maxbeds Filter listings by a maximum number of bedrooms.\n
192
+ # @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
193
+ # @option opts [Integer] :minyear Filter listings by a setting a minimum year built.\n
19
194
  # @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 \&quot;page\&quot; 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
195
+ # @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset\nparameter by the limit to go to the next \&quot;page\&quot; of\nlistings. Also take a look at the Link HTTP Header for\npre-built pagination.\n
196
+ # @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&#39;s make\nan OPTIONS request to https://api.simplyrets.com.\n
197
+ # @option opts [Array<String>] :postal_codes Filter the listings returned by postal codes / zip\ncode. You can specify multiple.\n
198
+ # @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```\nWet Bar\nHigh Ceiling\n```\n\ne.g. `https://simplyrets.com/services?features=Wet%20Bar&amp;features=High%20Ceiling`\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`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n
199
+ # @option opts [String] :water Query water/waterfront listings only. Specify `true` to\nfilter waterfront listings.\n
24
200
  # @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
201
+ # @option opts [Array<String>] :cities Filter the listings returned by specific cities. You can\nspecify multiple.\n
26
202
  # @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 searching by Residential & Rental, and you can only specify multiple property types in a single query.\n
203
+ # @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&#39;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\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
204
+ # @option opts [Array<String>] :include Include a extra fields which are not in the default\nresponse body\n- &#39;association&#39; includes additional HOA data\n- &#39;agreement&#39; information on the listing agreement\n- &#39;garageSpaces&#39; additional garage data\n- &#39;maintenanceExpense&#39; data on maintenance expenses\n- &#39;parking&#39; additional parking data\n- &#39;pool&#39; includes an additional pool description\n- &#39;taxAnnualAmount&#39; include the annual tax amount\n- &#39;taxYear&#39; include the tax year data\n- &#39;rooms&#39; 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
29
205
  # @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- &#39;rooms&#39; include parameter will include\n any additional rooms as a list.\n- &#39;pool&#39; includes an additional pool description\n- &#39;association&#39; includes additional home owners association data\n
31
206
  # @return [Array<Listing>]
32
- def self.properties(opts = {})
33
- if SimplyRets.configuration.debug
34
- SimplyRets.logger.debug "Calling API: DefaultApi#properties ..."
207
+ def properties_get(opts = {})
208
+ data, status_code, headers = properties_get_with_http_info(opts)
209
+ return data
210
+ end
211
+
212
+ # The SimplyRETS Listings API
213
+ # 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
214
+ # @param [Hash] opts the optional parameters
215
+ # @option opts [String] :q A textual keyword search. This parameter will search the following\nfields, when available:\n - listingId (This does _not_ search the `mlsId` field in the SimplyRETS response body)\n - street number\n - street name\n - mls area (major)\n - city\n - subdivision name\n - postal code\nNOTE\n
216
+ # @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\nListing statuses depend on your MLS&#39;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 still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market\n- *Withdrawn*: The listing has been withdrawn from the market, but a contract\n still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market\n- *Closed*: The purchase agreement has been fulfilled or the lease\n agreement has been executed. Synonyms: Sold, Leased, Rented, Closed Sale\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 published in the MLS. Synonyms: Draft, Partially Complted\n- *ComingSoon*\n
217
+ # @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
218
+ # @option opts [String] :agent Filter the listings returned by an agent ID. Note, the\nAgent ID is provided by your MLS.\n
219
+ # @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
220
+ # @option opts [Integer] :minprice Filter listings by a minimum price.\n
221
+ # @option opts [Integer] :maxprice Filter listings by a maximum price\n
222
+ # @option opts [Integer] :minarea Filter listings by a minimum area size in Sq Ft.\n
223
+ # @option opts [Integer] :maxarea Filter listings by a maximum area size in Sq Ft.\n
224
+ # @option opts [Integer] :minbaths Filter listings by a minimum number of bathrooms.\n
225
+ # @option opts [Integer] :maxbaths Filter listings by a maximum number of bathrooms.\n
226
+ # @option opts [Integer] :minbeds Filter listings by a minimum number of bedrooms.\n
227
+ # @option opts [Integer] :maxbeds Filter listings by a maximum number of bedrooms.\n
228
+ # @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
229
+ # @option opts [Integer] :minyear Filter listings by a setting a minimum year built.\n
230
+ # @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
231
+ # @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset\nparameter by the limit to go to the next \&quot;page\&quot; of\nlistings. Also take a look at the Link HTTP Header for\npre-built pagination.\n
232
+ # @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&#39;s make\nan OPTIONS request to https://api.simplyrets.com.\n
233
+ # @option opts [Array<String>] :postal_codes Filter the listings returned by postal codes / zip\ncode. You can specify multiple.\n
234
+ # @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```\nWet Bar\nHigh Ceiling\n```\n\ne.g. `https://simplyrets.com/services?features=Wet%20Bar&amp;features=High%20Ceiling`\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`curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/`\n
235
+ # @option opts [String] :water Query water/waterfront listings only. Specify `true` to\nfilter waterfront listings.\n
236
+ # @option opts [Array<String>] :neighborhoods Filter the listings returned by specific neighborhoods and\nsubdivisions. You can specify multiple.\n
237
+ # @option opts [Array<String>] :cities Filter the listings returned by specific cities. You can\nspecify multiple.\n
238
+ # @option opts [Array<String>] :counties Filter the listings returned by specific counties. You can\nspecify multiple.\n
239
+ # @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&#39;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\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
240
+ # @option opts [Array<String>] :include Include a extra fields which are not in the default\nresponse body\n- &#39;association&#39; includes additional HOA data\n- &#39;agreement&#39; information on the listing agreement\n- &#39;garageSpaces&#39; additional garage data\n- &#39;maintenanceExpense&#39; data on maintenance expenses\n- &#39;parking&#39; additional parking data\n- &#39;pool&#39; includes an additional pool description\n- &#39;taxAnnualAmount&#39; include the annual tax amount\n- &#39;taxYear&#39; include the tax year data\n- &#39;rooms&#39; 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
241
+ # @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
242
+ # @return [Array<(Array<Listing>, Fixnum, Hash)>] Array<Listing> data, response status code and response headers
243
+ def properties_get_with_http_info(opts = {})
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug "Calling API: DefaultApi#properties_get ..."
35
246
  end
36
247
 
37
248
  if opts[:'sort'] && !['listprice', '-listprice', 'listdate', '-listdate', 'beds', '-beds', 'baths', '-baths'].include?(opts[:'sort'])
38
249
  fail 'invalid value for "sort", must be one of listprice, -listprice, listdate, -listdate, beds, -beds, baths, -baths'
39
250
  end
40
251
 
41
- if opts[:'include'] && !['pool', 'rooms', 'association'].include?(opts[:'include'])
42
- fail 'invalid value for "include", must be one of pool, rooms, association'
43
- end
44
-
45
252
  # resource path
46
- path = "/properties".sub('{format}','json')
253
+ local_var_path = "/properties".sub('{format}','json')
47
254
 
48
255
  # query parameters
49
256
  query_params = {}
50
257
  query_params[:'q'] = opts[:'q'] if opts[:'q']
258
+ query_params[:'status'] = @api_client.build_collection_param(opts[:'status'], :multi) if opts[:'status']
259
+ query_params[:'type'] = @api_client.build_collection_param(opts[:'type'], :multi) if opts[:'type']
260
+ query_params[:'agent'] = opts[:'agent'] if opts[:'agent']
261
+ query_params[:'brokers'] = @api_client.build_collection_param(opts[:'brokers'], :multi) if opts[:'brokers']
51
262
  query_params[:'minprice'] = opts[:'minprice'] if opts[:'minprice']
52
263
  query_params[:'maxprice'] = opts[:'maxprice'] if opts[:'maxprice']
53
- query_params[:'agent'] = opts[:'agent'] if opts[:'agent']
54
264
  query_params[:'minarea'] = opts[:'minarea'] if opts[:'minarea']
55
265
  query_params[:'maxarea'] = opts[:'maxarea'] if opts[:'maxarea']
56
266
  query_params[:'minbaths'] = opts[:'minbaths'] if opts[:'minbaths']
57
267
  query_params[:'maxbaths'] = opts[:'maxbaths'] if opts[:'maxbaths']
58
268
  query_params[:'minbeds'] = opts[:'minbeds'] if opts[:'minbeds']
59
269
  query_params[:'maxbeds'] = opts[:'maxbeds'] if opts[:'maxbeds']
270
+ query_params[:'maxdom'] = opts[:'maxdom'] if opts[:'maxdom']
271
+ query_params[:'minyear'] = opts[:'minyear'] if opts[:'minyear']
60
272
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
61
273
  query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
62
- query_params[:'brokers'] = opts[:'brokers'] if opts[:'brokers']
63
- query_params[:'features'] = opts[:'features'] if opts[:'features']
64
- query_params[:'amenities'] = opts[:'amenities'] if opts[:'amenities']
65
- query_params[:'neighborhoods'] = opts[:'neighborhoods'] if opts[:'neighborhoods']
66
- query_params[:'points'] = opts[:'points'] if opts[:'points']
67
- query_params[:'counties'] = opts[:'counties'] if opts[:'counties']
68
- query_params[:'status'] = opts[:'status'] if opts[:'status']
69
- query_params[:'type'] = opts[:'type'] if opts[:'type']
274
+ query_params[:'vendor'] = opts[:'vendor'] if opts[:'vendor']
275
+ query_params[:'postalCodes'] = @api_client.build_collection_param(opts[:'postal_codes'], :multi) if opts[:'postal_codes']
276
+ query_params[:'features'] = @api_client.build_collection_param(opts[:'features'], :multi) if opts[:'features']
277
+ query_params[:'water'] = opts[:'water'] if opts[:'water']
278
+ query_params[:'neighborhoods'] = @api_client.build_collection_param(opts[:'neighborhoods'], :multi) if opts[:'neighborhoods']
279
+ query_params[:'cities'] = @api_client.build_collection_param(opts[:'cities'], :multi) if opts[:'cities']
280
+ query_params[:'counties'] = @api_client.build_collection_param(opts[:'counties'], :multi) if opts[:'counties']
281
+ query_params[:'points'] = @api_client.build_collection_param(opts[:'points'], :multi) if opts[:'points']
282
+ query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :multi) if opts[:'include']
70
283
  query_params[:'sort'] = opts[:'sort'] if opts[:'sort']
71
- query_params[:'include'] = opts[:'include'] if opts[:'include']
72
284
 
73
285
  # header parameters
74
286
  header_params = {}
75
287
 
76
288
  # HTTP header 'Accept' (if needed)
77
- _header_accept = []
78
- _header_accept_result = SimplyRets::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
289
+ _header_accept = ['application/json', 'application/vnd.simplyrets-v0.1+json']
290
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
79
291
 
80
292
  # HTTP header 'Content-Type'
81
- _header_content_type = []
82
- header_params['Content-Type'] = SimplyRets::Request.select_header_content_type(_header_content_type)
293
+ _header_content_type = ['application/json']
294
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
83
295
 
84
296
  # form parameters
85
297
  form_params = {}
@@ -87,45 +299,62 @@ module SimplyRetsClient
87
299
  # http body (model)
88
300
  post_body = nil
89
301
 
90
-
91
302
  auth_names = ['basicAuth']
92
- response = SimplyRets::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make
93
- result = response.deserialize('Array<Listing>')
94
- if SimplyRets.configuration.debug
95
- SimplyRets.logger.debug "API called: DefaultApi#properties. Result: #{result.inspect}"
303
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
304
+ :header_params => header_params,
305
+ :query_params => query_params,
306
+ :form_params => form_params,
307
+ :body => post_body,
308
+ :auth_names => auth_names,
309
+ :return_type => 'Array<Listing>')
310
+ if @api_client.config.debugging
311
+ @api_client.config.logger.debug "API called: DefaultApi#properties_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
312
  end
97
- result
313
+ return data, status_code, headers
98
314
  end
99
315
 
100
316
  # Single Listing Endpoint
101
- # Use this endpoint for accessing a single listing.\n
102
- # @param listing_id A listings listingId (unique indentifier).
317
+ # 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
318
+ # @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
103
319
  # @param [Hash] opts the optional parameters
320
+ # @option opts [Array<String>] :include Include a extra fields which are not in the default\nresponse body\n- &#39;association&#39; includes additional HOA data\n- &#39;agreement&#39; information on the listing agreement\n- &#39;garageSpaces&#39; additional garage data\n- &#39;maintenanceExpense&#39; data on maintenance expenses\n- &#39;parking&#39; additional parking data\n- &#39;pool&#39; includes an additional pool description\n- &#39;rooms&#39; 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 &#39;null&#39;.\n
104
321
  # @return [Listing]
105
- def self.property(listing_id, opts = {})
106
- if SimplyRets.configuration.debug
107
- SimplyRets.logger.debug "Calling API: DefaultApi#property ..."
322
+ def properties_mls_id_get(mls_id, opts = {})
323
+ data, status_code, headers = properties_mls_id_get_with_http_info(mls_id, opts)
324
+ return data
325
+ end
326
+
327
+ # Single Listing Endpoint
328
+ # 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
329
+ # @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
330
+ # @param [Hash] opts the optional parameters
331
+ # @option opts [Array<String>] :include Include a extra fields which are not in the default\nresponse body\n- &#39;association&#39; includes additional HOA data\n- &#39;agreement&#39; information on the listing agreement\n- &#39;garageSpaces&#39; additional garage data\n- &#39;maintenanceExpense&#39; data on maintenance expenses\n- &#39;parking&#39; additional parking data\n- &#39;pool&#39; includes an additional pool description\n- &#39;rooms&#39; 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 &#39;null&#39;.\n
332
+ # @return [Array<(Listing, Fixnum, Hash)>] Listing data, response status code and response headers
333
+ def properties_mls_id_get_with_http_info(mls_id, opts = {})
334
+ if @api_client.config.debugging
335
+ @api_client.config.logger.debug "Calling API: DefaultApi#properties_mls_id_get ..."
108
336
  end
109
337
 
110
- # verify the required parameter 'listing_id' is set
111
- fail "Missing the required parameter 'listing_id' when calling property" if listing_id.nil?
338
+ # verify the required parameter 'mls_id' is set
339
+ fail "Missing the required parameter 'mls_id' when calling properties_mls_id_get" if mls_id.nil?
112
340
 
113
341
  # resource path
114
- path = "/properties/{listingId}".sub('{format}','json').sub('{' + 'listingId' + '}', listing_id.to_s)
342
+ local_var_path = "/properties/{mlsId}".sub('{format}','json').sub('{' + 'mlsId' + '}', mls_id.to_s)
115
343
 
116
344
  # query parameters
117
345
  query_params = {}
346
+ query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :multi) if opts[:'include']
118
347
 
119
348
  # header parameters
120
349
  header_params = {}
121
350
 
122
351
  # HTTP header 'Accept' (if needed)
123
- _header_accept = []
124
- _header_accept_result = SimplyRets::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
352
+ _header_accept = ['application/json', 'application/vnd.simplyrets-v0.1+json']
353
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
125
354
 
126
355
  # HTTP header 'Content-Type'
127
- _header_content_type = []
128
- header_params['Content-Type'] = SimplyRets::Request.select_header_content_type(_header_content_type)
356
+ _header_content_type = ['application/json']
357
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
129
358
 
130
359
  # form parameters
131
360
  form_params = {}
@@ -133,14 +362,18 @@ module SimplyRetsClient
133
362
  # http body (model)
134
363
  post_body = nil
135
364
 
136
-
137
365
  auth_names = ['basicAuth']
138
- response = SimplyRets::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make
139
- result = response.deserialize('Listing')
140
- if SimplyRets.configuration.debug
141
- SimplyRets.logger.debug "API called: DefaultApi#property. Result: #{result.inspect}"
366
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
367
+ :header_params => header_params,
368
+ :query_params => query_params,
369
+ :form_params => form_params,
370
+ :body => post_body,
371
+ :auth_names => auth_names,
372
+ :return_type => 'Listing')
373
+ if @api_client.config.debugging
374
+ @api_client.config.logger.debug "API called: DefaultApi#properties_mls_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
142
375
  end
143
- result
376
+ return data, status_code, headers
144
377
  end
145
378
  end
146
379
  end