easy_broker 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c27aa2e5baf6abfffe4c533f261a80b108fea52d902c3e0f45e848e77feb0b83
4
- data.tar.gz: 1ac5b3ffa82f4a41b680fccf21d7d57ab6f037188a599f019b942f87606bc0a8
3
+ metadata.gz: 45d36d59dcaf0b6a07c5fb9d065711747dca59b66349850fa13f592a04bb9b25
4
+ data.tar.gz: 634332b115e07adc6710cd84a1a8919a330def6bdcae57348cf54dc8e1308250
5
5
  SHA512:
6
- metadata.gz: 94fe5373b0759fdd9e40f1ce23bfb4459f9b853c2c68422b34443c070cb90e8eb9abdf47eb3eb6a6778d7a29d477192f03f6da8c513c34ab6771980f8a7623d1
7
- data.tar.gz: 946b6486bf68adf1f0d28b7f585f92b559de4f311fe47dd5ff48d687f64c3a3603451097cdb72c9f1797c92d7a1ce758fc5587c287600d0bedf1f7bd46949171
6
+ metadata.gz: c49e16d780adbf8ed5976c6fa0693569f629cb5424e9e84c50f94ee29c8ea373333613eebc4aaa3f2b34e080a8aaf6fd6bc6e025bb2da07eb32882547c6c532e
7
+ data.tar.gz: c6f04a4c3af67649bd51fb423e11a0059d46e58dba92aee0062c4467a47c55e44ef56aa60a7beeca1581095e1b63e17dd1e8274510ee3b2acb7eadf49611a117
data/CHANGELOG.md CHANGED
@@ -18,3 +18,6 @@
18
18
  ## 1.0.0
19
19
  * **Breaking change**: `limit`, `page`, and `search` params should be at the root level requests instead of in the `query` hash.
20
20
  * Updated endpoints to use the `api` subdomain; `api.easybroker.com/v1` instead of `www.easybroker.com/api/v1`.
21
+
22
+ # 1.0.1
23
+ * Added support for agencies, agents, properties and property_integrations endpoints for integration partners.
data/README.md CHANGED
@@ -62,6 +62,9 @@ results.next_page
62
62
 
63
63
  # Search for only published properties
64
64
  client.properties.search(search: { statuses: [:published] }, limit: 1, page: 1)
65
+
66
+ # As a partner you can update the property integration on EB
67
+ client.integration_partners.property_integrations.update('EB-123', body: { status: 'successful', listing_url: "https://www.yourwebsite.com/EB-XXXX01" })
65
68
  ```
66
69
 
67
70
  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.
@@ -79,7 +82,13 @@ client.contact_requests # List and search contact requests in your account - TDB
79
82
  client.properties # List, search and find properties in your account
80
83
  client.mls_properties # List, search and find properties in the MLS - requires MLS API Plan
81
84
  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.
85
+
86
+ ### The following require a partner api key.
87
+ client.integration_partners.agencies # List and search connected agencies.
88
+ client.integration_partners.agents # View detailed agent contact information for those agents assigned to properties.
89
+ client.integration_partners.listing_statuses # List and search the listing status for partner properties.
90
+ client.integration_partners.properties # View the full property listing and its details.
91
+ client.integration_partners.property_integrations # Update the property integration on EB with the listing status on your website.
83
92
  ```
84
93
 
85
94
  ## Development
@@ -20,11 +20,11 @@ class EasyBroker::ApiClient
20
20
  end
21
21
 
22
22
  def post(path, query: {}, body: {})
23
- send_request(:post, path, query: query, body: body)
23
+ send_request(:post, path, query: query, body: body.to_json)
24
24
  end
25
25
 
26
26
  def put(path, query: {}, body: {})
27
- send_request(:put, path, query: query, body: body)
27
+ send_request(:put, path, query: query, body: body.to_json)
28
28
  end
29
29
 
