simplyrets 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +6 -3
  3. data/Makefile +1 -2
  4. data/README.org +2 -0
  5. data/lib/simplyrets.rb +12 -1
  6. data/lib/simplyrets/api/default_api.rb +132 -128
  7. data/lib/simplyrets/api_client.rb +48 -9
  8. data/lib/simplyrets/api_client.rb.orig +373 -0
  9. data/lib/simplyrets/api_error.rb +12 -1
  10. data/lib/simplyrets/configuration.rb +23 -0
  11. data/lib/simplyrets/models/agent.rb +61 -27
  12. data/lib/simplyrets/models/broker.rb +57 -20
  13. data/lib/simplyrets/models/contact_information.rb +62 -27
  14. data/lib/simplyrets/models/error.rb +59 -23
  15. data/lib/simplyrets/models/geographic_data.rb +61 -28
  16. data/lib/simplyrets/models/listing.rb +94 -70
  17. data/lib/simplyrets/models/mls_information.rb +95 -37
  18. data/lib/simplyrets/models/office.rb +62 -28
  19. data/lib/simplyrets/models/open_house.rb +66 -36
  20. data/lib/simplyrets/models/parking.rb +59 -24
  21. data/lib/simplyrets/models/property.rb +128 -136
  22. data/lib/simplyrets/models/sales.rb +61 -28
  23. data/lib/simplyrets/models/school.rb +60 -34
  24. data/lib/simplyrets/models/street_address.rb +66 -55
  25. data/lib/simplyrets/models/tax.rb +70 -35
  26. data/lib/simplyrets/version.rb +13 -2
  27. data/ruby-client.meta +1 -0
  28. data/ruby-client.zip +0 -0
  29. data/ruby-client/.gitignore +50 -0
  30. data/ruby-client/.rspec +2 -0
  31. data/ruby-client/.swagger-codegen-ignore +23 -0
  32. data/ruby-client/LICENSE +201 -0
  33. data/ruby-client/README.md +128 -0
  34. data/ruby-client/docs/Agent.md +11 -0
  35. data/ruby-client/docs/Broker.md +8 -0
  36. data/ruby-client/docs/ContactInformation.md +10 -0
  37. data/ruby-client/docs/DefaultApi.md +306 -0
  38. data/ruby-client/docs/Error.md +9 -0
  39. data/ruby-client/docs/GeographicData.md +12 -0
  40. data/ruby-client/docs/Listing.md +30 -0
  41. data/ruby-client/docs/MlsInformation.md +11 -0
  42. data/ruby-client/docs/Office.md +11 -0
  43. data/ruby-client/docs/OpenHouse.md +15 -0
  44. data/ruby-client/docs/Parking.md +10 -0
  45. data/ruby-client/docs/Property.md +43 -0
  46. data/ruby-client/docs/Sales.md +12 -0
  47. data/ruby-client/docs/School.md +11 -0
  48. data/ruby-client/docs/StreetAddress.md +16 -0
  49. data/ruby-client/docs/Tax.md +10 -0
  50. data/ruby-client/git_push.sh +67 -0
  51. data/ruby-client/lib/swagger_client.rb +66 -0
  52. data/ruby-client/lib/swagger_client/api/default_api.rb +383 -0
  53. data/ruby-client/lib/swagger_client/api_client.rb +373 -0
  54. data/ruby-client/lib/swagger_client/api_error.rb +47 -0
  55. data/ruby-client/lib/swagger_client/configuration.rb +193 -0
  56. data/ruby-client/lib/swagger_client/models/agent.rb +230 -0
  57. data/ruby-client/lib/swagger_client/models/broker.rb +200 -0
  58. data/ruby-client/lib/swagger_client/models/contact_information.rb +220 -0
  59. data/ruby-client/lib/swagger_client/models/error.rb +210 -0
  60. data/ruby-client/lib/swagger_client/models/geographic_data.rb +240 -0
  61. data/ruby-client/lib/swagger_client/models/listing.rb +422 -0
  62. data/ruby-client/lib/swagger_client/models/mls_information.rb +263 -0
  63. data/ruby-client/lib/swagger_client/models/office.rb +230 -0
  64. data/ruby-client/lib/swagger_client/models/open_house.rb +270 -0
  65. data/ruby-client/lib/swagger_client/models/parking.rb +219 -0
  66. data/ruby-client/lib/swagger_client/models/property.rb +574 -0
  67. data/ruby-client/lib/swagger_client/models/sales.rb +240 -0
  68. data/ruby-client/lib/swagger_client/models/school.rb +230 -0
  69. data/ruby-client/lib/swagger_client/models/street_address.rb +280 -0
  70. data/ruby-client/lib/swagger_client/models/tax.rb +220 -0
  71. data/ruby-client/lib/swagger_client/version.rb +26 -0
  72. data/ruby-client/spec/api/default_api_spec.rb +132 -0
  73. data/ruby-client/spec/api_client_spec.rb +296 -0
  74. data/ruby-client/spec/configuration_spec.rb +48 -0
  75. data/ruby-client/spec/models/agent_spec.rb +71 -0
  76. data/ruby-client/spec/models/broker_spec.rb +53 -0
  77. data/ruby-client/spec/models/contact_information_spec.rb +65 -0
  78. data/ruby-client/spec/models/error_spec.rb +59 -0
  79. data/ruby-client/spec/models/geographic_data_spec.rb +77 -0
  80. data/ruby-client/spec/models/listing_spec.rb +185 -0
  81. data/ruby-client/spec/models/mls_information_spec.rb +74 -0
  82. data/ruby-client/spec/models/office_spec.rb +71 -0
  83. data/ruby-client/spec/models/open_house_spec.rb +95 -0
  84. data/ruby-client/spec/models/parking_spec.rb +65 -0
  85. data/ruby-client/spec/models/property_spec.rb +266 -0
  86. data/ruby-client/spec/models/sales_spec.rb +77 -0
  87. data/ruby-client/spec/models/school_spec.rb +71 -0
  88. data/ruby-client/spec/models/street_address_spec.rb +101 -0
  89. data/ruby-client/spec/models/tax_spec.rb +65 -0
  90. data/ruby-client/spec/spec_helper.rb +122 -0
  91. data/ruby-client/swagger_client.gemspec +55 -0
  92. data/simplyrets.gemspec +1 -1
  93. metadata +71 -5
