Class: ThePlaidApi::ExtendedRecipientMetadata

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

Overview

Plaid and FDX-defined recipient metadata fields

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(recipient_id:, client_name:, third_party_legal_name:, category:, joined_date:, connection_count:, logo_uri: SKIP, additional_properties: nil) ⇒ ExtendedRecipientMetadata

Returns a new instance of ExtendedRecipientMetadata.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/the_plaid_api/models/extended_recipient_metadata.rb', line 68

def initialize(recipient_id:, client_name:, third_party_legal_name:,
               category:, joined_date:, connection_count:, logo_uri: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @recipient_id = recipient_id
  @client_name = client_name
  @logo_uri = logo_uri unless logo_uri == SKIP
  @third_party_legal_name = third_party_legal_name
  @category = category
  @joined_date = joined_date
  @connection_count = connection_count
  @additional_properties = additional_properties
end

Instance Attribute Details

#categoryString

The category that the recipient falls under

Returns:

  • (String)


30
31
32
# File 'lib/the_plaid_api/models/extended_recipient_metadata.rb', line 30

def category
  @category
end

#client_nameString

The recipient name displayed by the Data Provider during the consent flow

Returns:

  • (String)


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

def client_name
  @client_name
end

#connection_countInteger

The number of Data Partner consumers that are connected to the recipient for the specific Data Partner

Returns:

  • (Integer)


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

def connection_count
  @connection_count
end

#joined_dateDate

The date at which the recipient gained production access to Plaid

Returns:

  • (Date)


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

def joined_date
  @joined_date
end

#logo_uriString

Data Recipient Logo URL location

Returns:

  • (String)


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

def logo_uri
  @logo_uri
end

#recipient_idString

The recipient identifier

Returns:

  • (String)


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

def recipient_id
  @recipient_id
end

The legal name of the recipient

Returns:

  • (String)


26
27
28
# File 'lib/the_plaid_api/models/extended_recipient_metadata.rb', line 26

def third_party_legal_name
  @third_party_legal_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



85
86
87
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
# File 'lib/the_plaid_api/models/extended_recipient_metadata.rb', line 85

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  recipient_id = hash.key?('recipient_id') ? hash['recipient_id'] : nil
  client_name = hash.key?('client_name') ? hash['client_name'] : nil
  third_party_legal_name =
    hash.key?('third_party_legal_name') ? hash['third_party_legal_name'] : nil
  category = hash.key?('category') ? hash['category'] : nil
  joined_date = hash.key?('joined_date') ? hash['joined_date'] : nil
  connection_count =
    hash.key?('connection_count') ? hash['connection_count'] : nil
  logo_uri = hash.key?('logo_uri') ? hash['logo_uri'] : 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.
  ExtendedRecipientMetadata.new(recipient_id: recipient_id,
                                client_name: client_name,
                                third_party_legal_name: third_party_legal_name,
                                category: category,
                                joined_date: joined_date,
                                connection_count: connection_count,
                                logo_uri: logo_uri,
                                additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['recipient_id'] = 'recipient_id'
  @_hash['client_name'] = 'client_name'
  @_hash['logo_uri'] = 'logo_uri'
  @_hash['third_party_legal_name'] = 'third_party_legal_name'
  @_hash['category'] = 'category'
  @_hash['joined_date'] = 'joined_date'
  @_hash['connection_count'] = 'connection_count'
  @_hash
end

.nullablesObject

An array for nullable fields



62
63
64
65
66
# File 'lib/the_plaid_api/models/extended_recipient_metadata.rb', line 62

def self.nullables
  %w[
    logo_uri
  ]
end

.optionalsObject

An array for optional fields



55
56
57
58
59
# File 'lib/the_plaid_api/models/extended_recipient_metadata.rb', line 55

def self.optionals
  %w[
    logo_uri
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



127
128
129
130
131
132
133
134
# File 'lib/the_plaid_api/models/extended_recipient_metadata.rb', line 127

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} recipient_id: #{@recipient_id.inspect}, client_name:"\
  " #{@client_name.inspect}, logo_uri: #{@logo_uri.inspect}, third_party_legal_name:"\
  " #{@third_party_legal_name.inspect}, category: #{@category.inspect}, joined_date:"\
  " #{@joined_date.inspect}, connection_count: #{@connection_count.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



118
119
120
121
122
123
124
# File 'lib/the_plaid_api/models/extended_recipient_metadata.rb', line 118

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} recipient_id: #{@recipient_id}, client_name: #{@client_name}, logo_uri:"\
  " #{@logo_uri}, third_party_legal_name: #{@third_party_legal_name}, category: #{@category},"\
  " joined_date: #{@joined_date}, connection_count: #{@connection_count},"\
  " additional_properties: #{@additional_properties}>"
end