Class: ThePlaidApi::BaseReportWarning
- Defined in:
- lib/the_plaid_api/models/base_report_warning.rb
Overview
It is possible for a Base Report to be returned with missing account owner information. In such cases, the Base Report will contain warning data in the response, indicating why obtaining the owner information failed.
Instance Attribute Summary collapse
-
#cause ⇒ Cause
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.
-
#warning_code ⇒ BaseReportWarningCode
The warning code identifies a specific kind of warning.
-
#warning_type ⇒ String
The warning type, which will always be ‘BASE_REPORT_WARNING`.
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(warning_type:, warning_code:, cause:, additional_properties: nil) ⇒ BaseReportWarning
constructor
A new instance of BaseReportWarning.
-
#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(warning_type:, warning_code:, cause:, additional_properties: nil) ⇒ BaseReportWarning
Returns a new instance of BaseReportWarning.
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/the_plaid_api/models/base_report_warning.rb', line 56 def initialize(warning_type:, warning_code:, cause:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @warning_type = warning_type @warning_code = warning_code @cause = cause @additional_properties = additional_properties end |
Instance Attribute Details
#cause ⇒ Cause
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.
33 34 35 |
# File 'lib/the_plaid_api/models/base_report_warning.rb', line 33 def cause @cause end |
#warning_code ⇒ BaseReportWarningCode
The warning code identifies a specific kind of warning. ‘IDENTITY_UNAVAILABLE`: Account-owner information is not available. `TRANSACTIONS_UNAVAILABLE`: Transactions information associated with Credit and Depository accounts are unavailable. `USER_FRAUD_ALERT`: The User has placed a fraud alert on their Plaid Check consumer report due to suspected fraud. Note: when a fraud alert is in place, the recipient of the consumer report has an obligation to verify the consumer’s identity.
27 28 29 |
# File 'lib/the_plaid_api/models/base_report_warning.rb', line 27 def warning_code @warning_code end |
#warning_type ⇒ String
The warning type, which will always be ‘BASE_REPORT_WARNING`
16 17 18 |
# File 'lib/the_plaid_api/models/base_report_warning.rb', line 16 def warning_type @warning_type 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 86 87 88 |
# File 'lib/the_plaid_api/models/base_report_warning.rb', line 68 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. warning_type = hash.key?('warning_type') ? hash['warning_type'] : nil warning_code = hash.key?('warning_code') ? hash['warning_code'] : nil cause = Cause.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. BaseReportWarning.new(warning_type: warning_type, warning_code: warning_code, cause: cause, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
36 37 38 39 40 41 42 |
# File 'lib/the_plaid_api/models/base_report_warning.rb', line 36 def self.names @_hash = {} if @_hash.nil? @_hash['warning_type'] = 'warning_type' @_hash['warning_code'] = 'warning_code' @_hash['cause'] = 'cause' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 53 54 |
# File 'lib/the_plaid_api/models/base_report_warning.rb', line 50 def self.nullables %w[ cause ] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 |
# File 'lib/the_plaid_api/models/base_report_warning.rb', line 45 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
98 99 100 101 102 103 |
# File 'lib/the_plaid_api/models/base_report_warning.rb', line 98 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_s ⇒ Object
Provides a human-readable string representation of the object.
91 92 93 94 95 |
# File 'lib/the_plaid_api/models/base_report_warning.rb', line 91 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 |