Class: Gusto::PayrollTotalsType

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/types/payroll_totals_type.rb

Overview

The subtotals for the payroll.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(company_debit: OMIT, net_pay_debit: OMIT, tax_debit: OMIT, reimbursement_debit: OMIT, child_support_debit: OMIT, reimbursements: OMIT, net_pay: OMIT, gross_pay: OMIT, employee_bonuses: OMIT, employee_commissions: OMIT, employee_cash_tips: OMIT, employee_paycheck_tips: OMIT, additional_earnings: OMIT, owners_draw: OMIT, check_amount: OMIT, employer_taxes: OMIT, employee_taxes: OMIT, benefits: OMIT, employee_benefits_deductions: OMIT, deferred_payroll_taxes: OMIT, other_deductions: OMIT, additional_properties: nil) ⇒ Gusto::PayrollTotalsType

Parameters:

  • other_deductions (String) (defaults to: OMIT)

    The total amount of deductions for the payroll.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 83

def initialize(company_debit: OMIT, net_pay_debit: OMIT, tax_debit: OMIT, reimbursement_debit: OMIT, child_support_debit: OMIT, reimbursements: OMIT, net_pay: OMIT, gross_pay: OMIT, employee_bonuses: OMIT, employee_commissions: OMIT, employee_cash_tips: OMIT, employee_paycheck_tips: OMIT, additional_earnings: OMIT, owners_draw: OMIT, check_amount: OMIT, employer_taxes: OMIT, employee_taxes: OMIT, benefits: OMIT, employee_benefits_deductions: OMIT, deferred_payroll_taxes: OMIT, other_deductions: OMIT, additional_properties: nil)
  @company_debit = company_debit if company_debit != OMIT
  @net_pay_debit = net_pay_debit if net_pay_debit != OMIT
  @tax_debit = tax_debit if tax_debit != OMIT
  @reimbursement_debit = reimbursement_debit if reimbursement_debit != OMIT
  @child_support_debit = child_support_debit if child_support_debit != OMIT
  @reimbursements = reimbursements if reimbursements != OMIT
  @net_pay = net_pay if net_pay != OMIT
  @gross_pay = gross_pay if gross_pay != OMIT
  @employee_bonuses = employee_bonuses if employee_bonuses != OMIT
  @employee_commissions = employee_commissions if employee_commissions != OMIT
  @employee_cash_tips = employee_cash_tips if employee_cash_tips != OMIT
  @employee_paycheck_tips = employee_paycheck_tips if employee_paycheck_tips != OMIT
  @additional_earnings = additional_earnings if additional_earnings != OMIT
  @owners_draw = owners_draw if owners_draw != OMIT
  @check_amount = check_amount if check_amount != OMIT
  @employer_taxes = employer_taxes if employer_taxes != OMIT
  @employee_taxes = employee_taxes if employee_taxes != OMIT
  @benefits = benefits if benefits != OMIT
  @employee_benefits_deductions = employee_benefits_deductions if employee_benefits_deductions != OMIT
  @deferred_payroll_taxes = deferred_payroll_taxes if deferred_payroll_taxes != OMIT
  @other_deductions = other_deductions if other_deductions != OMIT
  @additional_properties = additional_properties
  @_field_set = { "company_debit": company_debit, "net_pay_debit": net_pay_debit, "tax_debit": tax_debit, "reimbursement_debit": reimbursement_debit, "child_support_debit": child_support_debit, "reimbursements": reimbursements, "net_pay": net_pay, "gross_pay": gross_pay, "employee_bonuses": employee_bonuses, "employee_commissions": employee_commissions, "employee_cash_tips": employee_cash_tips, "employee_paycheck_tips": employee_paycheck_tips, "additional_earnings": additional_earnings, "owners_draw": owners_draw, "check_amount": check_amount, "employer_taxes": employer_taxes, "employee_taxes": employee_taxes, "benefits": benefits, "employee_benefits_deductions": employee_benefits_deductions, "deferred_payroll_taxes": deferred_payroll_taxes, "other_deductions": other_deductions }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_earningsString (readonly)

Returns The total additional earnings amount for the payroll.

Returns:

  • (String)

    The total additional earnings amount for the payroll.



33
34
35
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 33

def additional_earnings
  @additional_earnings
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



52
53
54
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 52

def additional_properties
  @additional_properties
end

#benefitsString (readonly)

Returns The total amount of company contributed benefits for the payroll.

Returns:

  • (String)

    The total amount of company contributed benefits for the payroll.



43
44
45
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 43

def benefits
  @benefits
end

#check_amountString (readonly)

Returns The total check amount for the payroll.

Returns:

  • (String)

    The total check amount for the payroll.



