Class: ThePlaidApi::CraVoaReport
- Defined in:
- lib/the_plaid_api/models/cra_voa_report.rb
Overview
An object representing a VOA report.
Instance Attribute Summary collapse
-
#attributes ⇒ CraVoaReportAttributes
Attributes for the VOA report.
-
#days_requested ⇒ Float
The number of days of transaction history that the VOA report covers.
-
#generated_time ⇒ DateTime
The date and time when the VOA Report was created, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (e.g. ā2018-04-12T03:32:11Zā).
-
#items ⇒ Array[CraVoaReportItem]
Data returned by Plaid about each of the Items included in the Base Report.
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(generated_time:, days_requested:, items:, attributes:, additional_properties: nil) ⇒ CraVoaReport
constructor
A new instance of CraVoaReport.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_generated_time ⇒ Object
-
#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(generated_time:, days_requested:, items:, attributes:, additional_properties: nil) ⇒ CraVoaReport
Returns a new instance of CraVoaReport.
52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 52 def initialize(generated_time:, days_requested:, items:, attributes:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @generated_time = generated_time @days_requested = days_requested @items = items @attributes = attributes @additional_properties = additional_properties end |
Instance Attribute Details
#attributes ⇒ CraVoaReportAttributes
Attributes for the VOA report.
30 31 32 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 30 def attributes @attributes end |
#days_requested ⇒ Float
The number of days of transaction history that the VOA report covers.
21 22 23 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 21 def days_requested @days_requested end |
#generated_time ⇒ DateTime
The date and time when the VOA Report was created, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (e.g. ā2018-04-12T03:32:11Zā).
17 18 19 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 17 def generated_time @generated_time end |
#items ⇒ Array[CraVoaReportItem]
Data returned by Plaid about each of the Items included in the Base Report.
26 27 28 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 26 def items @items 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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. generated_time = if hash.key?('generated_time') (DateTimeHelper.from_rfc3339(hash['generated_time']) if hash['generated_time']) end days_requested = hash.key?('days_requested') ? hash['days_requested'] : nil # Parameter is an array, so we need to iterate through it items = nil unless hash['items'].nil? items = [] hash['items'].each do |structure| items << (CraVoaReportItem.from_hash(structure) if structure) end end items = nil unless hash.key?('items') attributes = CraVoaReportAttributes.from_hash(hash['attributes']) if hash['attributes'] # 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. CraVoaReport.new(generated_time: generated_time, days_requested: days_requested, items: items, attributes: attributes, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['generated_time'] = 'generated_time' @_hash['days_requested'] = 'days_requested' @_hash['items'] = 'items' @_hash['attributes'] = 'attributes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
48 49 50 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 48 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
43 44 45 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 43 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
114 115 116 117 118 119 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 114 def inspect class_name = self.class.name.split('::').last "<#{class_name} generated_time: #{@generated_time.inspect}, days_requested:"\ " #{@days_requested.inspect}, items: #{@items.inspect}, attributes: #{@attributes.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_generated_time ⇒ Object
101 102 103 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 101 def to_custom_generated_time DateTimeHelper.to_rfc3339(generated_time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
106 107 108 109 110 111 |
# File 'lib/the_plaid_api/models/cra_voa_report.rb', line 106 def to_s class_name = self.class.name.split('::').last "<#{class_name} generated_time: #{@generated_time}, days_requested: #{@days_requested},"\ " items: #{@items}, attributes: #{@attributes}, additional_properties:"\ " #{@additional_properties}>" end |