Class: ThePlaidApi::LinkTokenGetMetadataResponse

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

Overview

An object specifying the arguments originally provided to the ‘/link/token/create` call.

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(initial_products:, webhook:, country_codes:, language:, redirect_uri:, client_name:, institution_data: SKIP, account_filters: SKIP, additional_properties: nil) ⇒ LinkTokenGetMetadataResponse

Returns a new instance of LinkTokenGetMetadataResponse.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 78

def initialize(initial_products:, webhook:, country_codes:, language:,
               redirect_uri:, client_name:, institution_data: SKIP,
               account_filters: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @initial_products = initial_products
  @webhook = webhook
  @country_codes = country_codes
  @language = language
  @institution_data = institution_data unless institution_data == SKIP
  @account_filters =  unless  == SKIP
  @redirect_uri = redirect_uri
  @client_name = client_name
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_filtersAccountFiltersResponse

The ‘account_filters` specified in the original call to `/link/token/create`.



36
37
38
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 36

def 
  @account_filters
end

#client_nameString

The ‘client_name` specified in the `/link/token/create` call.

Returns:

  • (String)


44
45
46
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 44

def client_name
  @client_name
end

#country_codesArray[CountryCode]

The ‘country_codes` specified in the `/link/token/create` call.

Returns:



23
24
25
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 23

def country_codes
  @country_codes
end

#initial_productsArray[Products]

The ‘products` specified in the `/link/token/create` call.

Returns:



15
16
17
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 15

def initial_products
  @initial_products
end

#institution_dataLinkTokenCreateInstitutionData

A map containing data used to highlight institutions in Link.



31
32
33
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 31

def institution_data
  @institution_data
end

#languageString

The ‘language` specified in the `/link/token/create` call.

Returns:

  • (String)


27
28
29
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 27

def language
  @language
end

#redirect_uriString

The ‘redirect_uri` specified in the `/link/token/create` call.

Returns:

  • (String)


40
41
42
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 40

def redirect_uri
  @redirect_uri
end

#webhookString

The ‘webhook` specified in the `/link/token/create` call.

Returns:

  • (String)


19
20
21
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 19

def webhook
  @webhook
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
129
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 96

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  initial_products =
    hash.key?('initial_products') ? hash['initial_products'] : nil
  webhook = hash.key?('webhook') ? hash['webhook'] : nil
  country_codes = hash.key?('country_codes') ? hash['country_codes'] : nil
  language = hash.key?('language') ? hash['language'] : nil
  redirect_uri = hash.key?('redirect_uri') ? hash['redirect_uri'] : nil
  client_name = hash.key?('client_name') ? hash['client_name'] : nil
  institution_data = LinkTokenCreateInstitutionData.from_hash(hash['institution_data']) if
    hash['institution_data']
   = AccountFiltersResponse.from_hash(hash['account_filters']) if
    hash['account_filters']

  # 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.
  LinkTokenGetMetadataResponse.new(initial_products: initial_products,
                                   webhook: webhook,
                                   country_codes: country_codes,
                                   language: language,
                                   redirect_uri: redirect_uri,
                                   client_name: client_name,
                                   institution_data: institution_data,
                                   account_filters: ,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 47

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['initial_products'] = 'initial_products'
  @_hash['webhook'] = 'webhook'
  @_hash['country_codes'] = 'country_codes'
  @_hash['language'] = 'language'
  @_hash['institution_data'] = 'institution_data'
  @_hash['account_filters'] = 'account_filters'
  @_hash['redirect_uri'] = 'redirect_uri'
  @_hash['client_name'] = 'client_name'
  @_hash
end

.nullablesObject

An array for nullable fields



69
70
71
72
73
74
75
76
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 69

def self.nullables
  %w[
    webhook
    language
    redirect_uri
    client_name
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    institution_data
    account_filters
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



142
143
144
145
146
147
148
149
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 142

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} initial_products: #{@initial_products.inspect}, webhook:"\
  " #{@webhook.inspect}, country_codes: #{@country_codes.inspect}, language:"\
  " #{@language.inspect}, institution_data: #{@institution_data.inspect}, account_filters:"\
  " #{@account_filters.inspect}, redirect_uri: #{@redirect_uri.inspect}, client_name:"\
  " #{@client_name.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



132
133
134
135
136
137
138
139
# File 'lib/the_plaid_api/models/link_token_get_metadata_response.rb', line 132

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} initial_products: #{@initial_products}, webhook: #{@webhook},"\
  " country_codes: #{@country_codes}, language: #{@language}, institution_data:"\
  " #{@institution_data}, account_filters: #{@account_filters}, redirect_uri:"\
  " #{@redirect_uri}, client_name: #{@client_name}, additional_properties:"\
  " #{@additional_properties}>"
end