Class: Gusto::CompanyBenefits::BenefitSummaryEmployees

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid: OMIT, company_benefit_deduction: OMIT, company_benefit_contribution: OMIT, benefit_deduction: OMIT, benefit_contribution: OMIT, gross_pay: OMIT, payroll_benefits: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefits::BenefitSummaryEmployees

Parameters:

  • benefit_contribution (String) (defaults to: OMIT)

    Sum of company contribution given the period of time for this specific employee.

  • gross_pay (String) (defaults to: OMIT)

    Gross pay of this pay check.

  • payroll_benefits (Gusto::CompanyBenefits::BenefitSummaryEmployeesPayrollBenefits) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees.rb', line 47

def initialize(uuid: OMIT, company_benefit_deduction: OMIT, company_benefit_contribution: OMIT, benefit_deduction: OMIT, benefit_contribution: OMIT, gross_pay: OMIT, payroll_benefits: OMIT, additional_properties: nil)
  @uuid = uuid if uuid != OMIT
  @company_benefit_deduction = company_benefit_deduction if company_benefit_deduction != OMIT
  @company_benefit_contribution = company_benefit_contribution if company_benefit_contribution != OMIT
  @benefit_deduction = benefit_deduction if benefit_deduction != OMIT
  @benefit_contribution = benefit_contribution if benefit_contribution != OMIT
  @gross_pay = gross_pay if gross_pay != OMIT
  @payroll_benefits = payroll_benefits if payroll_benefits != OMIT
  @additional_properties = additional_properties
  @_field_set = { "uuid": uuid, "company_benefit_deduction": company_benefit_deduction, "company_benefit_contribution": company_benefit_contribution, "benefit_deduction": benefit_deduction, "benefit_contribution": benefit_contribution, "gross_pay": gross_pay, "payroll_benefits": payroll_benefits }.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



28
29
30
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees.rb', line 28

def additional_properties
  @additional_properties
end

#benefit_contributionString (readonly)

Returns Sum of company contribution given the period of time for this specific employee.

Returns:

  • (String)

    Sum of company contribution given the period of time for this specific employee.



22
23
24
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees.rb', line 22

def benefit_contribution
  @benefit_contribution
end

#benefit_deductionObject (readonly)

employee.



20
21
22
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees.rb', line 20

def benefit_deduction
  @benefit_deduction
end

#company_benefit_contributionObject (readonly)

and benefit type.



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

def company_benefit_contribution
  @company_benefit_contribution
end

#company_benefit_deductionObject (readonly)

and benefit type.



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

def company_benefit_deduction
  @company_benefit_deduction
end

#gross_payString (readonly)

Returns Gross pay of this pay check.

Returns:

  • (String)

    Gross pay of this pay check.



24
25
26
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees.rb', line 24

def gross_pay
  @gross_pay
end

#payroll_benefitsGusto::CompanyBenefits::BenefitSummaryEmployeesPayrollBenefits (readonly)



26
27
28
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees.rb', line 26

def payroll_benefits
  @payroll_benefits
end

#uuidString (readonly)

Returns The UUID of the employee.

Returns:

  • (String)

    The UUID of the employee



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

def uuid
  @uuid
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::CompanyBenefits::BenefitSummaryEmployees

Parameters:

  • json_object (String)

Returns:



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
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees.rb', line 64

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  uuid = parsed_json["uuid"]
  company_benefit_deduction = parsed_json["company_benefit_deduction"]
  company_benefit_contribution = parsed_json["company_benefit_contribution"]
  benefit_deduction = parsed_json["benefit_deduction"]
  benefit_contribution = parsed_json["benefit_contribution"]
  gross_pay = parsed_json["gross_pay"]
  unless parsed_json["payroll_benefits"].nil?
    payroll_benefits = parsed_json["payroll_benefits"].to_json
    payroll_benefits = Gusto::CompanyBenefits::BenefitSummaryEmployeesPayrollBenefits.from_json(json_object: payroll_benefits)
  else
    payroll_benefits = nil
  end
  new(
    uuid: uuid,
    company_benefit_deduction: company_benefit_deduction,
    company_benefit_contribution: company_benefit_contribution,
    benefit_deduction: benefit_deduction,
    benefit_contribution: benefit_contribution,
    gross_pay: gross_pay,
    payroll_benefits: payroll_benefits,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


102
103
104
105
106
107
108
109
110
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees.rb', line 102

def self.validate_raw(obj:)
  obj.uuid&.is_a?(String) != false || raise("Passed value for field obj.uuid is not the expected type, validation failed.")
  obj.company_benefit_deduction&.is_a?(String) != false || raise("Passed value for field obj.company_benefit_deduction is not the expected type, validation failed.")
  obj.company_benefit_contribution&.is_a?(String) != false || raise("Passed value for field obj.company_benefit_contribution is not the expected type, validation failed.")
  obj.benefit_deduction&.is_a?(String) != false || raise("Passed value for field obj.benefit_deduction is not the expected type, validation failed.")
  obj.benefit_contribution&.is_a?(String) != false || raise("Passed value for field obj.benefit_contribution 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.payroll_benefits.nil? || Gusto::CompanyBenefits::BenefitSummaryEmployeesPayrollBenefits.validate_raw(obj: obj.payroll_benefits)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


93
94
95
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees.rb', line 93

def to_json
  @_field_set&.to_json
end