Class: AqumulateAPI::Advisor
- Defined in:
- lib/aqumulate_api/entities/advisor.rb
Constant Summary collapse
- ATTR_MAP =
{ user_id: 'UserId', password: 'Password', first_name: 'FirstName', last_name: 'LastName', email: 'Email', phone: 'Phone', ssn: 'SSN', address_1: 'Address1', address_2: 'Address2', city: 'City', state: 'StateProvidence', zip: 'ZipCode', country: 'Country' }
Constants inherited from Entity
Instance Attribute Summary collapse
-
#address_1 ⇒ Object
Returns the value of attribute address_1.
-
#address_2 ⇒ Object
Returns the value of attribute address_2.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#password ⇒ Object
Returns the value of attribute password.
-
#persisted ⇒ Object
Returns the value of attribute persisted.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#ssn ⇒ Object
Returns the value of attribute ssn.
-
#state ⇒ Object
Returns the value of attribute state.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#zip ⇒ Object
Returns the value of attribute zip.
Class Method Summary collapse
Instance Method Summary collapse
- #accounts(fi_id = nil) ⇒ Object
- #add_account(fi_id, login_parameters, fetch_parameters) ⇒ Object
- #destroy ⇒ Object
- #save ⇒ Object
- #session_id(password = self.password) ⇒ Object
Methods inherited from Entity
Constructor Details
This class inherits a constructor from AqumulateAPI::Entity
Instance Attribute Details
#address_1 ⇒ Object
Returns the value of attribute address_1.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def address_1 @address_1 end |
#address_2 ⇒ Object
Returns the value of attribute address_2.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def address_2 @address_2 end |
#city ⇒ Object
Returns the value of attribute city.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def country @country end |
#email ⇒ Object
Returns the value of attribute email.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def last_name @last_name end |
#password ⇒ Object
Returns the value of attribute password.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def password @password end |
#persisted ⇒ Object
Returns the value of attribute persisted.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def persisted @persisted end |
#phone ⇒ Object
Returns the value of attribute phone.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def phone @phone end |
#ssn ⇒ Object
Returns the value of attribute ssn.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def ssn @ssn end |
#state ⇒ Object
Returns the value of attribute state.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def state @state end |
#user_id ⇒ Object
Returns the value of attribute user_id.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def user_id @user_id end |
#zip ⇒ Object
Returns the value of attribute zip.
20 21 22 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 20 def zip @zip end |
Class Method Details
.all ⇒ Object
33 34 35 36 37 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 33 def self.all response = AggAdvisor.get_advisors return [] unless response.has_key?('AdvisorList') response['AdvisorList'].map { |source| from_source(source) } end |
.find(user_id) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 23 def self.find(user_id) response = AggAdvisor.get_advisor_by_id({ 'UserId' => user_id }) AqumulateAPI.session.check_raise_request_error(response) advisor = from_source(response) advisor.user_id = user_id return advisor end |
Instance Method Details
#accounts(fi_id = nil) ⇒ Object
56 57 58 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 56 def accounts(fi_id = nil) Account.fetch(self, fi_id) end |
#add_account(fi_id, login_parameters, fetch_parameters) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 60 def add_account(fi_id, login_parameters, fetch_parameters) AggAccount.advisor_add_account( { 'SessionId' => session_id, 'FIId' => fi_id, 'FIType' => 'Advisor', 'FIFetchParamList' => fetch_parameters, 'ParameterList' => login_parameters } ) end |
#destroy ⇒ Object
51 52 53 54 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 51 def destroy AggAdvisor.delete_advisor({ 'UserID' => user_id }) return true end |
#save ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 43 def save if !persisted create else update end end |
#session_id(password = self.password) ⇒ Object
39 40 41 |
# File 'lib/aqumulate_api/entities/advisor.rb', line 39 def session_id(password = self.password) @session_id ||= AggAdvisor.advisor_sign_on('UserId' => user_id, 'Password' => password)['SessionId'] end |