class G5YglClient20::Client

Public Class Methods

new(username, password, subscription_id, source_id, sub_source_id) click to toggle source
# 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

Public Instance Methods

get_lead(property_id, lead_id) click to toggle source
# 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) click to toggle source
# 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() click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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