Class: Gusto::PayrollReceiptTotals

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/types/payroll_receipt_totals.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, child_support_debit: OMIT, reimbursement_debit: OMIT, tax_debit: OMIT, additional_properties: nil) ⇒ Gusto::PayrollReceiptTotals

Parameters:

  • company_debit (String) (defaults to: OMIT)

    The total company debit for the payroll.

  • net_pay_debit (String) (defaults to: OMIT)

    The total company net pay for the payroll.

  • child_support_debit (String) (defaults to: OMIT)

    The total child support debit for the payroll.

  • reimbursement_debit (String) (defaults to: OMIT)

    The total reimbursements for the payroll.

  • tax_debit (String) (defaults to: OMIT)

    The total tax debit for the payroll.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/fern_gusto/types/payroll_receipt_totals.rb', line 33

def initialize(company_debit: OMIT, net_pay_debit: OMIT, child_support_debit: OMIT, reimbursement_debit: OMIT, tax_debit: OMIT, additional_properties: nil)
  @company_debit = company_debit if company_debit != OMIT
  @net_pay_debit = net_pay_debit if net_pay_debit != OMIT
  @child_support_debit = child_support_debit if child_support_debit != OMIT
  @reimbursement_debit = reimbursement_debit if reimbursement_debit != OMIT
  @tax_debit = tax_debit if tax_debit != OMIT
  @additional_properties = additional_properties
  @_field_set = { "company_debit": company_debit, "net_pay_debit": net_pay_debit, "child_support_debit": child_support_debit, "reimbursement_debit": reimbursement_debit, "tax_debit": tax_debit }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



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

def additional_properties
  @additional_properties
end

#child_support_debitString (readonly)

Returns The total child support debit for the payroll.

Returns:

  • (String)

    The total child support debit for the payroll.



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

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_receipt_totals.rb', line 9

def company_debit
  @company_debit
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_receipt_totals.rb', line 11

def net_pay_debit
  @net_pay_debit
end

#reimbursement_debitString (readonly)

Returns The total reimbursements for the payroll.

Returns:

  • (String)

    The total reimbursements for the payroll.



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

def reimbursement_debit
  @reimbursement_debit
end

#tax_debitString (readonly)

Returns The total tax debit for the payroll.

Returns:

  • (String)

    The total tax debit for the payroll.



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

def tax_debit
  @tax_debit
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PayrollReceiptTotals

Parameters:

  • json_object (String)

Returns:



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/fern_gusto/types/payroll_receipt_totals.rb', line 48

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"]
  child_support_debit = parsed_json["child_support_debit"]
  reimbursement_debit = parsed_json["reimbursement_debit"]
  tax_debit = parsed_json["tax_debit"]
  new(
    company_debit: company_debit,
    net_pay_debit: net_pay_debit,
    child_support_debit: child_support_debit,
    reimbursement_debit: reimbursement_debit,
    tax_debit: tax_debit,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


77
78
79
80
81
82
83
# File 'lib/fern_gusto/types/payroll_receipt_totals.rb', line 77

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.child_support_debit&.is_a?(String) != false || raise("Passed value for field obj.child_support_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.tax_debit&.is_a?(String) != false || raise("Passed value for field obj.tax_debit is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


68
69
70
# File 'lib/fern_gusto/types/payroll_receipt_totals.rb', line 68

def to_json
  @_field_set&.to_json
end