37
38
39
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 37

def check_amount
  @check_amount
end

#child_support_debitString (readonly)

Returns The total child support debit for the payroll.

Returns:

  • (String)

    The total child support debit for the payroll.



17
18
19
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 17

def child_support_debit
  @child_support_debit
end

#company_debitString (readonly)

Returns The total company debit for the payroll.

Returns:

  • (String)

    The total company debit for the payroll.



9
10
11
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 9

def company_debit
  @company_debit
end

#deferred_payroll_taxesObject (readonly)

the CARES act.



48
49
50
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 48

def deferred_payroll_taxes
  @deferred_payroll_taxes
end

#employee_benefits_deductionsString (readonly)

Returns The total amount of employee deducted benefits for the payroll.

Returns:

  • (String)

    The total amount of employee deducted benefits for the payroll.



45
46
47
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 45

def employee_benefits_deductions
  @employee_benefits_deductions
end

#employee_bonusesString (readonly)

Returns The total employee bonuses amount for the payroll.

Returns:

  • (String)

    The total employee bonuses amount for the payroll.



25
26
27
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 25

def employee_bonuses
  @employee_bonuses
end

#employee_cash_tipsString (readonly)

Returns The total employee cash tips amount for the payroll.

Returns:

  • (String)

    The total employee cash tips amount for the payroll.



29
30
31
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 29

def employee_cash_tips
  @employee_cash_tips
end

#employee_commissionsString (readonly)

Returns The total employee commissions amount for the payroll.

Returns:

  • (String)

    The total employee commissions amount for the payroll.



27
28
29
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 27

def employee_commissions
  @employee_commissions
end

#employee_paycheck_tipsString (readonly)

Returns The total employee paycheck tips amount for the payroll.

Returns:

  • (String)

    The total employee paycheck tips amount for the payroll.



31
32
33
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 31

def employee_paycheck_tips
  @employee_paycheck_tips
end

#employee_taxesString (readonly)

Returns The total amount of employee paid taxes for the payroll.

Returns:

  • (String)

    The total amount of employee paid taxes for the payroll.



41
42
43
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 41

def employee_taxes
  @employee_taxes
end

#employer_taxesString (readonly)

Returns The total amount of employer paid taxes for the payroll.

Returns:

  • (String)

    The total amount of employer paid taxes for the payroll.



39
40
41
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 39

def employer_taxes
  @employer_taxes
end

#gross_payString (readonly)

Returns The gross pay amount for the payroll.

Returns:

  • (String)

    The gross pay amount for the payroll.



23
24
25
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 23

def gross_pay
  @gross_pay
end

#net_payString (readonly)

Returns The net pay amount for the payroll.

Returns:

  • (String)

    The net pay amount for the payroll.



21
22
23
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 21

def net_pay
  @net_pay
end

#net_pay_debitString (readonly)

Returns The total company net pay for the payroll.

Returns:

  • (String)

    The total company net pay for the payroll.



11
12
13
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 11

def net_pay_debit
  @net_pay_debit
end

#other_deductionsString (readonly)

Returns The total amount of deductions for the payroll.

Returns:

  • (String)

    The total amount of deductions for the payroll.



50
51
52
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 50

def other_deductions
  @other_deductions
end

#owners_drawString (readonly)

Returns The total owner’s draw for the payroll.

Returns:

  • (String)

    The total owner’s draw for the payroll.



35
36
37
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 35

def owners_draw
  @owners_draw
end

#reimbursement_debitString (readonly)

Returns The total reimbursement debit for the payroll.

Returns:

  • (String)

    The total reimbursement debit for the payroll.



15
16
17
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 15

def reimbursement_debit
  @reimbursement_debit
end

#reimbursementsString (readonly)

Returns The total reimbursements for the payroll.

Returns:

  • (String)

    The total reimbursements for the payroll.



19
20
21
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 19

def reimbursements
  @reimbursements
end

#tax_debitString (readonly)

Returns The total tax debit for the payroll.

Returns:

  • (String)

    The total tax debit for the payroll.



13
14
15
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 13

def tax_debit
  @tax_debit
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PayrollTotalsType

Parameters:

  • json_object (String)

