Class: ThePlaidApi::PartyEntity
- Defined in:
- lib/the_plaid_api/models/party_entity.rb
Overview
FDX Participant - an entity or person that is a part of a FDX API transaction
Instance Attribute Summary collapse
-
#home_uri ⇒ String
URI for party, where an end user could learn more about the company or application involved in the data sharing chain.
-
#logo_uri ⇒ String
URI for a logo asset to be displayed to the end user.
-
#name ⇒ String
Human recognizable common name.
-
#registered_entity_id ⇒ String
Registered id of party.
-
#registered_entity_name ⇒ String
Registered name of party.
-
#registry ⇒ PartyRegistry
The registry containing the party’s registration with name and id.
-
#type ⇒ PartyType
Identifies the type of a party.
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(name:, type:, home_uri: SKIP, logo_uri: SKIP, registry: SKIP, registered_entity_name: SKIP, registered_entity_id: SKIP, additional_properties: nil) ⇒ PartyEntity
constructor
A new instance of PartyEntity.
-
#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(name:, type:, home_uri: SKIP, logo_uri: SKIP, registry: SKIP, registered_entity_name: SKIP, registered_entity_id: SKIP, additional_properties: nil) ⇒ PartyEntity
Returns a new instance of PartyEntity.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 71 def initialize(name:, type:, home_uri: SKIP, logo_uri: SKIP, registry: SKIP, registered_entity_name: SKIP, registered_entity_id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @name = name @type = type @home_uri = home_uri unless home_uri == SKIP @logo_uri = logo_uri unless logo_uri == SKIP @registry = registry unless registry == SKIP @registered_entity_name = registered_entity_name unless registered_entity_name == SKIP @registered_entity_id = registered_entity_id unless registered_entity_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#home_uri ⇒ String
URI for party, where an end user could learn more about the company or application involved in the data sharing chain
24 25 26 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 24 def home_uri @home_uri end |
#logo_uri ⇒ String
URI for a logo asset to be displayed to the end user
28 29 30 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 28 def logo_uri @logo_uri end |
#name ⇒ String
Human recognizable common name
15 16 17 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 15 def name @name end |
#registered_entity_id ⇒ String
Registered id of party
40 41 42 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 40 def registered_entity_id @registered_entity_id end |
#registered_entity_name ⇒ String
Registered name of party
36 37 38 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 36 def registered_entity_name @registered_entity_name end |
#registry ⇒ PartyRegistry
The registry containing the party’s registration with name and id
32 33 34 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 32 def registry @registry end |
#type ⇒ PartyType
Identifies the type of a party
19 20 21 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 19 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : nil type = hash.key?('type') ? hash['type'] : nil home_uri = hash.key?('homeUri') ? hash['homeUri'] : SKIP logo_uri = hash.key?('logoUri') ? hash['logoUri'] : SKIP registry = hash.key?('registry') ? hash['registry'] : SKIP registered_entity_name = hash.key?('registeredEntityName') ? hash['registeredEntityName'] : SKIP registered_entity_id = hash.key?('registeredEntityId') ? hash['registeredEntityId'] : 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. PartyEntity.new(name: name, type: type, home_uri: home_uri, logo_uri: logo_uri, registry: registry, registered_entity_name: registered_entity_name, registered_entity_id: registered_entity_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 43 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['type'] = 'type' @_hash['home_uri'] = 'homeUri' @_hash['logo_uri'] = 'logoUri' @_hash['registry'] = 'registry' @_hash['registered_entity_name'] = 'registeredEntityName' @_hash['registered_entity_id'] = 'registeredEntityId' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
56 57 58 59 60 61 62 63 64 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 56 def self.optionals %w[ home_uri logo_uri registry registered_entity_name registered_entity_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
130 131 132 133 134 135 136 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 130 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, type: #{@type.inspect}, home_uri:"\ " #{@home_uri.inspect}, logo_uri: #{@logo_uri.inspect}, registry: #{@registry.inspect},"\ " registered_entity_name: #{@registered_entity_name.inspect}, registered_entity_id:"\ " #{@registered_entity_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
121 122 123 124 125 126 127 |
# File 'lib/the_plaid_api/models/party_entity.rb', line 121 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, type: #{@type}, home_uri: #{@home_uri}, logo_uri:"\ " #{@logo_uri}, registry: #{@registry}, registered_entity_name: #{@registered_entity_name},"\ " registered_entity_id: #{@registered_entity_id}, additional_properties:"\ " #{@additional_properties}>" end |