Class: ThePlaidApi::CraBankIncomeWarning

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

Overview

The warning associated with the data that was unavailable.

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(warning_type: SKIP, warning_code: SKIP, cause: SKIP, additional_properties: nil) ⇒ CraBankIncomeWarning

Returns a new instance of CraBankIncomeWarning.



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

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

  @warning_type = warning_type unless warning_type == SKIP
  @warning_code = warning_code unless warning_code == SKIP
  @cause = cause unless cause == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#causeCraBankIncomeCause

An error object and associated ‘item_id` used to identify a specific Item and error when a batch operation operating on multiple Items has encountered an error in one of the Items.

Returns:



28
29
30
# File 'lib/the_plaid_api/models/cra_bank_income_warning.rb', line 28

def cause
  @cause
end

#warning_codeCraBankIncomeWarningCode

The warning code identifies a specific kind of warning. ‘IDENTITY_UNAVAILABLE`: Unable to extract identity for the Item `TRANSACTIONS_UNAVAILABLE`: Unable to extract transactions for the Item `REPORT_DELETED`: Report deleted due to customer or consumer request `DATA_UNAVAILABLE`: No relevant data was found for the Item



22
23
24
# File 'lib/the_plaid_api/models/cra_bank_income_warning.rb', line 22

def warning_code
  @warning_code
end

#warning_typeCreditBankIncomeWarningType

The warning type which will always be ‘BANK_INCOME_WARNING`.



14
15
16
# File 'lib/the_plaid_api/models/cra_bank_income_warning.rb', line 14

def warning_type
  @warning_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



65
66
67
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_bank_income_warning.rb', line 65

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  warning_type = hash.key?('warning_type') ? hash['warning_type'] : SKIP
  warning_code = hash.key?('warning_code') ? hash['warning_code'] : SKIP
  cause = CraBankIncomeCause.from_hash(hash['cause']) if hash['cause']

  # 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.
  CraBankIncomeWarning.new(warning_type: warning_type,
                           warning_code: warning_code,
                           cause: cause,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



31
32
33
34
35
36
37
# File 'lib/the_plaid_api/models/cra_bank_income_warning.rb', line 31

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['warning_type'] = 'warning_type'
  @_hash['warning_code'] = 'warning_code'
  @_hash['cause'] = 'cause'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/the_plaid_api/models/cra_bank_income_warning.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
# File 'lib/the_plaid_api/models/cra_bank_income_warning.rb', line 40

def self.optionals
  %w[
    warning_type
    warning_code
    cause
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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

#to_sObject

Provides a human-readable string representation of the object.



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

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