Returns:



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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 114

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  company_debit = parsed_json["company_debit"]
  net_pay_debit = parsed_json["net_pay_debit"]
  tax_debit = parsed_json["tax_debit"]
  reimbursement_debit = parsed_json["reimbursement_debit"]
  child_support_debit = parsed_json["child_support_debit"]
  reimbursements = parsed_json["reimbursements"]
  net_pay = parsed_json["net_pay"]
  gross_pay = parsed_json["gross_pay"]
  employee_bonuses = parsed_json["employee_bonuses"]
  employee_commissions = parsed_json["employee_commissions"]
  employee_cash_tips = parsed_json["employee_cash_tips"]
  employee_paycheck_tips = parsed_json["employee_paycheck_tips"]
  additional_earnings = parsed_json["additional_earnings"]
  owners_draw = parsed_json["owners_draw"]
  check_amount = parsed_json["check_amount"]
  employer_taxes = parsed_json["employer_taxes"]
  employee_taxes = parsed_json["employee_taxes"]
  benefits = parsed_json["benefits"]
  employee_benefits_deductions = parsed_json["employee_benefits_deductions"]
  deferred_payroll_taxes = parsed_json["deferred_payroll_taxes"]
  other_deductions = parsed_json["other_deductions"]
  new(
    company_debit: company_debit,
    net_pay_debit: net_pay_debit,
    tax_debit: tax_debit,
    reimbursement_debit: reimbursement_debit,
    child_support_debit: child_support_debit,
    reimbursements: reimbursements,
    net_pay: net_pay,
    gross_pay: gross_pay,
    employee_bonuses: employee_bonuses,
    employee_commissions: employee_commissions,
    employee_cash_tips: employee_cash_tips,
    employee_paycheck_tips: employee_paycheck_tips,
    additional_earnings: additional_earnings,
    owners_draw: owners_draw,
    check_amount: check_amount,
    employer_taxes: employer_taxes,
    employee_taxes: employee_taxes,
    benefits: benefits,
    employee_benefits_deductions: employee_benefits_deductions,
    deferred_payroll_taxes: deferred_payroll_taxes,
    other_deductions: other_deductions,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 175

def self.validate_raw(obj:)
  obj.company_debit&.is_a?(String) != false || raise("Passed value for field obj.company_debit is not the expected type, validation failed.")
  obj.net_pay_debit&.is_a?(String) != false || raise("Passed value for field obj.net_pay_debit is not the expected type, validation failed.")
  obj.tax_debit&.is_a?(String) != false || raise("Passed value for field obj.tax_debit is not the expected type, validation failed.")
  obj.reimbursement_debit&.is_a?(String) != false || raise("Passed value for field obj.reimbursement_debit is not the expected type, validation failed.")
  obj.child_support_debit&.is_a?(String) != false || raise("Passed value for field obj.child_support_debit is not the expected type, validation failed.")
  obj.reimbursements&.is_a?(String) != false || raise("Passed value for field obj.reimbursements is not the expected type, validation failed.")
  obj.net_pay&.is_a?(String) != false || raise("Passed value for field obj.net_pay is not the expected type, validation failed.")
  obj.gross_pay&.is_a?(String) != false || raise("Passed value for field obj.gross_pay is not the expected type, validation failed.")
  obj.employee_bonuses&.is_a?(String) != false || raise("Passed value for field obj.employee_bonuses is not the expected type, validation failed.")
  obj.employee_commissions&.is_a?(String) != false || raise("Passed value for field obj.employee_commissions is not the expected type, validation failed.")
  obj.employee_cash_tips&.is_a?(String) != false || raise("Passed value for field obj.employee_cash_tips is not the expected type, validation failed.")
  obj.employee_paycheck_tips&.is_a?(String) != false || raise("Passed value for field obj.employee_paycheck_tips is not the expected type, validation failed.")
  obj.additional_earnings&.is_a?(String) != false || raise("Passed value for field obj.additional_earnings is not the expected type, validation failed.")
  obj.owners_draw&.is_a?(String) != false || raise("Passed value for field obj.owners_draw is not the expected type, validation failed.")
  obj.check_amount&.is_a?(String) != false || raise("Passed value for field obj.check_amount is not the expected type, validation failed.")
  obj.employer_taxes&.is_a?(String) != false || raise("Passed value for field obj.employer_taxes is not the expected type, validation failed.")
  obj.employee_taxes&.is_a?(String) != false || raise("Passed value for field obj.employee_taxes is not the expected type, validation failed.")
  obj.benefits&.is_a?(String) != false || raise("Passed value for field obj.benefits is not the expected type, validation failed.")
  obj.employee_benefits_deductions&.is_a?(String) != false || raise("Passed value for field obj.employee_benefits_deductions is not the expected type, validation failed.")
  obj.deferred_payroll_taxes&.is_a?(String) != false || raise("Passed value for field obj.deferred_payroll_taxes is not the expected type, validation failed.")
  obj.other_deductions&.is_a?(String) != false || raise("Passed value for field obj.other_deductions is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


166
167
168
# File 'lib/fern_gusto/types/payroll_totals_type.rb', line 166

def to_json
  @_field_set&.to_json
end