Class: Gusto::CompanyBenefits::BenefitSummaryEmployeesPayrollBenefits

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payroll_uuid: OMIT, payroll_type: OMIT, check_date: OMIT, gross_pay: OMIT, company_benefit_deduction: OMIT, company_benefit_contribution: OMIT, pay_period: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefits::BenefitSummaryEmployeesPayrollBenefits

Parameters:

  • payroll_uuid (String) (defaults to: OMIT)
  • payroll_type (String) (defaults to: OMIT)

    Whether it is regular or bonus payroll

  • check_date (String) (defaults to: OMIT)
  • gross_pay (String) (defaults to: OMIT)
  • company_benefit_deduction (String) (defaults to: OMIT)
  • company_benefit_contribution (String) (defaults to: OMIT)
  • pay_period (Gusto::CompanyBenefits::BenefitSummaryEmployeesPayrollBenefitsPayPeriod) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees_payroll_benefits.rb', line 40

def initialize(payroll_uuid: OMIT, payroll_type: OMIT, check_date: OMIT, gross_pay: OMIT, company_benefit_deduction: OMIT, company_benefit_contribution: OMIT, pay_period: OMIT, additional_properties: nil)
  @payroll_uuid = payroll_uuid if payroll_uuid != OMIT
  @payroll_type = payroll_type if payroll_type != OMIT
  @check_date = check_date if check_date != OMIT
  @gross_pay = gross_pay if gross_pay != OMIT
  @company_benefit_deduction = company_benefit_deduction if company_benefit_deduction != OMIT
  @company_benefit_contribution = company_benefit_contribution if company_benefit_contribution != OMIT
  @pay_period = pay_period if pay_period != OMIT
  @additional_properties = additional_properties
  @_field_set = { "payroll_uuid": payroll_uuid, "payroll_type": payroll_type, "check_date": check_date, "gross_pay": gross_pay, "company_benefit_deduction": company_benefit_deduction, "company_benefit_contribution": company_benefit_contribution, "pay_period": pay_period }.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



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

def additional_properties
  @additional_properties
end

#check_dateString (readonly)

Returns:

  • (String)


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

def check_date
  @check_date
end

#company_benefit_contributionString (readonly)

Returns:

  • (String)


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

def company_benefit_contribution
  @company_benefit_contribution
end

#company_benefit_deductionString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees_payroll_benefits.rb', line 18

def company_benefit_deduction
  @company_benefit_deduction
end

#gross_payString (readonly)

Returns:

  • (String)


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

def gross_pay
  @gross_pay
end

#pay_periodGusto::CompanyBenefits::BenefitSummaryEmployeesPayrollBenefitsPayPeriod (readonly)



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

def pay_period
  @pay_period
end

#payroll_typeString (readonly)

Returns Whether it is regular or bonus payroll.

Returns:

  • (String)

    Whether it is regular or bonus payroll



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

def payroll_type
  @payroll_type
end

#payroll_uuidString (readonly)

Returns:

  • (String)


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

def payroll_uuid
  @payroll_uuid
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees_payroll_benefits.rb', line 58

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  payroll_uuid = parsed_json["payroll_uuid"]
  payroll_type = parsed_json["payroll_type"]
  check_date = parsed_json["check_date"]
  gross_pay = parsed_json["gross_pay"]
  company_benefit_deduction = parsed_json["company_benefit_deduction"]
  company_benefit_contribution = parsed_json["company_benefit_contribution"]
  unless parsed_json["pay_period"].nil?
    pay_period = parsed_json["pay_period"].to_json
    pay_period = Gusto::CompanyBenefits::BenefitSummaryEmployeesPayrollBenefitsPayPeriod.from_json(json_object: pay_period)
  else
    pay_period = nil
  end
  new(
    payroll_uuid: payroll_uuid,
    payroll_type: payroll_type,
    check_date: check_date,
    gross_pay: gross_pay,
    company_benefit_deduction: company_benefit_deduction,
    company_benefit_contribution: company_benefit_contribution,
    pay_period: pay_period,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


96
97
98
99
100
101
102
103
104
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees_payroll_benefits.rb', line 96

def self.validate_raw(obj:)
  obj.payroll_uuid&.is_a?(String) != false || raise("Passed value for field obj.payroll_uuid is not the expected type, validation failed.")
  obj.payroll_type&.is_a?(String) != false || raise("Passed value for field obj.payroll_type is not the expected type, validation failed.")
  obj.check_date&.is_a?(String) != false || raise("Passed value for field obj.check_date 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.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.pay_period.nil? || Gusto::CompanyBenefits::BenefitSummaryEmployeesPayrollBenefitsPayPeriod.validate_raw(obj: obj.pay_period)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


87
88
89
# File 'lib/fern_gusto/company_benefits/types/benefit_summary_employees_payroll_benefits.rb', line 87

def to_json
  @_field_set&.to_json
end