Class: Gusto::CompanyBenefits::BenefitSummaryEmployees
- Inherits:
-
Object
- Object
- Gusto::CompanyBenefits::BenefitSummaryEmployees
- Defined in:
- lib/fern_gusto/company_benefits/types/benefit_summary_employees.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#benefit_contribution ⇒ String
readonly
Sum of company contribution given the period of time for this specific employee.
-
#benefit_deduction ⇒ Object
readonly
employee.
-
#company_benefit_contribution ⇒ Object
readonly
and benefit type.
-
#company_benefit_deduction ⇒ Object
readonly
and benefit type.
-
#gross_pay ⇒ String
readonly
Gross pay of this pay check.
- #payroll_benefits ⇒ Gusto::CompanyBenefits::BenefitSummaryEmployeesPayrollBenefits readonly
-
#uuid ⇒ String
readonly
The UUID of the employee.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::CompanyBenefits::BenefitSummaryEmployees
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #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 constructor
- #to_json ⇒ String
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
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_properties ⇒ OpenStruct (readonly)
Returns 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_contribution ⇒ String (readonly)
Returns 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_deduction ⇒ Object (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_contribution ⇒ Object (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_deduction ⇒ Object (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_pay ⇒ String (readonly)
Returns 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_benefits ⇒ Gusto::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 |
#uuid ⇒ String (readonly)
Returns 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
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
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_json ⇒ 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 |