Class: ThePlaidApi::Application

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

Overview

Metadata about the application

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(application_id:, name:, display_name:, join_date:, logo_url:, application_url:, reason_for_access:, use_case:, company_legal_name:, city:, region:, postal_code:, country_code:, additional_properties: nil) ⇒ Application

Returns a new instance of Application.



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/application.rb', line 108

def initialize(application_id:, name:, display_name:, join_date:, logo_url:,
               application_url:, reason_for_access:, use_case:,
               company_legal_name:, city:, region:, postal_code:,
               country_code:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @application_id = application_id
  @name = name
  @display_name = display_name
  @join_date = join_date
  @logo_url = logo_url
  @application_url = application_url
  @reason_for_access = reason_for_access
  @use_case = use_case
  @company_legal_name = company_legal_name
  @city = city
  @region = region
  @postal_code = postal_code
  @country_code = country_code
  @additional_properties = additional_properties
end

Instance Attribute Details

#application_idString

This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect.

Returns:

  • (String)


16
17
18
# File 'lib/the_plaid_api/models/application.rb', line 16

def application_id
  @application_id
end

#application_urlString

The URL for the application’s website

Returns:

  • (String)


37
38
39
# File 'lib/the_plaid_api/models/application.rb', line 37

def application_url
  @application_url
end

#cityString

A string representing the city of the client’s headquarters.

Returns:

  • (String)


54
55
56
# File 'lib/the_plaid_api/models/application.rb', line 54

def city
  @city
end

A string representing the name of client’s legal entity.

Returns:

  • (String)


50
51
52
# File 'lib/the_plaid_api/models/application.rb', line 50

def company_legal_name
  @company_legal_name
end

#country_codeString

A string representing the country code of the client’s headquarters.

Returns:

  • (String)


66
67
68
# File 'lib/the_plaid_api/models/application.rb', line 66

def country_code
  @country_code
end

#display_nameString

A human-readable name of the application for display purposes

Returns:

  • (String)


24
25
26
# File 'lib/the_plaid_api/models/application.rb', line 24

def display_name
  @display_name
end

#join_dateDate

The date this application was granted production access at Plaid in [ISO 8601](wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC.

Returns:

  • (Date)


29
30
31
# File 'lib/the_plaid_api/models/application.rb', line 29

def join_date
  @join_date
end

#logo_urlString

A URL that links to the application logo image.

Returns:

  • (String)


33
34
35
# File 'lib/the_plaid_api/models/application.rb', line 33

def logo_url
  @logo_url
end

#nameString

The name of the application

Returns:

  • (String)


20
21
22
# File 'lib/the_plaid_api/models/application.rb', line 20

def name
  @name
end

#postal_codeString

A string representing the postal code of the client’s headquarters.

Returns:

  • (String)


62
63
64
# File 'lib/the_plaid_api/models/application.rb', line 62

def postal_code
  @postal_code
end

#reason_for_accessString

A string provided by the connected app stating why they use their respective enabled products.

Returns:

  • (String)


42
43
44
# File 'lib/the_plaid_api/models/application.rb', line 42

def reason_for_access
  @reason_for_access
end

#regionString

A string representing the region of the client’s headquarters.

Returns:

  • (String)


58
59
60
# File 'lib/the_plaid_api/models/application.rb', line 58

def region
  @region
end

#use_caseString

A string representing client’s broad use case as assessed by Plaid.

Returns:

  • (String)


46
47
48
# File 'lib/the_plaid_api/models/application.rb', line 46

def use_case
  @use_case
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/the_plaid_api/models/application.rb', line 132

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  application_id =
    hash.key?('application_id') ? hash['application_id'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  display_name = hash.key?('display_name') ? hash['display_name'] : nil
  join_date = hash.key?('join_date') ? hash['join_date'] : nil
  logo_url = hash.key?('logo_url') ? hash['logo_url'] : nil
  application_url =
    hash.key?('application_url') ? hash['application_url'] : nil
  reason_for_access =
    hash.key?('reason_for_access') ? hash['reason_for_access'] : nil
  use_case = hash.key?('use_case') ? hash['use_case'] : nil
  company_legal_name =
    hash.key?('company_legal_name') ? hash['company_legal_name'] : nil
  city = hash.key?('city') ? hash['city'] : nil
  region = hash.key?('region') ? hash['region'] : nil
  postal_code = hash.key?('postal_code') ? hash['postal_code'] : nil
  country_code = hash.key?('country_code') ? hash['country_code'] : 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.
  Application.new(application_id: application_id,
                  name: name,
                  display_name: display_name,
                  join_date: join_date,
                  logo_url: logo_url,
                  application_url: application_url,
                  reason_for_access: reason_for_access,
                  use_case: use_case,
                  company_legal_name: company_legal_name,
                  city: city,
                  region: region,
                  postal_code: postal_code,
                  country_code: country_code,
                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['application_id'] = 'application_id'
  @_hash['name'] = 'name'
  @_hash['display_name'] = 'display_name'
  @_hash['join_date'] = 'join_date'
  @_hash['logo_url'] = 'logo_url'
  @_hash['application_url'] = 'application_url'
  @_hash['reason_for_access'] = 'reason_for_access'
  @_hash['use_case'] = 'use_case'
  @_hash['company_legal_name'] = 'company_legal_name'
  @_hash['city'] = 'city'
  @_hash['region'] = 'region'
  @_hash['postal_code'] = 'postal_code'
  @_hash['country_code'] = 'country_code'
  @_hash
end

.nullablesObject

An array for nullable fields



93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/the_plaid_api/models/application.rb', line 93

def self.nullables
  %w[
    display_name
    logo_url
    application_url
    reason_for_access
    use_case
    company_legal_name
    city
    region
    postal_code
    country_code
  ]
end

.optionalsObject

An array for optional fields



88
89
90
# File 'lib/the_plaid_api/models/application.rb', line 88

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



190
191
192
193
194
195
196
197
198
199
# File 'lib/the_plaid_api/models/application.rb', line 190

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} application_id: #{@application_id.inspect}, name: #{@name.inspect},"\
  " display_name: #{@display_name.inspect}, join_date: #{@join_date.inspect}, logo_url:"\
  " #{@logo_url.inspect}, application_url: #{@application_url.inspect}, reason_for_access:"\
  " #{@reason_for_access.inspect}, use_case: #{@use_case.inspect}, company_legal_name:"\
  " #{@company_legal_name.inspect}, city: #{@city.inspect}, region: #{@region.inspect},"\
  " postal_code: #{@postal_code.inspect}, country_code: #{@country_code.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



179
180
181
182
183
184
185
186
187
# File 'lib/the_plaid_api/models/application.rb', line 179

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} application_id: #{@application_id}, name: #{@name}, display_name:"\
  " #{@display_name}, join_date: #{@join_date}, logo_url: #{@logo_url}, application_url:"\
  " #{@application_url}, reason_for_access: #{@reason_for_access}, use_case: #{@use_case},"\
  " company_legal_name: #{@company_legal_name}, city: #{@city}, region: #{@region},"\
  " postal_code: #{@postal_code}, country_code: #{@country_code}, additional_properties:"\
  " #{@additional_properties}>"
end