easy_broker 0.1.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/CHANGELOG.md +10 -0
- data/README.md +3 -1
- data/lib/easy_broker/api_client.rb +1 -3
- data/lib/easy_broker/constants.rb +2 -2
- data/lib/easy_broker/integration_partners/listing_statuses.rb +20 -0
- data/lib/easy_broker/integration_partners/public_client.rb +17 -0
- data/lib/easy_broker/listing_statuses.rb +16 -0
- data/lib/easy_broker/public_client.rb +8 -0
- data/lib/easy_broker/query.rb +2 -2
- data/lib/easy_broker/version.rb +1 -1
- data/lib/easy_broker.rb +3 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c27aa2e5baf6abfffe4c533f261a80b108fea52d902c3e0f45e848e77feb0b83
|
4
|
+
data.tar.gz: 1ac5b3ffa82f4a41b680fccf21d7d57ab6f037188a599f019b942f87606bc0a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94fe5373b0759fdd9e40f1ce23bfb4459f9b853c2c68422b34443c070cb90e8eb9abdf47eb3eb6a6778d7a29d477192f03f6da8c513c34ab6771980f8a7623d1
|
7
|
+
data.tar.gz: 946b6486bf68adf1f0d28b7f585f92b559de4f311fe47dd5ff48d687f64c3a3603451097cdb72c9f1797c92d7a1ce758fc5587c287600d0bedf1f7bd46949171
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -8,3 +8,13 @@
|
|
8
8
|
|
9
9
|
## 0.1.3
|
10
10
|
* Fixed pagination bug where the last page may not have been included.
|
11
|
+
|
12
|
+
## 0.1.4
|
13
|
+
* Added support for the listing_statuses endpoint.
|
14
|
+
|
15
|
+
## 0.1.5
|
16
|
+
* Added support for the listing_statuses endpoint for integration partners.
|
17
|
+
|
18
|
+
## 1.0.0
|
19
|
+
* **Breaking change**: `limit`, `page`, and `search` params should be at the root level requests instead of in the `query` hash.
|
20
|
+
* Updated endpoints to use the `api` subdomain; `api.easybroker.com/v1` instead of `www.easybroker.com/api/v1`.
|
data/README.md
CHANGED
@@ -61,7 +61,7 @@ results.next_page
|
|
61
61
|
|
62
62
|
|
63
63
|
# Search for only published properties
|
64
|
-
client.properties.search(search: { statuses: [:published] } )
|
64
|
+
client.properties.search(search: { statuses: [:published] }, limit: 1, page: 1)
|
65
65
|
```
|
66
66
|
|
67
67
|
You can also pass a logger to log any methods that make remote calls. The logger class must implement a `log` method which will be called with the [HTTParty response](https://www.rubydoc.info/github/jnunemaker/httparty/HTTParty/Response) for every remote request sent.
|
@@ -78,6 +78,8 @@ client.locations # List and search geographic locations
|
|
78
78
|
client.contact_requests # List and search contact requests in your account - TDB create via post
|
79
79
|
client.properties # List, search and find properties in your account
|
80
80
|
client.mls_properties # List, search and find properties in the MLS - requires MLS API Plan
|
81
|
+
client.listing_statuses # List and search the listing status for properties. Great for syncing large sets of properties. - includes MLS properties if you have the MLS Plan
|
82
|
+
client.integration_partners.listing_statuses # List and search the listing status for partner properties. Requires an integration partner api key.
|
81
83
|
```
|
82
84
|
|
83
85
|
## Development
|
@@ -34,9 +34,7 @@ class EasyBroker::ApiClient
|
|
34
34
|
private
|
35
35
|
|
36
36
|
def send_request(verb, path = '', params = {})
|
37
|
-
|
38
|
-
|
39
|
-
self.class.send(verb, path, params.merge(query)).tap do |response|
|
37
|
+
self.class.send(verb, path, params).tap do |response|
|
40
38
|
check_errors(response)
|
41
39
|
logger&.log response
|
42
40
|
end
|
@@ -5,7 +5,7 @@ module EasyBroker
|
|
5
5
|
'Accept' => 'application/json',
|
6
6
|
'User-Agent' => USER_AGENT
|
7
7
|
}
|
8
|
-
DEFAULT_API_ROOT_URL = 'https://
|
9
|
-
STAGING_API_ROOT_URL = 'https://
|
8
|
+
DEFAULT_API_ROOT_URL = 'https://api.easybroker.com/v1'
|
9
|
+
STAGING_API_ROOT_URL = 'https://api.stagingeb.com/v1'
|
10
10
|
AUTHORIZATION_HEADER = 'X-Authorization'
|
11
11
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EasyBroker
|
4
|
+
module IntegrationPartners
|
5
|
+
class ListingStatuses
|
6
|
+
ENDPOINT = '/integration_partners/listing_statuses'
|
7
|
+
|
8
|
+
attr_reader :api_client
|
9
|
+
|
10
|
+
def initialize(api_client)
|
11
|
+
@api_client = api_client
|
12
|
+
end
|
13
|
+
|
14
|
+
def search(query = {})
|
15
|
+
stored_query = EasyBroker::Query.new(api_client, ENDPOINT, query)
|
16
|
+
EasyBroker::PaginatedResponse.new(stored_query)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EasyBroker
|
4
|
+
module IntegrationPartners
|
5
|
+
class PublicClient
|
6
|
+
attr_reader :api_client
|
7
|
+
|
8
|
+
def initialize(api_client)
|
9
|
+
@api_client = api_client
|
10
|
+
end
|
11
|
+
|
12
|
+
def listing_statuses
|
13
|
+
EasyBroker::IntegrationPartners::ListingStatuses.new(api_client)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class EasyBroker::ListingStatuses
|
4
|
+
ENDPOINT = '/listing_statuses'
|
5
|
+
|
6
|
+
attr_reader :api_client
|
7
|
+
|
8
|
+
def initialize(api_client)
|
9
|
+
@api_client = api_client
|
10
|
+
end
|
11
|
+
|
12
|
+
def search(query = {})
|
13
|
+
stored_query = EasyBroker::Query.new(api_client, ENDPOINT, query)
|
14
|
+
EasyBroker::PaginatedResponse.new(stored_query)
|
15
|
+
end
|
16
|
+
end
|
@@ -22,4 +22,12 @@ class EasyBroker::PublicClient
|
|
22
22
|
def locations
|
23
23
|
EasyBroker::Locations.new(api_client)
|
24
24
|
end
|
25
|
+
|
26
|
+
def listing_statuses
|
27
|
+
EasyBroker::ListingStatuses.new(api_client)
|
28
|
+
end
|
29
|
+
|
30
|
+
def integration_partners
|
31
|
+
EasyBroker::IntegrationPartners::PublicClient.new(api_client)
|
32
|
+
end
|
25
33
|
end
|
data/lib/easy_broker/query.rb
CHANGED
@@ -9,8 +9,8 @@ class EasyBroker::Query
|
|
9
9
|
@query_params = query_params
|
10
10
|
end
|
11
11
|
|
12
|
-
def get(page =
|
13
|
-
query_params[:page] = page
|
12
|
+
def get(page = nil)
|
13
|
+
query_params[:page] = page if page
|
14
14
|
response = api_client.get(endpoint, query: query_params)
|
15
15
|
JSON.parse(response.body, object_class: OpenStruct)
|
16
16
|
end
|
data/lib/easy_broker/version.rb
CHANGED
data/lib/easy_broker.rb
CHANGED
@@ -12,6 +12,9 @@ require 'easy_broker/properties'
|
|
12
12
|
require 'easy_broker/mls_properties'
|
13
13
|
require 'easy_broker/contact_requests'
|
14
14
|
require 'easy_broker/locations'
|
15
|
+
require 'easy_broker/listing_statuses'
|
16
|
+
require 'easy_broker/integration_partners/public_client'
|
17
|
+
require 'easy_broker/integration_partners/listing_statuses'
|
15
18
|
|
16
19
|
module EasyBroker
|
17
20
|
def self.configuration
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Northam
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -130,6 +130,9 @@ files:
|
|
130
130
|
- lib/easy_broker/constants.rb
|
131
131
|
- lib/easy_broker/contact_requests.rb
|
132
132
|
- lib/easy_broker/errors.rb
|
133
|
+
- lib/easy_broker/integration_partners/listing_statuses.rb
|
134
|
+
- lib/easy_broker/integration_partners/public_client.rb
|
135
|
+
- lib/easy_broker/listing_statuses.rb
|
133
136
|
- lib/easy_broker/locations.rb
|
134
137
|
- lib/easy_broker/mls_properties.rb
|
135
138
|
- lib/easy_broker/paginated_response.rb
|
@@ -157,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
160
|
- !ruby/object:Gem::Version
|
158
161
|
version: '0'
|
159
162
|
requirements: []
|
160
|
-
rubygems_version: 3.1
|
163
|
+
rubygems_version: 3.0.3.1
|
161
164
|
signing_key:
|
162
165
|
specification_version: 4
|
163
166
|
summary: A gem to work with EasyBroker's API
|