Class: G5YglClient20::Client
- Inherits:
-
Object
- Object
- G5YglClient20::Client
- Defined in:
- lib/g5_ygl_client_20/client.rb
Instance Method Summary collapse
- #get_lead(property_id, lead_id) ⇒ Object
- #get_leads_for_property(property_id) ⇒ Object
- #get_properties ⇒ Object
- #get_property(property_id) ⇒ Object
-
#initialize(username, password, subscription_id, source_id, sub_source_id) ⇒ Client
constructor
A new instance of Client.
- #post_lead(property_id, lead) ⇒ Object
Constructor Details
#initialize(username, password, subscription_id, source_id, sub_source_id) ⇒ Client
Returns a new instance of Client.
4 5 6 7 8 9 10 |
# File 'lib/g5_ygl_client_20/client.rb', line 4 def initialize(username, password, subscription_id, source_id, sub_source_id) @auth = "BASIC " + Base64.strict_encode64("#{username}:#{password}") @url = "https://www.youvegotleads.com/api/properties/" @subscription_id = subscription_id @source_id = source_id || 588 #this magical code was for the first client - but should probably be removed @sub_source_id = sub_source_id end |
Instance Method Details
#get_lead(property_id, lead_id) ⇒ Object
28 29 30 |
# File 'lib/g5_ygl_client_20/client.rb', line 28 def get_lead(property_id, lead_id) request = GetLeadRequest.execute(@auth, @url, @subscription_id, property_id, lead_id) end |
#get_leads_for_property(property_id) ⇒ Object
24 25 26 |
# File 'lib/g5_ygl_client_20/client.rb', line 24 def get_leads_for_property(property_id) request = GetLeadsForPropertyRequest.execute(@auth, @url, @subscription_id, property_id) end |
#get_properties ⇒ Object
12 13 14 |
# File 'lib/g5_ygl_client_20/client.rb', line 12 def get_properties request = GetPropertiesRequest.execute(@auth, @url, @subscription_id) end |
#get_property(property_id) ⇒ Object
16 17 18 |
# File 'lib/g5_ygl_client_20/client.rb', line 16 def get_property(property_id) request = GetPropertyRequest.execute(@auth, @url, @subscription_id, property_id) end |
#post_lead(property_id, lead) ⇒ Object
20 21 22 |
# File 'lib/g5_ygl_client_20/client.rb', line 20 def post_lead(property_id, lead) request = PostLeadRequest.execute(@auth, @url, @source_id, @sub_source_id, property_id, lead) end |