@@ -0,0 +1,26 @@
1
+ =begin
2
+ SimplyRETS API
3
+
4
+ The SimplyRETS API is an exciting step towards making it easier for developers and real estate agents to build something awesome with real estate data! The documentation below makes live requests to our API using the trial data. To get set up with the API using live MLS data, you must have RETS credentials from your MLS, which you can then use to create an app with SimplyRETS. For more information on that process, please see our [FAQ](https://simplyrets.com/faq), [Getting Started](https://simplyrets.com/blog/getting-set-up.html) page, or [contact us](https://simplyrets.com/\\#home-contact). Below you'll find the API endpoints, query parameters, response bodies, and other information about using the SimplyRETS API. You can run queries by clicking the 'Try it Out' button at the bottom of each section. ### Authentication The SimplyRETS API uses Basic Authentication. When you create an app, you'll get a set of API credentials to access your listings. If you're trying out the test data, you can use `simplyrets:simplyrets` for connecting to the API. ### Media Types The SimplyRETS API uses the `Accept` header to allow clients to control media types (content versions). We maintain backwards compatibility with API clients by allowing them to specify a content version. We highly recommend setting and explicity media type when your application reaches production. Both the structure and content of our API response bodies is subject to change so we can add new features while respecting the stability of applications which have already been developed. To always use the latest SimplyRETS content version, simply use `application/json` in your application `Accept` header. If you want to pin your clients media type to a specific version, you can use the vendor-specific SimplyRETS media type, e.g. `application/vnd.simplyrets-v0.1+json\"` To view all valid content-types for making an `OPTIONS`, make a request to the SimplyRETS api root `curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/` The default media types used in our API responses may change in the future. If you're building an application and care about the stability of the API, be sure to request a specific media type in the Accept header as shown in the examples below. The wordpress plugin automatically sets the `Accept` header for the compatible SimplyRETS media types. ### Pagination There a few pieces of useful information about each request stored in the HTTP Headers: - `X-Total-Count` shows you the total amount of listings that match your current query. - `Link` contains pre-built pagination links for accessing the next 'page' of listings that match your query. Read more about that [here](https://simplyrets.com/blog/api-pagination.html).
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ module SwaggerClient
25
+ VERSION = "1.0.0"
26
+ end
@@ -0,0 +1,132 @@
1
+ =begin
2
+ SimplyRETS API
3
+
4
+ The SimplyRETS API is an exciting step towards making it easier for developers and real estate agents to build something awesome with real estate data! The documentation below makes live requests to our API using the trial data. To get set up with the API using live MLS data, you must have RETS credentials from your MLS, which you can then use to create an app with SimplyRETS. For more information on that process, please see our [FAQ](https://simplyrets.com/faq), [Getting Started](https://simplyrets.com/blog/getting-set-up.html) page, or [contact us](https://simplyrets.com/\\#home-contact). Below you'll find the API endpoints, query parameters, response bodies, and other information about using the SimplyRETS API. You can run queries by clicking the 'Try it Out' button at the bottom of each section. ### Authentication The SimplyRETS API uses Basic Authentication. When you create an app, you'll get a set of API credentials to access your listings. If you're trying out the test data, you can use `simplyrets:simplyrets` for connecting to the API. ### Media Types The SimplyRETS API uses the `Accept` header to allow clients to control media types (content versions). We maintain backwards compatibility with API clients by allowing them to specify a content version. We highly recommend setting and explicity media type when your application reaches production. Both the structure and content of our API response bodies is subject to change so we can add new features while respecting the stability of applications which have already been developed. To always use the latest SimplyRETS content version, simply use `application/json` in your application `Accept` header. If you want to pin your clients media type to a specific version, you can use the vendor-specific SimplyRETS media type, e.g. `application/vnd.simplyrets-v0.1+json\"` To view all valid content-types for making an `OPTIONS`, make a request to the SimplyRETS api root `curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/` The default media types used in our API responses may change in the future. If you're building an application and care about the stability of the API, be sure to request a specific media type in the Accept header as shown in the examples below. The wordpress plugin automatically sets the `Accept` header for the compatible SimplyRETS media types. ### Pagination There a few pieces of useful information about each request stored in the HTTP Headers: - `X-Total-Count` shows you the total amount of listings that match your current query. - `Link` contains pre-built pagination links for accessing the next 'page' of listings that match your query. Read more about that [here](https://simplyrets.com/blog/api-pagination.html).
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'spec_helper'
25
+ require 'json'
26
+
27
+ # Unit tests for SwaggerClient::DefaultApi
28
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
29
+ # Please update as you see appropriate
30
+ describe 'DefaultApi' do
31
+ before do
32
+ # run before each test
33
+ @instance = SwaggerClient::DefaultApi.new
34
+ end
35
+
36
+ after do
37
+ # run after each test
38
+ end
39
+
40
+ describe 'test an instance of DefaultApi' do
41
+ it 'should create an instact of DefaultApi' do
42
+ expect(@instance).to be_instance_of(SwaggerClient::DefaultApi)
43
+ end
44
+ end
45
+
46
+ # unit tests for openhouses_get
47
+ # The SimplyRETS OpenHouses API
48
+ # This is the main endpoint for accessing openhouses.
49
+ # @param [Hash] opts the optional parameters
50
+ # @option opts [String] :type Request listings by a specific property type. This defaults to Residential, and you can only specify one type in a single query.
51
+ # @option opts [String] :listing_id Request openhouses for a specific `listingId`.
52
+ # @option opts [Array<String>] :cities Filter the openhouses returned by a list of valid cities. A list of valid cities can be found by making an OPTIONS request to the &#x60;/openhouses&#x60; endpoint.
53
+ # @option opts [Array<String>] :brokers Filter the listings returned by brokerage with a Broker ID. You can specific multiple broker parameters. Note, the Broker ID is provided by your MLS.
54
+ # @option opts [String] :agent Filter the listings returned by an agent ID. Note, the Agent ID is provided by your MLS.
55
+ # @option opts [Integer] :minprice Filter listings by a minimum price.
56
+ # @option opts [DateTime] :startdate Scheduled date and time of the open house showing
57
+ # @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset parameter by the limit to go to the next \&quot;page\&quot; of listings. Also take a look at the Link HTTP Header for pre-built pagination.
58
+ # @option opts [Integer] :limit Set the number of listings to return in the response. This defaults to 20 listings, and can be a maximum of 50. To paginate through to the next page of listings, take a look at the &#x60;offset&#x60; parameter, or the Link in the HTTP Header.
59
+ # @option opts [String] :sort Sort the response by a specific field. Values starting with a minus (-) denote descending order, while the others are ascending.
60
+ # @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;taxAnnualAmount&#39; include the annual tax amount - &#39;taxYear&#39; include the tax year data - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available in the API response. In the future, fields which require an &#39;include&#39; may become available by default.
61
+ # @return [Array<OpenHouse>]
62
+ describe 'openhouses_get test' do
63
+ it "should work" do
64
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
65
+ end
66
+ end
67
+
68
+ # unit tests for openhouses_open_house_key_get
69
+ # Single OpenHouse Endpoint
70
+ # Use this endpoint for accessing a single OpenHouse.
71
+ # @param open_house_key A unique OpenHouse identification key
72
+ # @param [Hash] opts the optional parameters
73
+ # @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;taxAnnualAmount&#39; include the annual tax amount - &#39;taxYear&#39; include the tax year data - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available in the API response. In the future, fields which require an &#39;include&#39; may become available by default.
74
+ # @return [OpenHouse]
75
+ describe 'openhouses_open_house_key_get test' do
76
+ it "should work" do
77
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
78
+ end
79
+ end
80
+
81
+ # unit tests for properties_get
82
+ # The SimplyRETS Listings API
83
+ # This is the main endpoint for accessing your properties. View all of the available query parameters and make requests below! The API uses Basic Authentication, which most HTTP libraries will handle for you. To use the test data (which is what this pages uses), you can use the api key &#x60;simplyrets&#x60; and secret &#x60;simplyrets&#x60;. Note that these test listings are not live MLS listings but the data, query parameters, and response bodies will all work the same.
84
+ # @param [Hash] opts the optional parameters
85
+ # @option opts [String] :q A textual keyword search. This parameter will search the following fields, when available: - listingId (This does _not_ search the &#x60;mlsId&#x60; field in the SimplyRETS response body) - street number - street name - mls area (major) - city - subdivision name - postal code
86
+ # @option opts [Array<String>] :status Request listings by a specific status. This parameter defaults to active and you can specify multiple statuses in a single query. Listing statuses depend on your MLS&#39;s availability. Below is a brief description of each status with possible synonyms which may map to your MLS-specific statuses - *Active*: Active Listing which is still on the market - *ActiveUnderContract*: An offer has been accepted but the listing is still on market. Synonyms: Accepting Backup Offers, Backup Offer, Active With Accepted. Synonyms: Offer, Backup, Contingent - *Pending*: An offer has been accepted and the listing is no longer on market. Synonyms: Offer Accepted, Under Contract - *Hold*: The listing has been withdrawn from the market, but a contract still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market - *Withdrawn*: The listing has been withdrawn from the market, but a contract still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market - *Closed*: The purchase agreement has been fulfilled or the lease agreement has been executed. Synonyms: Sold, Leased, Rented, Closed Sale - *Expired*: The listing contract has expired - *Delete*: The listing contract was never valid or other reason for the contract to be nullified. Synonyms: Kill, Zap - *Incomplete*: The listing has not yet be completely entered and is not yet published in the MLS. Synonyms: Draft, Partially Complted - *ComingSoon*
87
+ # @option opts [Array<String>] :type Request listings by a specific property type. This defaults to Residential and Rental. You can specify multiple property types in a single query.
88
+ # @option opts [String] :agent Filter the listings returned by an agent ID. Note, the Agent ID is provided by your MLS. The co-listing agent is not included in this query parameter.
89
+ # @option opts [Array<String>] :brokers Filter the listings returned by brokerage with a Broker ID. For some MLS areas, this is the ListOfficeId (Listing Office ID). You can specific multiple broker parameters. Note, this query parameter is only available if a Broker ID is provided by your MLS.
90
+ # @option opts [Integer] :minprice Filter listings by a minimum price.
91
+ # @option opts [Integer] :maxprice Filter listings by a maximum price
92
+ # @option opts [Integer] :minarea Filter listings by a minimum area size in Sq Ft.
93
+ # @option opts [Integer] :maxarea Filter listings by a maximum area size in Sq Ft.
94
+ # @option opts [Integer] :minbaths Filter listings by a minimum number of bathrooms.
95
+ # @option opts [Integer] :maxbaths Filter listings by a maximum number of bathrooms.
96
+ # @option opts [Integer] :minbeds Filter listings by a minimum number of bedrooms.
97
+ # @option opts [Integer] :maxbeds Filter listings by a maximum number of bedrooms.
98
+ # @option opts [Integer] :maxdom Filter listings by a maximum number of days on market. _Note that your MLS must provide Days on Market data._
99
+ # @option opts [Integer] :minyear Filter listings by a setting a minimum year built.
100
+ # @option opts [Integer] :limit Set the number of listings to return in the response. This defaults to 20 listings, and can be a maximum of 50. To paginate through to the next page of listings, take a look at the &#x60;offset&#x60; parameter, or the Link in the HTTP Header.
101
+ # @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset parameter by the limit to go to the next \&quot;page\&quot; of listings. Also take a look at the Link HTTP Header for pre-built pagination. *NOTE:* If you&#39;re offset is too high, you will receive an &#x60;HTTP 400 offset too high&#x60; error message.
102
+ # @option opts [String] :vendor Used to specify the vendor (MLS) to search from. This parameter is required on multi-MLS apps, and you can only query one vendor at a time. To get your vendor id&#39;s make an OPTIONS request to https://api.simplyrets.com.
103
+ # @option opts [Array<String>] :postal_codes Filter the listings returned by postal codes / zip code. You can specify multiple.
104
+ # @option opts [Array<String>] :features Filter the listings by specific interior features. You can filter by multiple. For example, to filter trial listings by multiple features you can use, Return listings that are within a set of latitude longitude coordinates. For example, &#x60;&#x60;&#x60; Wet Bar High Ceiling &#x60;&#x60;&#x60; e.g. &#x60;https://simplyrets.com/services?features&#x3D;Wet%20Bar&amp;features&#x3D;High%20Ceiling&#x60; The features provided by your MLS can be seen in your OPTIONS request. To view all valid features, make a request to the SimplyRETS api root &#x60;curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/&#x60;
105
+ # @option opts [String] :water Query water/waterfront listings only. Specify &#x60;true&#x60; to filter waterfront listings.
106
+ # @option opts [Array<String>] :neighborhoods Filter the listings returned by specific neighborhoods and subdivisions. You can specify multiple.
107
+ # @option opts [Array<String>] :cities Filter the listings returned by specific cities. You can specify multiple.
108
+ # @option opts [Array<String>] :counties Filter the listings returned by specific counties. You can specify multiple.
109
+ # @option opts [Array<String>] :points Return listings that are within a set of latitude longitude coordinates. For example; &#x60;&#x60;&#x60; 29.723837,-95.69778 29.938275,-95.69778 29.938275,-95.32974 29.723837,-95.32974 &#x60;&#x60;&#x60; Note that some MLS&#39;s do not provide latitude and longitude for their listings, which is required for this parameter to work. In these cases, SimplyRETS offers a [Geocoding Addon](https://simplyrets.com/services#geocoding). Check out our [blog post](https://simplyrets.com/blog/interactive-map-search.html) on using the &#x60;points&#x60; parameter to build a map-based app in javascript.
110
+ # @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;taxAnnualAmount&#39; include the annual tax amount - &#39;taxYear&#39; include the tax year data - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available in the API response.
111
+ # @option opts [String] :sort Sort the response by a specific field. Values starting with a minus (-) denote descending order, while the others are ascending.
112
+ # @return [Array<Listing>]
113
+ describe 'properties_get test' do
114
+ it "should work" do
115
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
116
+ end
117
+ end
118
+
119
+ # unit tests for properties_mls_id_get
120
+ # Single Listing Endpoint
121
+ # Use this endpoint for accessing a single listing. When you make a search to the &#x60;/properties&#x60; endpoint, each listing in the response will contain a unique &#x60;mlsId&#x60; field which should be used to request that listing on this route. The &#x60;mlsId&#x60; field is a unique identifier for a listing which is specific to the SimplyRETS API only. It is different from the &#x60;listingId&#x60; field is the public number given to a listing by the MLS and is not used here.
122
+ # @param mls_id The &#x60;mlsId&#x60; field is a unique identifier which is specific to the SimplyRETS API only. This field is different from the &#x60;listingId&#x60; field (which is the public number given to a listing by the MLS and is not used here).
123
+ # @param [Hash] opts the optional parameters
124
+ # @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available with valid data in the API response. If your MLS does not offer these fields, they will contain &#39;null&#39;.
125
+ # @return [Listing]
126
+ describe 'properties_mls_id_get test' do
127
+ it "should work" do
128
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
129
+ end
130
+ end
131
+
132
+ end
@@ -0,0 +1,296 @@
1
+ =begin
2
+ SimplyRETS API
3
+
4
+ The SimplyRETS API is an exciting step towards making it easier for developers and real estate agents to build something awesome with real estate data! The documentation below makes live requests to our API using the trial data. To get set up with the API using live MLS data, you must have RETS credentials from your MLS, which you can then use to create an app with SimplyRETS. For more information on that process, please see our [FAQ](https://simplyrets.com/faq), [Getting Started](https://simplyrets.com/blog/getting-set-up.html) page, or [contact us](https://simplyrets.com/\\#home-contact). Below you'll find the API endpoints, query parameters, response bodies, and other information about using the SimplyRETS API. You can run queries by clicking the 'Try it Out' button at the bottom of each section. ### Authentication The SimplyRETS API uses Basic Authentication. When you create an app, you'll get a set of API credentials to access your listings. If you're trying out the test data, you can use `simplyrets:simplyrets` for connecting to the API. ### Media Types The SimplyRETS API uses the `Accept` header to allow clients to control media types (content versions). We maintain backwards compatibility with API clients by allowing them to specify a content version. We highly recommend setting and explicity media type when your application reaches production. Both the structure and content of our API response bodies is subject to change so we can add new features while respecting the stability of applications which have already been developed. To always use the latest SimplyRETS content version, simply use `application/json` in your application `Accept` header. If you want to pin your clients media type to a specific version, you can use the vendor-specific SimplyRETS media type, e.g. `application/vnd.simplyrets-v0.1+json\"` To view all valid content-types for making an `OPTIONS`, make a request to the SimplyRETS api root `curl -XOPTIONS -u simplyrets:simplyrets https://api.simplyrets.com/` The default media types used in our API responses may change in the future. If you're building an application and care about the stability of the API, be sure to request a specific media type in the Accept header as shown in the examples below. The wordpress plugin automatically sets the `Accept` header for the compatible SimplyRETS media types. ### Pagination There a few pieces of useful information about each request stored in the HTTP Headers: - `X-Total-Count` shows you the total amount of listings that match your current query. - `Link` contains pre-built pagination links for accessing the next 'page' of listings that match your query. Read more about that [here](https://simplyrets.com/blog/api-pagination.html).
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'spec_helper'
25
+
26
+ describe SwaggerClient::ApiClient do
27
+ context 'initialization' do
28
+ context 'URL stuff' do
29
+ context 'host' do
30
+ it 'removes http from host' do
31
+ SwaggerClient.configure { |c| c.host = 'http://example.com' }
32
+ expect(SwaggerClient::Configuration.default.host).to eq('example.com')
33
+ end
34
+
35
+ it 'removes https from host' do
36
+ SwaggerClient.configure { |c| c.host = 'https://wookiee.com' }
37
+ expect(SwaggerClient::ApiClient.default.config.host).to eq('wookiee.com')
38
+ end
39
+
40
+ it 'removes trailing path from host' do
41
+ SwaggerClient.configure { |c| c.host = 'hobo.com/v4' }
42
+ expect(SwaggerClient::Configuration.default.host).to eq('hobo.com')
43
+ end
44
+ end
45
+
46
+ context 'base_path' do
47
+ it "prepends a slash to base_path" do
48
+ SwaggerClient.configure { |c| c.base_path = 'v4/dog' }
49
+ expect(SwaggerClient::Configuration.default.base_path).to eq('/v4/dog')
50
+ end
51
+
52
+ it "doesn't prepend a slash if one is already there" do
53
+ SwaggerClient.configure { |c| c.base_path = '/v4/dog' }
54
+ expect(SwaggerClient::Configuration.default.base_path).to eq('/v4/dog')
55
+ end
56
+
57
+ it "ends up as a blank string if nil" do
58
+ SwaggerClient.configure { |c| c.base_path = nil }
59
+ expect(SwaggerClient::Configuration.default.base_path).to eq('')
60
+ end
61
+ end
62
+ end
63
+ end
64
+
65
+ describe "#update_params_for_auth!" do
66
+ it "sets header api-key parameter with prefix" do
67
+ SwaggerClient.configure do |c|
68
+ c.api_key_prefix['api_key'] = 'PREFIX'
69
+ c.api_key['api_key'] = 'special-key'
70
+ end
71
+
72
+ api_client = SwaggerClient::ApiClient.new
73
+
74
+ config2 = SwaggerClient::Configuration.new do |c|
75
+ c.api_key_prefix['api_key'] = 'PREFIX2'
76
+ c.api_key['api_key'] = 'special-key2'
77
+ end
78
+ api_client2 = SwaggerClient::ApiClient.new(config2)
79
+
80
+ auth_names = ['api_key', 'unknown']
81
+
82
+ header_params = {}
83
+ query_params = {}
84
+ api_client.update_params_for_auth! header_params, query_params, auth_names
85
+ expect(header_params).to eq({'api_key' => 'PREFIX special-key'})
86
+ expect(query_params).to eq({})
87
+
88
+ header_params = {}
89
+ query_params = {}
90
+ api_client2.update_params_for_auth! header_params, query_params, auth_names
91
+ expect(header_params).to eq({'api_key' => 'PREFIX2 special-key2'})
92
+ expect(query_params).to eq({})
93
+ end
94
+
95
+ it "sets header api-key parameter without prefix" do
96
+ SwaggerClient.configure do |c|
97
+ c.api_key_prefix['api_key'] = nil
98
+ c.api_key['api_key'] = 'special-key'
99
+ end
100
+
101
+ api_client = SwaggerClient::ApiClient.new
102
+
103
+ header_params = {}
104
+ query_params = {}
105
+ auth_names = ['api_key', 'unknown']
106
+ api_client.update_params_for_auth! header_params, query_params, auth_names
107
+ expect(header_params).to eq({'api_key' => 'special-key'})
108
+ expect(query_params).to eq({})
109
+ end
110
+ end
111
+
112
+ describe "timeout in #build_request" do
113
+ let(:config) { SwaggerClient::Configuration.new }
114
+ let(:api_client) { SwaggerClient::ApiClient.new(config) }
115
+
116
+ it "defaults to 0" do
117
+ expect(SwaggerClient::Configuration.default.timeout).to eq(0)
118
+ expect(config.timeout).to eq(0)
119
+
120
+ request = api_client.build_request(:get, '/test')
121
+ expect(request.options[:timeout]).to eq(0)
122
+ end
123
+
124
+ it "can be customized" do
125
+ config.timeout = 100
126
+ request = api_client.build_request(:get, '/test')
127
+ expect(request.options[:timeout]).to eq(100)
128
+ end
129
+ end
130
+
131
+ describe "#deserialize" do
132
+ it "handles Array<Integer>" do
133
+ api_client = SwaggerClient::ApiClient.new
134
+ headers = {'Content-Type' => 'application/json'}
135
+ response = double('response', headers: headers, body: '[12, 34]')
136
+ data = api_client.deserialize(response, 'Array<Integer>')
137
+ expect(data).to be_instance_of(Array)
138
+ expect(data).to eq([12, 34])
139
+ end
140
+
141
+ it "handles Array<Array<Integer>>" do
142
+ api_client = SwaggerClient::ApiClient.new
143
+ headers = {'Content-Type' => 'application/json'}
144
+ response = double('response', headers: headers, body: '[[12, 34], [56]]')
145
+ data = api_client.deserialize(response, 'Array<Array<Integer>>')
146
+ expect(data).to be_instance_of(Array)
147
+ expect(data).to eq([[12, 34], [56]])
148
+ end
149
+
150
+ it "handles Hash<String, String>" do
151
+ api_client = SwaggerClient::ApiClient.new
152
+ headers = {'Content-Type' => 'application/json'}
153
+ response = double('response', headers: headers, body: '{"message": "Hello"}')
154
+ data = api_client.deserialize(response, 'Hash<String, String>')
155
+ expect(data).to be_instance_of(Hash)
156
+ expect(data).to eq({:message => 'Hello'})
157
+ end
158
+
159
+ it "handles Hash<String, Pet>" do
160
+ api_client = SwaggerClient::ApiClient.new
161
+ headers = {'Content-Type' => 'application/json'}
162
+ response = double('response', headers: headers, body: '{"pet": {"id": 1}}')
163
+ data = api_client.deserialize(response, 'Hash<String, Pet>')
164
+ expect(data).to be_instance_of(Hash)
165
+ expect(data.keys).to eq([:pet])
166
+
167
+ pet = data[:pet]
168
+ expect(pet).to be_instance_of(SwaggerClient::Pet)
169
+ expect(pet.id).to eq(1)
170
+ end
171
+
172
+ it "handles Hash<String, Hash<String, Pet>>" do
173
+ api_client = SwaggerClient::ApiClient.new
174
+ headers = {'Content-Type' => 'application/json'}
175
+ response = double('response', headers: headers, body: '{"data": {"pet": {"id": 1}}}')
176
+ result = api_client.deserialize(response, 'Hash<String, Hash<String, Pet>>')
177
+ expect(result).to be_instance_of(Hash)
178
+ expect(result.keys).to match_array([:data])
179
+
180
+ data = result[:data]
181
+ expect(data).to be_instance_of(Hash)
182
+ expect(data.keys).to match_array([:pet])
183
+
184
+ pet = data[:pet]
185
+ expect(pet).to be_instance_of(SwaggerClient::Pet)
186
+ expect(pet.id).to eq(1)
187
+ end
188
+ end
189
+
190
+ describe "#object_to_hash" do
191
+ it "ignores nils and includes empty arrays" do
192
+ api_client = SwaggerClient::ApiClient.new
193
+ pet = SwaggerClient::Pet.new
194
+ pet.id = 1
195
+ pet.name = ''
196
+ pet.status = nil
197
+ pet.photo_urls = nil
198
+ pet.tags = []
199
+ expected = {id: 1, name: '', tags: []}
200
+ expect(api_client.object_to_hash(pet)).to eq(expected)
201
+ end
202
+ end
203
+
204
+ describe "#build_collection_param" do
205
+ let(:param) { ['aa', 'bb', 'cc'] }
206
+ let(:api_client) { SwaggerClient::ApiClient.new }
207
+
208
+ it "works for csv" do
209
+ expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
210
+ end
211
+
212
+ it "works for ssv" do
213
+ expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
214
+ end
215
+
216
+ it "works for tsv" do
217
+ expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
218
+ end
219
+
220
+ it "works for pipes" do
221
+ expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
222
+ end
223
+
224
+ it "works for multi" do
225
+ expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
226
+ end
227
+
228
+ it "fails for invalid collection format" do
229
+ expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
230
+ end
231
+ end
232
+
233
+ describe "#json_mime?" do
234
+ let(:api_client) { SwaggerClient::ApiClient.new }
235
+
236
+ it "works" do
237
+ expect(api_client.json_mime?(nil)).to eq false
238
+ expect(api_client.json_mime?('')).to eq false
239
+
240
+ expect(api_client.json_mime?('application/json')).to eq true
241
+ expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
242
+ expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
243
+
244
+ expect(api_client.json_mime?('application/xml')).to eq false
245
+ expect(api_client.json_mime?('text/plain')).to eq false
246
+ expect(api_client.json_mime?('application/jsonp')).to eq false
247
+ end
248
+ end
249
+
250
+ describe "#select_header_accept" do
251
+ let(:api_client) { SwaggerClient::ApiClient.new }
252
+
253
+ it "works" do
254
+ expect(api_client.select_header_accept(nil)).to be_nil
255
+ expect(api_client.select_header_accept([])).to be_nil
256
+
257
+ expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
258
+ expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
259
+ expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
260
+
261
+ expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
262
+ expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
263
+ end
264
+ end
265
+
266
+ describe "#select_header_content_type" do
267
+ let(:api_client) { SwaggerClient::ApiClient.new }
268
+
269
+ it "works" do
270
+ expect(api_client.select_header_content_type(nil)).to eq('application/json')
271
+ expect(api_client.select_header_content_type([])).to eq('application/json')
272
+
273
+ expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
274
+ expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
275
+ expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
276
+ expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
277
+ expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
278
+ end
279
+ end
280
+
281
+ describe "#sanitize_filename" do
282
+ let(:api_client) { SwaggerClient::ApiClient.new }
283
+
284
+ it "works" do
285
+ expect(api_client.sanitize_filename('sun')).to eq('sun')
286
+ expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
287
+ expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
288
+ expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
289
+ expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
290
+ expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
291
+ expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
292
+ expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
293
+ expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
294
+ end
295
+ end
296
+ end