Class: Plaid::Application
- Defined in:
- lib/plaid/models/application.rb
Overview
Metadata about the application
Instance Attribute Summary collapse
-
#application_id ⇒ String
This field will map to the application ID that is returned from /item/applications/list, or provided to the institution in an oauth redirect.
-
#application_url ⇒ String
The URL for the application’s website.
-
#created_at ⇒ Date
The date this application was linked in [ISO 8601](wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC.
-
#logo_url ⇒ String
A URL that links to the application logo image.
-
#name ⇒ String
The name of the application.
-
#reason_for_access ⇒ String
A string provided by the connected app stating why they use their respective enabled products.
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(application_id:, name:, created_at:, logo_url:, application_url:, reason_for_access:, additional_properties: nil) ⇒ Application
constructor
A new instance of Application.
-
#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(application_id:, name:, created_at:, logo_url:, application_url:, reason_for_access:, additional_properties: nil) ⇒ Application
Returns a new instance of Application.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/plaid/models/application.rb', line 66 def initialize(application_id:, name:, created_at:, logo_url:, application_url:, reason_for_access:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @application_id = application_id @name = name @created_at = created_at @logo_url = logo_url @application_url = application_url @reason_for_access = reason_for_access @additional_properties = additional_properties end |
Instance Attribute Details
#application_id ⇒ String
This field will map to the application ID that is returned from /item/applications/list, or provided to the institution in an oauth redirect.
16 17 18 |
# File 'lib/plaid/models/application.rb', line 16 def application_id @application_id end |
#application_url ⇒ String
The URL for the application’s website
33 34 35 |
# File 'lib/plaid/models/application.rb', line 33 def application_url @application_url end |
#created_at ⇒ Date
The date this application was linked in [ISO 8601](wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC.
25 26 27 |
# File 'lib/plaid/models/application.rb', line 25 def created_at @created_at end |
#logo_url ⇒ String
A URL that links to the application logo image.
29 30 31 |
# File 'lib/plaid/models/application.rb', line 29 def logo_url @logo_url end |
#name ⇒ String
The name of the application
20 21 22 |
# File 'lib/plaid/models/application.rb', line 20 def name @name end |
#reason_for_access ⇒ String
A string provided by the connected app stating why they use their respective enabled products.
38 39 40 |
# File 'lib/plaid/models/application.rb', line 38 def reason_for_access @reason_for_access end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
82 83 84 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 |
# File 'lib/plaid/models/application.rb', line 82 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 created_at = hash.key?('created_at') ? hash['created_at'] : 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 # 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, created_at: created_at, logo_url: logo_url, application_url: application_url, reason_for_access: reason_for_access, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/plaid/models/application.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['application_id'] = 'application_id' @_hash['name'] = 'name' @_hash['created_at'] = 'created_at' @_hash['logo_url'] = 'logo_url' @_hash['application_url'] = 'application_url' @_hash['reason_for_access'] = 'reason_for_access' @_hash end |
.nullables ⇒ Object
An array for nullable fields
58 59 60 61 62 63 64 |
# File 'lib/plaid/models/application.rb', line 58 def self.nullables %w[ logo_url application_url reason_for_access ] end |
.optionals ⇒ Object
An array for optional fields
53 54 55 |
# File 'lib/plaid/models/application.rb', line 53 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
123 124 125 126 127 128 129 |
# File 'lib/plaid/models/application.rb', line 123 def inspect class_name = self.class.name.split('::').last "<#{class_name} application_id: #{@application_id.inspect}, name: #{@name.inspect},"\ " created_at: #{@created_at.inspect}, logo_url: #{@logo_url.inspect}, application_url:"\ " #{@application_url.inspect}, reason_for_access: #{@reason_for_access.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
114 115 116 117 118 119 120 |
# File 'lib/plaid/models/application.rb', line 114 def to_s class_name = self.class.name.split('::').last "<#{class_name} application_id: #{@application_id}, name: #{@name}, created_at:"\ " #{@created_at}, logo_url: #{@logo_url}, application_url: #{@application_url},"\ " reason_for_access: #{@reason_for_access}, additional_properties:"\ " #{@additional_properties}>" end |