Class: Plaid::ConnectedApplication
- Defined in:
- lib/plaid/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/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 ⇒ String
A URL that links to the application logo image (will be deprecated in the future, please use logo_url).
-
#logo_url ⇒ String
A URL that links to the application logo image.
-
#name ⇒ String
The name of the application.
-
#product_data_types ⇒ Array[ProductDataType]
(Deprecated) A list of enums representing the data collected and products enabled for this connected application.
-
#reason_for_access ⇒ String
A string provided by the connected app stating why they use their respective enabled products.
-
#requested_scopes ⇒ RequestedScopes
Scope of required and optional account features or content from a ConnectedApplication.
-
#scopes ⇒ ScopesNullable
(Deprecated) A list of enums representing the data collected and products enabled for this connected application.
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:, logo:, logo_url:, application_url:, reason_for_access:, created_at:, product_data_types:, scopes: SKIP, requested_scopes: SKIP, additional_properties: nil) ⇒ ConnectedApplication
constructor
A new instance of ConnectedApplication.
-
#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:, logo:, logo_url:, application_url:, reason_for_access:, created_at:, product_data_types:, scopes: SKIP, requested_scopes: SKIP, additional_properties: nil) ⇒ ConnectedApplication
Returns a new instance of ConnectedApplication.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/plaid/models/connected_application.rb', line 94 def initialize(application_id:, name:, logo:, logo_url:, application_url:, reason_for_access:, created_at:, product_data_types:, scopes: SKIP, requested_scopes: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @application_id = application_id @name = name @logo = logo @logo_url = logo_url @application_url = application_url @reason_for_access = reason_for_access @created_at = created_at @product_data_types = product_data_types @scopes = scopes unless scopes == SKIP @requested_scopes = requested_scopes unless requested_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/applications/list, or provided to the institution in an oauth redirect.
16 17 18 |
# File 'lib/plaid/models/connected_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/connected_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.
43 44 45 |
# File 'lib/plaid/models/connected_application.rb', line 43 def created_at @created_at end |
#logo ⇒ String
A URL that links to the application logo image (will be deprecated in the future, please use logo_url).
25 26 27 |
# File 'lib/plaid/models/connected_application.rb', line 25 def logo @logo end |
#logo_url ⇒ String
A URL that links to the application logo image.
29 30 31 |
# File 'lib/plaid/models/connected_application.rb', line 29 def logo_url @logo_url end |
#name ⇒ String
The name of the application
20 21 22 |
# File 'lib/plaid/models/connected_application.rb', line 20 def name @name end |
#product_data_types ⇒ Array[ProductDataType]
(Deprecated) A list of enums representing the data collected and products enabled for this connected application.
48 49 50 |
# File 'lib/plaid/models/connected_application.rb', line 48 def product_data_types @product_data_types 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/connected_application.rb', line 38 def reason_for_access @reason_for_access end |
#requested_scopes ⇒ RequestedScopes
Scope of required and optional account features or content from a ConnectedApplication.
58 59 60 |
# File 'lib/plaid/models/connected_application.rb', line 58 def requested_scopes @requested_scopes end |
#scopes ⇒ ScopesNullable
(Deprecated) A list of enums representing the data collected and products enabled for this connected application.
53 54 55 |
# File 'lib/plaid/models/connected_application.rb', line 53 def scopes @scopes end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/plaid/models/connected_application.rb', line 115 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 logo = hash.key?('logo') ? hash['logo'] : 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 created_at = hash.key?('created_at') ? hash['created_at'] : nil product_data_types = hash.key?('product_data_types') ? hash['product_data_types'] : nil scopes = ScopesNullable.from_hash(hash['scopes']) if hash['scopes'] requested_scopes = RequestedScopes.from_hash(hash['requested_scopes']) if hash['requested_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, logo: logo, logo_url: logo_url, application_url: application_url, reason_for_access: reason_for_access, created_at: created_at, product_data_types: product_data_types, scopes: scopes, requested_scopes: requested_scopes, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/plaid/models/connected_application.rb', line 61 def self.names @_hash = {} if @_hash.nil? @_hash['application_id'] = 'application_id' @_hash['name'] = 'name' @_hash['logo'] = 'logo' @_hash['logo_url'] = 'logo_url' @_hash['application_url'] = 'application_url' @_hash['reason_for_access'] = 'reason_for_access' @_hash['created_at'] = 'created_at' @_hash['product_data_types'] = 'product_data_types' @_hash['scopes'] = 'scopes' @_hash['requested_scopes'] = 'requested_scopes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 88 89 90 91 92 |
# File 'lib/plaid/models/connected_application.rb', line 85 def self.nullables %w[ logo logo_url application_url reason_for_access ] end |
.optionals ⇒ Object
An array for optional fields
77 78 79 80 81 82 |
# File 'lib/plaid/models/connected_application.rb', line 77 def self.optionals %w[ scopes requested_scopes ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
167 168 169 170 171 172 173 174 175 |
# File 'lib/plaid/models/connected_application.rb', line 167 def inspect class_name = self.class.name.split('::').last "<#{class_name} application_id: #{@application_id.inspect}, name: #{@name.inspect}, logo:"\ " #{@logo.inspect}, logo_url: #{@logo_url.inspect}, application_url:"\ " #{@application_url.inspect}, reason_for_access: #{@reason_for_access.inspect}, created_at:"\ " #{@created_at.inspect}, product_data_types: #{@product_data_types.inspect}, scopes:"\ " #{@scopes.inspect}, requested_scopes: #{@requested_scopes.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
157 158 159 160 161 162 163 164 |
# File 'lib/plaid/models/connected_application.rb', line 157 def to_s class_name = self.class.name.split('::').last "<#{class_name} application_id: #{@application_id}, name: #{@name}, logo: #{@logo},"\ " logo_url: #{@logo_url}, application_url: #{@application_url}, reason_for_access:"\ " #{@reason_for_access}, created_at: #{@created_at}, product_data_types:"\ " #{@product_data_types}, scopes: #{@scopes}, requested_scopes: #{@requested_scopes},"\ " additional_properties: #{@additional_properties}>" end |