30
30
  def delete(path, query: {})
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EasyBroker
4
+ module IntegrationPartners
5
+ class Agencies
6
+ ENDPOINT = '/integration_partners/agencies'
7
+
8
+ attr_reader :api_client
9
+
10
+ def initialize(api_client)
11
+ @api_client = api_client
12
+ end
13
+
14
+ def find(agency_id)
15
+ response = api_client.get("#{ENDPOINT}/#{agency_id}")
16
+ JSON.parse(response.body, object_class: OpenStruct)
17
+ end
18
+
19
+ def search(query = {})
20
+ stored_query = EasyBroker::Query.new(api_client, ENDPOINT, query)
21
+ EasyBroker::PaginatedResponse.new(stored_query)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EasyBroker
4
+ module IntegrationPartners
5
+ class Agents
6
+ ENDPOINT = '/integration_partners/agents'
7
+
8
+ attr_reader :api_client
9
+
10
+ def initialize(api_client)
11
+ @api_client = api_client
12
+ end
13
+
14
+ def find(agent_id)
15
+ response = api_client.get("#{ENDPOINT}/#{agent_id}")
16
+ JSON.parse(response.body, object_class: OpenStruct)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EasyBroker
4
+ module IntegrationPartners
5
+ class Properties
6
+ ENDPOINT = '/integration_partners/properties'
7
+
8
+ attr_reader :api_client
9
+
10
+ def initialize(api_client)
11
+ @api_client = api_client
12
+ end
13
+
14
+ def find(property_id)
15
+ response = api_client.get("#{ENDPOINT}/#{property_id}")
16
+ JSON.parse(response.body, object_class: OpenStruct)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EasyBroker
4
+ module IntegrationPartners
5
+ class PropertyIntegrations
6
+ ENDPOINT = "/integration_partners/properties/%{property_id}/property_integration"
7
+
8
+ attr_reader :api_client
9
+
10
+ def initialize(api_client)
11
+ @api_client = api_client
12
+ end
13
+
14
+ def update(property_id, body: {})
15
+ response = api_client.put(format(ENDPOINT, property_id: property_id), body: body)
16
+ JSON.parse(response.body, object_class: OpenStruct)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -9,9 +9,25 @@ module EasyBroker
9
9
  @api_client = api_client
10
10
  end
11
11
 
12
+ def agencies
13
+ EasyBroker::IntegrationPartners::Agencies.new(api_client)
14
+ end
15
+
16
+ def agents
17
+ EasyBroker::IntegrationPartners::Agents.new(api_client)
18
+ end
19
+
12
20
  def listing_statuses
13
21
  EasyBroker::IntegrationPartners::ListingStatuses.new(api_client)
14
22
  end
23
+
24
+ def properties
25
+ EasyBroker::IntegrationPartners::Properties.new(api_client)
26
+ end
27
+
28
+ def property_integrations
29
+ EasyBroker::IntegrationPartners::PropertyIntegrations.new(api_client)
30
+ end
15
31
  end
16
32
  end
17
33
  end
@@ -1,3 +1,3 @@
1
1
  module EasyBroker
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/lib/easy_broker.rb CHANGED
@@ -14,7 +14,11 @@ require 'easy_broker/contact_requests'
14
14
  require 'easy_broker/locations'
15
15
  require 'easy_broker/listing_statuses'
16
16
  require 'easy_broker/integration_partners/public_client'
17
+ require 'easy_broker/integration_partners/agencies'
18
+ require 'easy_broker/integration_partners/agents'
17
19
  require 'easy_broker/integration_partners/listing_statuses'
20
+ require 'easy_broker/integration_partners/properties'
21
+ require 'easy_broker/integration_partners/property_integrations'
18
22
 
19
23
  module EasyBroker
20
24
  def self.configuration
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_broker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Northam
@@ -130,7 +130,11 @@ 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/agencies.rb
134
+ - lib/easy_broker/integration_partners/agents.rb
133
135
  - lib/easy_broker/integration_partners/listing_statuses.rb
136
+ - lib/easy_broker/integration_partners/properties.rb
137
+ - lib/easy_broker/integration_partners/property_integrations.rb
134
138
  - lib/easy_broker/integration_partners/public_client.rb
135
139
  - lib/easy_broker/listing_statuses.rb
136
140
  - lib/easy_broker/locations.rb