Class: ThePlaidApi::ConnectedApplication
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::ConnectedApplication
- Defined in:
- lib/the_plaid_api/models/connected_application.rb
Overview
Describes the connected application for a particular end user.
Instance Attribute Summary collapse
-
#application_id ⇒ String
This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect.
-
#application_url ⇒ String
The URL for the application’s website.
-
#created_at ⇒ DateTime
The date this application was linked in [ISO 8601](wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC.
-
#display_name ⇒ String
A human-readable name of the application for display purposes.
-
#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.
-
#scopes ⇒ ScopesNullable
The scopes object.
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:, display_name: SKIP, logo_url: SKIP, application_url: SKIP, reason_for_access: SKIP, scopes: SKIP, additional_properties: nil) ⇒ ConnectedApplication
constructor
A new instance of ConnectedApplication.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
-
#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:, display_name: SKIP, logo_url: SKIP, application_url: SKIP, reason_for_access: SKIP, scopes: SKIP, additional_properties: nil) ⇒ ConnectedApplication
Returns a new instance of ConnectedApplication.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 85 def initialize(application_id:, name:, created_at:, display_name: SKIP, logo_url: SKIP, application_url: SKIP, reason_for_access: SKIP, scopes: SKIP, 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 unless display_name == SKIP @logo_url = logo_url unless logo_url == SKIP @application_url = application_url unless application_url == SKIP @reason_for_access = reason_for_access unless reason_for_access == SKIP @created_at = created_at @scopes = scopes unless scopes == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#application_id ⇒ String
This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect.
17 18 19 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 17 def application_id @application_id end |
#application_url ⇒ String
The URL for the application’s website
33 34 35 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 33 def application_url @application_url end |
#created_at ⇒ DateTime
The date this application was linked in [ISO 8601](wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC.
43 44 45 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 43 def created_at @created_at end |
#display_name ⇒ String
A human-readable name of the application for display purposes
25 26 27 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 25 def display_name @display_name end |
#logo_url ⇒ String
A URL that links to the application logo image.
29 30 31 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 29 def logo_url @logo_url end |
#name ⇒ String
The name of the application
21 22 23 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 21 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/the_plaid_api/models/connected_application.rb', line 38 def reason_for_access @reason_for_access end |
#scopes ⇒ ScopesNullable
The scopes object
47 48 49 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 47 def scopes @scopes end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 104 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 = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) end display_name = hash.key?('display_name') ? hash['display_name'] : SKIP logo_url = hash.key?('logo_url') ? hash['logo_url'] : SKIP application_url = hash.key?('application_url') ? hash['application_url'] : SKIP reason_for_access = hash.key?('reason_for_access') ? hash['reason_for_access'] : SKIP scopes = ScopesNullable.from_hash(hash['scopes']) if hash['scopes'] # 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. ConnectedApplication.new(application_id: application_id, name: name, created_at: created_at, display_name: display_name, logo_url: logo_url, application_url: application_url, reason_for_access: reason_for_access, scopes: scopes, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 50 def self.names @_hash = {} if @_hash.nil? @_hash['application_id'] = 'application_id' @_hash['name'] = 'name' @_hash['display_name'] = 'display_name' @_hash['logo_url'] = 'logo_url' @_hash['application_url'] = 'application_url' @_hash['reason_for_access'] = 'reason_for_access' @_hash['created_at'] = 'created_at' @_hash['scopes'] = 'scopes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
75 76 77 78 79 80 81 82 83 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 75 def self.nullables %w[ display_name logo_url application_url reason_for_access scopes ] end |
.optionals ⇒ Object
An array for optional fields
64 65 66 67 68 69 70 71 72 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 64 def self.optionals %w[ display_name logo_url application_url reason_for_access scopes ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
155 156 157 158 159 160 161 162 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 155 def inspect class_name = self.class.name.split('::').last "<#{class_name} application_id: #{@application_id.inspect}, name: #{@name.inspect},"\ " display_name: #{@display_name.inspect}, logo_url: #{@logo_url.inspect}, application_url:"\ " #{@application_url.inspect}, reason_for_access: #{@reason_for_access.inspect}, created_at:"\ " #{@created_at.inspect}, scopes: #{@scopes.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_created_at ⇒ Object
141 142 143 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 141 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
146 147 148 149 150 151 152 |
# File 'lib/the_plaid_api/models/connected_application.rb', line 146 def to_s class_name = self.class.name.split('::').last "<#{class_name} application_id: #{@application_id}, name: #{@name}, display_name:"\ " #{@display_name}, logo_url: #{@logo_url}, application_url: #{@application_url},"\ " reason_for_access: #{@reason_for_access}, created_at: #{@created_at}, scopes: #{@scopes},"\ " additional_properties: #{@additional_properties}>" end |