Class: Pardot::Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Objects::VisitorActivities

#visitor_activities

Methods included from Objects::Visits

#visits

Methods included from Objects::Visitors

#visitors

Methods included from Objects::Users

#users

Methods included from Objects::ProspectAccounts

#prospect_accounts

Methods included from Objects::Prospects

#prospects

Methods included from Objects::Opportunities

#opportunities

Methods included from Objects::ListMemberships

#list_memberships

Methods included from Objects::Lists

#lists

Methods included from Objects::Emails

#emails

Methods included from Objects::CustomFields

#custom_fields

Methods included from Http

#get, #post

Methods included from Authentication

#authenticate, #authenticated?, #reauthenticate, #using_salesforce_access_token?

Constructor Details

#initialize(email = nil, password = nil, user_key = nil, version = 3, salesforce_access_token = nil, business_unit_id = nil) ⇒ Client

Deprecated.

Arguments email, password and user_key are deprecated. Use salesforce_access_token with Salesforce OAuth.

Returns a new instance of Client.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/pardot/client.rb', line 25

def initialize(email = nil, password = nil, user_key = nil, version = 3, salesforce_access_token = nil, business_unit_id = nil)
  unless email.nil? || password.nil? || user_key.nil?
    warn '[DEPRECATION] Use of username and password authentication is deprecated in favor of Salesforce OAuth. See https://developer.pardot.com/kb/authentication/ for more information.'
  end

  if !salesforce_access_token.nil? && business_unit_id.nil?
    raise 'business_unit_id required when using Salesforce access_token'
  end
  if !business_unit_id.nil? && (!business_unit_id.start_with?('0Uv') || business_unit_id.length != 18)
    raise "Invalid business_unit_id value. Expected ID to start with '0Uv' and be length of 18 characters."
  end

  @email = email
  @password = password
  @user_key = user_key
  @version = version
  @salesforce_access_token = salesforce_access_token
  @business_unit_id = business_unit_id

  @format = 'simple'
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



22
23
24
# File 'lib/pardot/client.rb', line 22

def api_key
  @api_key
end

#business_unit_idObject

Returns the value of attribute business_unit_id.



22
23
24
# File 'lib/pardot/client.rb', line 22

def business_unit_id
  @business_unit_id
end

#emailObject

Returns the value of attribute email.



22
23
24
# File 'lib/pardot/client.rb', line 22

def email
  @email
end

#formatObject

Returns the value of attribute format.



22
23
24
# File 'lib/pardot/client.rb', line 22

def format
  @format
end

#passwordObject

Returns the value of attribute password.



22
23
24
# File 'lib/pardot/client.rb', line 22

def password
  @password
end

#salesforce_access_tokenObject

Returns the value of attribute salesforce_access_token.



22
23
24
# File 'lib/pardot/client.rb', line 22

def salesforce_access_token
  @salesforce_access_token
end

#user_keyObject

Returns the value of attribute user_key.



22
23
24
# File 'lib/pardot/client.rb', line 22

def user_key
  @user_key
end

#versionObject

Returns the value of attribute version.



22
23
24
# File 'lib/pardot/client.rb', line 22

def version
  @version
end