Class: ThePlaidApi::CraNetworkInsightsItem

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/cra_network_insights_item.rb

Overview

Contains data about the connected Item.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(institution_id:, institution_name:, item_id:, additional_properties: nil) ⇒ CraNetworkInsightsItem

Returns a new instance of CraNetworkInsightsItem.



43
44
45
46
47
48
49
50
51
52
# File 'lib/the_plaid_api/models/cra_network_insights_item.rb', line 43

def initialize(institution_id:, institution_name:, item_id:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @institution_id = institution_id
  @institution_name = institution_name
  @item_id = item_id
  @additional_properties = additional_properties
end

Instance Attribute Details

#institution_idString

The ID for the institution the user linked.

Returns:

  • (String)


14
15
16
# File 'lib/the_plaid_api/models/cra_network_insights_item.rb', line 14

def institution_id
  @institution_id
end

#institution_nameString

The name of the institution the user linked.

Returns:

  • (String)


18
19
20
# File 'lib/the_plaid_api/models/cra_network_insights_item.rb', line 18

def institution_name
  @institution_name
end

#item_idString

The identifier for the Item.

Returns:

  • (String)


22
23
24
# File 'lib/the_plaid_api/models/cra_network_insights_item.rb', line 22

def item_id
  @item_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/the_plaid_api/models/cra_network_insights_item.rb', line 55

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  institution_id =
    hash.key?('institution_id') ? hash['institution_id'] : nil
  institution_name =
    hash.key?('institution_name') ? hash['institution_name'] : nil
  item_id = hash.key?('item_id') ? hash['item_id'] : 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.
  CraNetworkInsightsItem.new(institution_id: institution_id,
                             institution_name: institution_name,
                             item_id: item_id,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/the_plaid_api/models/cra_network_insights_item.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['institution_id'] = 'institution_id'
  @_hash['institution_name'] = 'institution_name'
  @_hash['item_id'] = 'item_id'
  @_hash
end

.nullablesObject

An array for nullable fields



39
40
41
# File 'lib/the_plaid_api/models/cra_network_insights_item.rb', line 39

def self.nullables
  []
end

.optionalsObject

An array for optional fields



34
35
36
# File 'lib/the_plaid_api/models/cra_network_insights_item.rb', line 34

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



87
88
89
90
91
92
# File 'lib/the_plaid_api/models/cra_network_insights_item.rb', line 87

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} institution_id: #{@institution_id.inspect}, institution_name:"\
  " #{@institution_name.inspect}, item_id: #{@item_id.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



80
81
82
83
84
# File 'lib/the_plaid_api/models/cra_network_insights_item.rb', line 80

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} institution_id: #{@institution_id}, institution_name: #{@institution_name},"\
  " item_id: #{@item_id}, additional_properties: #{@additional_properties}>"
end