Class: ThePlaidApi::DashboardUser
- Defined in:
- lib/the_plaid_api/models/dashboard_user.rb
Overview
Account information associated with a team member with access to the Plaid dashboard.
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
An ISO8601 formatted timestamp.
-
#email_address ⇒ String
A valid email address.
-
#id ⇒ String
ID of the associated user.
-
#status ⇒ DashboardUserStatus
The current status of the user.
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(id:, created_at:, email_address:, status:, additional_properties: nil) ⇒ DashboardUser
constructor
A new instance of DashboardUser.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
-
#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(id:, created_at:, email_address:, status:, additional_properties: nil) ⇒ DashboardUser
Returns a new instance of DashboardUser.
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 53 def initialize(id:, created_at:, email_address:, status:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @created_at = created_at @email_address = email_address @status = status @additional_properties = additional_properties end |
Instance Attribute Details
#created_at ⇒ DateTime
An ISO8601 formatted timestamp.
21 22 23 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 21 def created_at @created_at end |
#email_address ⇒ String
A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](datatracker.ietf.org/doc/html/rfc3696).
27 28 29 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 27 def email_address @email_address end |
#id ⇒ String
ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use ‘/dashboard_user/get`.
17 18 19 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 17 def id @id end |
#status ⇒ DashboardUserStatus
The current status of the user.
31 32 33 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 31 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 66 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) end email_address = hash.key?('email_address') ? hash['email_address'] : nil status = hash.key?('status') ? hash['status'] : nil # 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. DashboardUser.new(id: id, created_at: created_at, email_address: email_address, status: status, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['created_at'] = 'created_at' @_hash['email_address'] = 'email_address' @_hash['status'] = 'status' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 44 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
104 105 106 107 108 109 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 104 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, created_at: #{@created_at.inspect}, email_address:"\ " #{@email_address.inspect}, status: #{@status.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_created_at ⇒ Object
92 93 94 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 92 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
97 98 99 100 101 |
# File 'lib/the_plaid_api/models/dashboard_user.rb', line 97 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, created_at: #{@created_at}, email_address: #{@email_address},"\ " status: #{@status}, additional_properties: #{@additional_properties}>" end |