Class: Gusto::PayrollEmployeeCompensationsTypeItemBenefitsItem

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: OMIT, employee_deduction: OMIT, company_contribution: OMIT, imputed: OMIT, additional_properties: nil) ⇒ Gusto::PayrollEmployeeCompensationsTypeItemBenefitsItem

Parameters:

  • name (String) (defaults to: OMIT)
  • employee_deduction (Float) (defaults to: OMIT)
  • company_contribution (Float) (defaults to: OMIT)
  • imputed (Boolean) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



29
30
31
32
33
34
35
36
37
38
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 29

def initialize(name: OMIT, employee_deduction: OMIT, company_contribution: OMIT, imputed: OMIT, additional_properties: nil)
  @name = name if name != OMIT
  @employee_deduction = employee_deduction if employee_deduction != OMIT
  @company_contribution = company_contribution if company_contribution != OMIT
  @imputed = imputed if imputed != OMIT
  @additional_properties = additional_properties
  @_field_set = { "name": name, "employee_deduction": employee_deduction, "company_contribution": company_contribution, "imputed": imputed }.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



16
17
18
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 16

def additional_properties
  @additional_properties
end

#company_contributionFloat (readonly)

Returns:

  • (Float)


12
13
14
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 12

def company_contribution
  @company_contribution
end

#employee_deductionFloat (readonly)

Returns:

  • (Float)


10
11
12
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 10

def employee_deduction
  @employee_deduction
end

#imputedBoolean (readonly)

Returns:

  • (Boolean)


14
15
16
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 14

def imputed
  @imputed
end

#nameString (readonly)

Returns:

  • (String)


8
9
10
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 8

def name
  @name
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PayrollEmployeeCompensationsTypeItemBenefitsItem

Parameters:

  • json_object (String)

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 44

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  name = parsed_json["name"]
  employee_deduction = parsed_json["employee_deduction"]
  company_contribution = parsed_json["company_contribution"]
  imputed = parsed_json["imputed"]
  new(
    name: name,
    employee_deduction: employee_deduction,
    company_contribution: company_contribution,
    imputed: imputed,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


72
73
74
75
76
77
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 72

def self.validate_raw(obj:)
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.employee_deduction&.is_a?(Float) != false || raise("Passed value for field obj.employee_deduction is not the expected type, validation failed.")
  obj.company_contribution&.is_a?(Float) != false || raise("Passed value for field obj.company_contribution is not the expected type, validation failed.")
  obj.imputed&.is_a?(Boolean) != false || raise("Passed value for field obj.imputed is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


63
64
65
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 63

def to_json
  @_field_set&.to_json
end