Class: FdxV660Api::PayrollReportEntity
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::PayrollReportEntity
- Defined in:
- lib/fdx_v660_api/models/payroll_report_entity.rb
Overview
An employee's Payroll Report
Instance Attribute Summary collapse
-
#data_as_of ⇒ Date
The data in the report is as of this date.
-
#employee ⇒ EmployeeEntity1
The employee.
-
#employment ⇒ Employment1
The employee's employment.
-
#generation_date ⇒ Date
The generation date of the report.
-
#incomes ⇒ Array[Income]
The employee's year to date income amounts for current and previous years omitted for Verification of Employment requests (VOE), included for Verification of Income and Employment requests (VOI / VOIE).
-
#links ⇒ Array[HateoasLink]
Links to retrieve this payroll report, or to invoke related APIs.
-
#report_id ⇒ String
The report identification number.
-
#report_type ⇒ PayrollReportType1
The type of 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(report_id:, report_type:, generation_date:, employee:, employment:, data_as_of: SKIP, incomes: SKIP, links: SKIP, additional_properties: nil) ⇒ PayrollReportEntity
constructor
A new instance of PayrollReportEntity.
-
#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(report_id:, report_type:, generation_date:, employee:, employment:, data_as_of: SKIP, incomes: SKIP, links: SKIP, additional_properties: nil) ⇒ PayrollReportEntity
Returns a new instance of PayrollReportEntity.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 74 def initialize(report_id:, report_type:, generation_date:, employee:, employment:, data_as_of: SKIP, incomes: SKIP, links: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @report_id = report_id @report_type = report_type @generation_date = generation_date @data_as_of = data_as_of unless data_as_of == SKIP @employee = employee @employment = employment @incomes = incomes unless incomes == SKIP @links = links unless links == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#data_as_of ⇒ Date
The data in the report is as of this date
26 27 28 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 26 def data_as_of @data_as_of end |
#employee ⇒ EmployeeEntity1
The employee
30 31 32 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 30 def employee @employee end |
#employment ⇒ Employment1
The employee's employment
34 35 36 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 34 def employment @employment end |
#generation_date ⇒ Date
The generation date of the report
22 23 24 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 22 def generation_date @generation_date end |
#incomes ⇒ Array[Income]
The employee's year to date income amounts for current and previous years omitted for Verification of Employment requests (VOE), included for Verification of Income and Employment requests (VOI / VOIE)
40 41 42 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 40 def incomes @incomes end |
#links ⇒ Array[HateoasLink]
Links to retrieve this payroll report, or to invoke related APIs
44 45 46 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 44 def links @links end |
#report_id ⇒ String
The report identification number
14 15 16 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 14 def report_id @report_id end |
#report_type ⇒ PayrollReportType1
The type of report
18 19 20 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 18 def report_type @report_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 92 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. report_id = hash.key?('reportId') ? hash['reportId'] : nil report_type = hash.key?('reportType') ? hash['reportType'] : nil generation_date = hash.key?('generationDate') ? hash['generationDate'] : nil employee = EmployeeEntity1.from_hash(hash['employee']) if hash['employee'] employment = Employment1.from_hash(hash['employment']) if hash['employment'] data_as_of = hash.key?('dataAsOf') ? hash['dataAsOf'] : SKIP # Parameter is an array, so we need to iterate through it incomes = nil unless hash['incomes'].nil? incomes = [] hash['incomes'].each do |structure| incomes << (Income.from_hash(structure) if structure) end end incomes = SKIP unless hash.key?('incomes') # Parameter is an array, so we need to iterate through it links = nil unless hash['links'].nil? links = [] hash['links'].each do |structure| links << (HateoasLink.from_hash(structure) if structure) end end links = SKIP unless hash.key?('links') # 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. PayrollReportEntity.new(report_id: report_id, report_type: report_type, generation_date: generation_date, employee: employee, employment: employment, data_as_of: data_as_of, incomes: incomes, links: links, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 47 def self.names @_hash = {} if @_hash.nil? @_hash['report_id'] = 'reportId' @_hash['report_type'] = 'reportType' @_hash['generation_date'] = 'generationDate' @_hash['data_as_of'] = 'dataAsOf' @_hash['employee'] = 'employee' @_hash['employment'] = 'employment' @_hash['incomes'] = 'incomes' @_hash['links'] = 'links' @_hash end |
.nullables ⇒ Object
An array for nullable fields
70 71 72 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 70 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
61 62 63 64 65 66 67 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 61 def self.optionals %w[ data_as_of incomes links ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
153 154 155 156 157 158 159 160 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 153 def inspect class_name = self.class.name.split('::').last "<#{class_name} report_id: #{@report_id.inspect}, report_type: #{@report_type.inspect},"\ " generation_date: #{@generation_date.inspect}, data_as_of: #{@data_as_of.inspect},"\ " employee: #{@employee.inspect}, employment: #{@employment.inspect}, incomes:"\ " #{@incomes.inspect}, links: #{@links.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
144 145 146 147 148 149 150 |
# File 'lib/fdx_v660_api/models/payroll_report_entity.rb', line 144 def to_s class_name = self.class.name.split('::').last "<#{class_name} report_id: #{@report_id}, report_type: #{@report_type}, generation_date:"\ " #{@generation_date}, data_as_of: #{@data_as_of}, employee: #{@employee}, employment:"\ " #{@employment}, incomes: #{@incomes}, links: #{@links}, additional_properties:"\ " #{@additional_properties}>" end |