Class: ThePlaidApi::Activity
- Defined in:
- lib/the_plaid_api/models/activity.rb
Overview
Describes a consent activity.
Instance Attribute Summary collapse
-
#activity ⇒ ActivityType
Types of consent activities.
-
#authentication ⇒ ItemCreateAuthentication
Enum representing the entity authenticating the user.
-
#id ⇒ String
A unique identifier for the activity.
-
#initiated_date ⇒ Date
The date this activity was initiated [ISO 8601](wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC.
-
#initiator ⇒ String
Application ID of the client who initiated the activity.
-
#scopes ⇒ ScopesNullable
The scopes object.
-
#state ⇒ ActionState
Enum representing the state of the action/activity.
-
#target_application_id ⇒ String
This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(activity:, initiated_date:, id:, initiator:, state:, target_application_id: SKIP, scopes: SKIP, authentication: SKIP, additional_properties: nil) ⇒ Activity
constructor
A new instance of Activity.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(activity:, initiated_date:, id:, initiator:, state:, target_application_id: SKIP, scopes: SKIP, authentication: SKIP, additional_properties: nil) ⇒ Activity
Returns a new instance of Activity.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/the_plaid_api/models/activity.rb', line 77 def initialize(activity:, initiated_date:, id:, initiator:, state:, target_application_id: SKIP, scopes: SKIP, authentication: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @activity = activity @initiated_date = initiated_date @id = id @initiator = initiator @state = state @target_application_id = target_application_id unless target_application_id == SKIP @scopes = scopes unless scopes == SKIP @authentication = authentication unless authentication == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#activity ⇒ ActivityType
Types of consent activities
14 15 16 |
# File 'lib/the_plaid_api/models/activity.rb', line 14 def activity @activity end |
#authentication ⇒ ItemCreateAuthentication
Enum representing the entity authenticating the user.
45 46 47 |
# File 'lib/the_plaid_api/models/activity.rb', line 45 def authentication @authentication end |
#id ⇒ String
A unique identifier for the activity
23 24 25 |
# File 'lib/the_plaid_api/models/activity.rb', line 23 def id @id end |
#initiated_date ⇒ Date
The date this activity was initiated [ISO 8601](wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC.
19 20 21 |
# File 'lib/the_plaid_api/models/activity.rb', line 19 def initiated_date @initiated_date end |
#initiator ⇒ String
Application ID of the client who initiated the activity.
27 28 29 |
# File 'lib/the_plaid_api/models/activity.rb', line 27 def initiator @initiator end |
#scopes ⇒ ScopesNullable
The scopes object
41 42 43 |
# File 'lib/the_plaid_api/models/activity.rb', line 41 def scopes @scopes end |
#state ⇒ ActionState
Enum representing the state of the action/activity.
31 32 33 |
# File 'lib/the_plaid_api/models/activity.rb', line 31 def state @state end |
#target_application_id ⇒ String
This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect.
37 38 39 |
# File 'lib/the_plaid_api/models/activity.rb', line 37 def target_application_id @target_application_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/the_plaid_api/models/activity.rb', line 95 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. activity = hash.key?('activity') ? hash['activity'] : nil initiated_date = hash.key?('initiated_date') ? hash['initiated_date'] : nil id = hash.key?('id') ? hash['id'] : nil initiator = hash.key?('initiator') ? hash['initiator'] : nil state = hash.key?('state') ? hash['state'] : nil target_application_id = hash.key?('target_application_id') ? hash['target_application_id'] : SKIP scopes = ScopesNullable.from_hash(hash['scopes']) if hash['scopes'] authentication = hash.key?('authentication') ? hash['authentication'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. Activity.new(activity: activity, initiated_date: initiated_date, id: id, initiator: initiator, state: state, target_application_id: target_application_id, scopes: scopes, authentication: authentication, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/the_plaid_api/models/activity.rb', line 48 def self.names @_hash = {} if @_hash.nil? @_hash['activity'] = 'activity' @_hash['initiated_date'] = 'initiated_date' @_hash['id'] = 'id' @_hash['initiator'] = 'initiator' @_hash['state'] = 'state' @_hash['target_application_id'] = 'target_application_id' @_hash['scopes'] = 'scopes' @_hash['authentication'] = 'authentication' @_hash end |
.nullables ⇒ Object
An array for nullable fields
71 72 73 74 75 |
# File 'lib/the_plaid_api/models/activity.rb', line 71 def self.nullables %w[ scopes ] end |
.optionals ⇒ Object
An array for optional fields
62 63 64 65 66 67 68 |
# File 'lib/the_plaid_api/models/activity.rb', line 62 def self.optionals %w[ target_application_id scopes authentication ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
140 141 142 143 144 145 146 147 |
# File 'lib/the_plaid_api/models/activity.rb', line 140 def inspect class_name = self.class.name.split('::').last "<#{class_name} activity: #{@activity.inspect}, initiated_date: #{@initiated_date.inspect},"\ " id: #{@id.inspect}, initiator: #{@initiator.inspect}, state: #{@state.inspect},"\ " target_application_id: #{@target_application_id.inspect}, scopes: #{@scopes.inspect},"\ " authentication: #{@authentication.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
131 132 133 134 135 136 137 |
# File 'lib/the_plaid_api/models/activity.rb', line 131 def to_s class_name = self.class.name.split('::').last "<#{class_name} activity: #{@activity}, initiated_date: #{@initiated_date}, id: #{@id},"\ " initiator: #{@initiator}, state: #{@state}, target_application_id:"\ " #{@target_application_id}, scopes: #{@scopes}, authentication: #{@authentication},"\ " additional_properties: #{@additional_properties}>" end |