Class: Pardot::Client
- Inherits:
-
Object
- Object
- Pardot::Client
- Includes:
- HTTParty, Authentication, Http, Objects::CustomFields, Objects::Emails, Objects::ListMemberships, Objects::Lists, Objects::Opportunities, Objects::ProspectAccounts, Objects::Prospects, Objects::Users, Objects::VisitorActivities, Objects::Visitors, Objects::Visits
- Defined in:
- lib/pardot/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#business_unit_id ⇒ Object
Returns the value of attribute business_unit_id.
-
#email ⇒ Object
Returns the value of attribute email.
-
#format ⇒ Object
Returns the value of attribute format.
-
#password ⇒ Object
Returns the value of attribute password.
-
#salesforce_access_token ⇒ Object
Returns the value of attribute salesforce_access_token.
-
#user_key ⇒ Object
Returns the value of attribute user_key.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(email = nil, password = nil, user_key = nil, version = 3, salesforce_access_token = nil, business_unit_id = nil) ⇒ Client
constructor
deprecated
Deprecated.
Arguments email, password and user_key are deprecated. Use salesforce_access_token with Salesforce OAuth.
Methods included from Objects::VisitorActivities
Methods included from Objects::Visits
Methods included from Objects::Visitors
Methods included from Objects::Users
Methods included from Objects::ProspectAccounts
Methods included from Objects::Prospects
Methods included from Objects::Opportunities
Methods included from Objects::ListMemberships
Methods included from Objects::Lists
Methods included from Objects::Emails
Methods included from Objects::CustomFields
Methods included from Http
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
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_key ⇒ Object
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_id ⇒ Object
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 |
#email ⇒ Object
Returns the value of attribute email.
22 23 24 |
# File 'lib/pardot/client.rb', line 22 def email @email end |
#format ⇒ Object
Returns the value of attribute format.
22 23 24 |
# File 'lib/pardot/client.rb', line 22 def format @format end |
#password ⇒ Object
Returns the value of attribute password.
22 23 24 |
# File 'lib/pardot/client.rb', line 22 def password @password end |
#salesforce_access_token ⇒ Object
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_key ⇒ Object
Returns the value of attribute user_key.
22 23 24 |
# File 'lib/pardot/client.rb', line 22 def user_key @user_key end |
#version ⇒ Object
Returns the value of attribute version.
22 23 24 |
# File 'lib/pardot/client.rb', line 22 def version @version end |