Class: ThePlaidApi::CreditBankEmploymentReport

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

Overview

The report of the Bank Employment data for an end user.

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(bank_employment_report_id:, generated_time:, days_requested:, items:, warnings:, additional_properties: nil) ⇒ CreditBankEmploymentReport

Returns a new instance of CreditBankEmploymentReport.



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/the_plaid_api/models/credit_bank_employment_report.rb', line 60

def initialize(bank_employment_report_id:, generated_time:, days_requested:,
               items:, warnings:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @bank_employment_report_id = bank_employment_report_id
  @generated_time = generated_time
  @days_requested = days_requested
  @items = items
  @warnings = warnings
  @additional_properties = additional_properties
end

Instance Attribute Details

#bank_employment_report_idString

The unique identifier associated with the Bank Employment Report.

Returns:

  • (String)


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

def bank_employment_report_id
  @bank_employment_report_id
end

#days_requestedInteger

The number of days requested by the customer for the Bank Employment Report.

Returns:

  • (Integer)


26
27
28
# File 'lib/the_plaid_api/models/credit_bank_employment_report.rb', line 26

def days_requested
  @days_requested
end

#generated_timeDateTime

The time when the Bank Employment Report was generated, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (e.g. ā€œ2018-04-12T03:32:11Zā€).

Returns:

  • (DateTime)


21
22
23
# File 'lib/the_plaid_api/models/credit_bank_employment_report.rb', line 21

def generated_time
  @generated_time
end

#itemsArray[CreditBankEmploymentItem]

The list of Items in the report along with the associated metadata about the Item.

Returns:



31
32
33
# File 'lib/the_plaid_api/models/credit_bank_employment_report.rb', line 31

def items
  @items
end

#warningsArray[CreditBankEmploymentWarning]

If data from the Bank Employment report was unable to be retrieved, the warnings will contain information about the error that caused the data to be incomplete.

Returns:



37
38
39
# File 'lib/the_plaid_api/models/credit_bank_employment_report.rb', line 37

def warnings
  @warnings
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/the_plaid_api/models/credit_bank_employment_report.rb', line 74

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  bank_employment_report_id =
    hash.key?('bank_employment_report_id') ? hash['bank_employment_report_id'] : nil
  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 << (CreditBankEmploymentItem.from_hash(structure) if structure)
    end
  end

  items = nil unless hash.key?('items')
  # Parameter is an array, so we need to iterate through it
  warnings = nil
  unless hash['warnings'].nil?
    warnings = []
    hash['warnings'].each do |structure|
      warnings << (CreditBankEmploymentWarning.from_hash(structure) if structure)
    end
  end

  warnings = nil unless hash.key?('warnings')

  # 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.
  CreditBankEmploymentReport.new(bank_employment_report_id: bank_employment_report_id,
                                 generated_time: generated_time,
                                 days_requested: days_requested,
                                 items: items,
                                 warnings: warnings,
                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['bank_employment_report_id'] = 'bank_employment_report_id'
  @_hash['generated_time'] = 'generated_time'
  @_hash['days_requested'] = 'days_requested'
  @_hash['items'] = 'items'
  @_hash['warnings'] = 'warnings'
  @_hash
end

.nullablesObject

An array for nullable fields



56
57
58
# File 'lib/the_plaid_api/models/credit_bank_employment_report.rb', line 56

def self.nullables
  []
end

.optionalsObject

An array for optional fields



51
52
53
# File 'lib/the_plaid_api/models/credit_bank_employment_report.rb', line 51

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



135
136
137
138
139
140
141
# File 'lib/the_plaid_api/models/credit_bank_employment_report.rb', line 135

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} bank_employment_report_id: #{@bank_employment_report_id.inspect},"\
  " generated_time: #{@generated_time.inspect}, days_requested: #{@days_requested.inspect},"\
  " items: #{@items.inspect}, warnings: #{@warnings.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_generated_timeObject



122
123
124
# File 'lib/the_plaid_api/models/credit_bank_employment_report.rb', line 122

def to_custom_generated_time
  DateTimeHelper.to_rfc3339(generated_time)
end

#to_sObject

Provides a human-readable string representation of the object.



127
128
129
130
131
132
# File 'lib/the_plaid_api/models/credit_bank_employment_report.rb', line 127

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} bank_employment_report_id: #{@bank_employment_report_id}, generated_time:"\
  " #{@generated_time}, days_requested: #{@days_requested}, items: #{@items}, warnings:"\
  " #{@warnings}, additional_properties: #{@additional_properties}>"
end