Class: ThePlaidApi::CraEmploymentRefreshReport
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::CraEmploymentRefreshReport
- Defined in:
- lib/the_plaid_api/models/cra_employment_refresh_report.rb
Overview
An object representing an Employment Refresh Report.
Instance Attribute Summary collapse
-
#days_requested ⇒ Float
The number of days of transaction history that the Employment Refresh Report covers.
-
#generated_time ⇒ DateTime
The date and time when the Employment Refresh Report was created, in ISO 8601 format (e.g. ā2018-04-12T03:32:11Zā).
-
#items ⇒ Array[CraEmploymentRefreshReportItem]
Data returned by Plaid about each of the Items included in the Employment Refresh 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:, additional_properties: nil) ⇒ CraEmploymentRefreshReport
constructor
A new instance of CraEmploymentRefreshReport.
-
#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:, additional_properties: nil) ⇒ CraEmploymentRefreshReport
Returns a new instance of CraEmploymentRefreshReport.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/the_plaid_api/models/cra_employment_refresh_report.rb', line 47 def initialize(generated_time:, days_requested:, items:, 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 @additional_properties = additional_properties end |
Instance Attribute Details
#days_requested ⇒ Float
The number of days of transaction history that the Employment Refresh Report covers.
21 22 23 |
# File 'lib/the_plaid_api/models/cra_employment_refresh_report.rb', line 21 def days_requested @days_requested end |
#generated_time ⇒ DateTime
The date and time when the Employment Refresh Report was created, in ISO 8601 format (e.g. ā2018-04-12T03:32:11Zā).
16 17 18 |
# File 'lib/the_plaid_api/models/cra_employment_refresh_report.rb', line 16 def generated_time @generated_time end |
#items ⇒ Array[CraEmploymentRefreshReportItem]
Data returned by Plaid about each of the Items included in the Employment Refresh Report.
26 27 28 |
# File 'lib/the_plaid_api/models/cra_employment_refresh_report.rb', line 26 def items @items end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
59 60 61 62 63 64 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 |
# File 'lib/the_plaid_api/models/cra_employment_refresh_report.rb', line 59 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 << (CraEmploymentRefreshReportItem.from_hash(structure) if structure) end end items = nil unless hash.key?('items') # 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. CraEmploymentRefreshReport.new(generated_time: generated_time, days_requested: days_requested, items: items, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 |
# File 'lib/the_plaid_api/models/cra_employment_refresh_report.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['generated_time'] = 'generated_time' @_hash['days_requested'] = 'days_requested' @_hash['items'] = 'items' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 |
# File 'lib/the_plaid_api/models/cra_employment_refresh_report.rb', line 43 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
38 39 40 |
# File 'lib/the_plaid_api/models/cra_employment_refresh_report.rb', line 38 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
105 106 107 108 109 110 |
# File 'lib/the_plaid_api/models/cra_employment_refresh_report.rb', line 105 def inspect class_name = self.class.name.split('::').last "<#{class_name} generated_time: #{@generated_time.inspect}, days_requested:"\ " #{@days_requested.inspect}, items: #{@items.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_generated_time ⇒ Object
93 94 95 |
# File 'lib/the_plaid_api/models/cra_employment_refresh_report.rb', line 93 def to_custom_generated_time DateTimeHelper.to_rfc3339(generated_time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
98 99 100 101 102 |
# File 'lib/the_plaid_api/models/cra_employment_refresh_report.rb', line 98 def to_s class_name = self.class.name.split('::').last "<#{class_name} generated_time: #{@generated_time}, days_requested: #{@days_requested},"\ " items: #{@items}, additional_properties: #{@additional_properties}>" end |