Class: ThePlaidApi::AccountProductAccess

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

Overview

Allow the application to access specific products on this account

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(account_data: true, statements: true, tax_documents: true, additional_properties: nil) ⇒ AccountProductAccess

Returns a new instance of AccountProductAccess.



54
55
56
57
58
59
60
61
62
63
# File 'lib/the_plaid_api/models/account_product_access.rb', line 54

def initialize(account_data: true, statements: true, tax_documents: true,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_data =  unless  == SKIP
  @statements = statements unless statements == SKIP
  @tax_documents = tax_documents unless tax_documents == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_dataTrueClass | FalseClass

Allow the application to access account data. Only used by certain partners. If relevant to the partner and unset, defaults to ‘true`.

Returns:

  • (TrueClass | FalseClass)


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

def 
  @account_data
end

#statementsTrueClass | FalseClass

Allow the application to access bank statements. Only used by certain partners. If relevant to the partner and unset, defaults to ‘true`.

Returns:

  • (TrueClass | FalseClass)


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

def statements
  @statements
end

#tax_documentsTrueClass | FalseClass

Allow the application to access tax documents. Only used by certain partners. If relevant to the partner and unset, defaults to ‘true`.

Returns:

  • (TrueClass | FalseClass)


25
26
27
# File 'lib/the_plaid_api/models/account_product_access.rb', line 25

def tax_documents
  @tax_documents
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash['account_data'] ||= true
  statements = hash['statements'] ||= true
  tax_documents = hash['tax_documents'] ||= true

  # 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.
  AccountProductAccess.new(account_data: ,
                           statements: statements,
                           tax_documents: tax_documents,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



28
29
30
31
32
33
34
# File 'lib/the_plaid_api/models/account_product_access.rb', line 28

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_data'] = 'account_data'
  @_hash['statements'] = 'statements'
  @_hash['tax_documents'] = 'tax_documents'
  @_hash
end

.nullablesObject

An array for nullable fields



46
47
48
49
50
51
52
# File 'lib/the_plaid_api/models/account_product_access.rb', line 46

def self.nullables
  %w[
    account_data
    statements
    tax_documents
  ]
end

.optionalsObject

An array for optional fields



37
38
39
40
41
42
43
# File 'lib/the_plaid_api/models/account_product_access.rb', line 37

def self.optionals
  %w[
    account_data
    statements
    tax_documents
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



96
97
98
99
100
101
# File 'lib/the_plaid_api/models/account_product_access.rb', line 96

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_data: #{@account_data.inspect}, statements: #{@statements.inspect},"\
  " tax_documents: #{@tax_documents.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



89
90
91
92
93
# File 'lib/the_plaid_api/models/account_product_access.rb', line 89

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_data: #{@account_data}, statements: #{@statements}, tax_documents:"\
  " #{@tax_documents}, additional_properties: #{@additional_properties}>"
end