Class: ThePlaidApi::CraCheckReportIncomeInsightsGetOptions

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

Overview

Defines configuration options to generate Income Insights.

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(income_insights_filter: SKIP, additional_properties: nil) ⇒ CraCheckReportIncomeInsightsGetOptions

Returns a new instance of CraCheckReportIncomeInsightsGetOptions.



58
59
60
61
62
63
64
65
# File 'lib/the_plaid_api/models/cra_check_report_income_insights_get_options.rb', line 58

def initialize(income_insights_filter: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @income_insights_filter = income_insights_filter unless income_insights_filter == SKIP
  @income_insights_version = 'II2'
  @additional_properties = additional_properties
end

Instance Attribute Details

#income_insights_filterIncomeInsightsFilter

Filters the returned income streams based on the specified income categories. If no filters are requested, streams from the following default set of categories are returned:

  • ‘EARNED_INCOME.*` (`EARNED_INCOME.SALARY`, `EARNED_INCOME.GIG_ECONOMY`,

‘EARNED_INCOME.SELF_EMPLOYED`)

  • ‘BENEFITS.DISABILITY`

  • ‘RETIREMENT.*` (`RETIREMENT.GOVERNMENT_DERIVED`,

‘RETIREMENT.PRIVATE_RETIREMENT`, `RETIREMENT.PLAN_DISTRIBUTION`) The final list of income categories is generated by adding the `included_categories`, then removing the `excluded_categories`. Priority is given to `excluded_categories` in the case of collisions. Filter patterns supported:

  • ‘*`: All categories

  • ‘PRIMARY.*`: All categories within the specified primary category

  • ‘PRIMARY.SECONDARY`: A specific income category

For a list of income categories, see the [Income V2 Category Taxonomy](plaid.com/documents/income-v2-category-taxonomy.csv).



30
31
32
# File 'lib/the_plaid_api/models/cra_check_report_income_insights_get_options.rb', line 30

def income_insights_filter
  @income_insights_filter
end

#income_insights_versionString (readonly)

The version of Income Insights to use.

Returns:

  • (String)


34
35
36
# File 'lib/the_plaid_api/models/cra_check_report_income_insights_get_options.rb', line 34

def income_insights_version
  @income_insights_version
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  income_insights_filter = IncomeInsightsFilter.from_hash(hash['income_insights_filter']) if
    hash['income_insights_filter']

  # 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.
  CraCheckReportIncomeInsightsGetOptions.new(income_insights_filter: income_insights_filter,
                                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['income_insights_filter'] = 'income_insights_filter'
  @_hash['income_insights_version'] = 'income_insights_version'
  @_hash
end

.nullablesObject

An array for nullable fields



52
53
54
55
56
# File 'lib/the_plaid_api/models/cra_check_report_income_insights_get_options.rb', line 52

def self.nullables
  %w[
    income_insights_filter
  ]
end

.optionalsObject

An array for optional fields



45
46
47
48
49
# File 'lib/the_plaid_api/models/cra_check_report_income_insights_get_options.rb', line 45

def self.optionals
  %w[
    income_insights_filter
  ]
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/cra_check_report_income_insights_get_options.rb', line 96

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

#to_sObject

Provides a human-readable string representation of the object.



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

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