Class: Gusto::CompanyBenefits::BenefitTypeRequirements
- Inherits:
-
Object
- Object
- Gusto::CompanyBenefits::BenefitTypeRequirements
- Defined in:
- lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #catch_up ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsCatchUp readonly
- #company_contribution_annual_maximum ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsCompanyContributionAnnualMaximum readonly
- #contribution ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsContribution readonly
- #coverage_amount ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsCoverageAmount readonly
- #coverage_salary_multiplier ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsCoverageSalaryMultiplier readonly
- #deduct_as_percentage ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsDeductAsPercentage readonly
- #employee_deduction ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsEmployeeDeduction readonly
- #limit_option ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsLimitOption readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::CompanyBenefits::BenefitTypeRequirements
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(employee_deduction: OMIT, contribution: OMIT, deduct_as_percentage: OMIT, catch_up: OMIT, limit_option: OMIT, company_contribution_annual_maximum: OMIT, coverage_salary_multiplier: OMIT, coverage_amount: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefits::BenefitTypeRequirements constructor
- #to_json ⇒ String
Constructor Details
#initialize(employee_deduction: OMIT, contribution: OMIT, deduct_as_percentage: OMIT, catch_up: OMIT, limit_option: OMIT, company_contribution_annual_maximum: OMIT, coverage_salary_multiplier: OMIT, coverage_amount: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefits::BenefitTypeRequirements
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 51 def initialize(employee_deduction: OMIT, contribution: OMIT, deduct_as_percentage: OMIT, catch_up: OMIT, limit_option: OMIT, company_contribution_annual_maximum: OMIT, coverage_salary_multiplier: OMIT, coverage_amount: OMIT, additional_properties: nil) @employee_deduction = employee_deduction if employee_deduction != OMIT @contribution = contribution if contribution != OMIT @deduct_as_percentage = deduct_as_percentage if deduct_as_percentage != OMIT @catch_up = catch_up if catch_up != OMIT @limit_option = limit_option if limit_option != OMIT @company_contribution_annual_maximum = company_contribution_annual_maximum if company_contribution_annual_maximum != OMIT @coverage_salary_multiplier = coverage_salary_multiplier if coverage_salary_multiplier != OMIT @coverage_amount = coverage_amount if coverage_amount != OMIT @additional_properties = additional_properties @_field_set = { "employee_deduction": employee_deduction, "contribution": contribution, "deduct_as_percentage": deduct_as_percentage, "catch_up": catch_up, "limit_option": limit_option, "company_contribution_annual_maximum": company_contribution_annual_maximum, "coverage_salary_multiplier": coverage_salary_multiplier, "coverage_amount": coverage_amount }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
34 35 36 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 34 def additional_properties @additional_properties end |
#catch_up ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsCatchUp (readonly)
24 25 26 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 24 def catch_up @catch_up end |
#company_contribution_annual_maximum ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsCompanyContributionAnnualMaximum (readonly)
28 29 30 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 28 def company_contribution_annual_maximum @company_contribution_annual_maximum end |
#contribution ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsContribution (readonly)
20 21 22 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 20 def contribution @contribution end |
#coverage_amount ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsCoverageAmount (readonly)
32 33 34 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 32 def coverage_amount @coverage_amount end |
#coverage_salary_multiplier ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsCoverageSalaryMultiplier (readonly)
30 31 32 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 30 def coverage_salary_multiplier @coverage_salary_multiplier end |
#deduct_as_percentage ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsDeductAsPercentage (readonly)
22 23 24 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 22 def deduct_as_percentage @deduct_as_percentage end |
#employee_deduction ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsEmployeeDeduction (readonly)
18 19 20 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 18 def employee_deduction @employee_deduction end |
#limit_option ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsLimitOption (readonly)
26 27 28 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 26 def limit_option @limit_option end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::CompanyBenefits::BenefitTypeRequirements
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 69 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["employee_deduction"].nil? employee_deduction = parsed_json["employee_deduction"].to_json employee_deduction = Gusto::CompanyBenefits::BenefitTypeRequirementsEmployeeDeduction.from_json(json_object: employee_deduction) else employee_deduction = nil end unless parsed_json["contribution"].nil? contribution = parsed_json["contribution"].to_json contribution = Gusto::CompanyBenefits::BenefitTypeRequirementsContribution.from_json(json_object: contribution) else contribution = nil end unless parsed_json["deduct_as_percentage"].nil? deduct_as_percentage = parsed_json["deduct_as_percentage"].to_json deduct_as_percentage = Gusto::CompanyBenefits::BenefitTypeRequirementsDeductAsPercentage.from_json(json_object: deduct_as_percentage) else deduct_as_percentage = nil end unless parsed_json["catch_up"].nil? catch_up = parsed_json["catch_up"].to_json catch_up = Gusto::CompanyBenefits::BenefitTypeRequirementsCatchUp.from_json(json_object: catch_up) else catch_up = nil end unless parsed_json["limit_option"].nil? limit_option = parsed_json["limit_option"].to_json limit_option = Gusto::CompanyBenefits::BenefitTypeRequirementsLimitOption.from_json(json_object: limit_option) else limit_option = nil end unless parsed_json["company_contribution_annual_maximum"].nil? company_contribution_annual_maximum = parsed_json["company_contribution_annual_maximum"].to_json company_contribution_annual_maximum = Gusto::CompanyBenefits::BenefitTypeRequirementsCompanyContributionAnnualMaximum.from_json(json_object: company_contribution_annual_maximum) else company_contribution_annual_maximum = nil end unless parsed_json["coverage_salary_multiplier"].nil? coverage_salary_multiplier = parsed_json["coverage_salary_multiplier"].to_json coverage_salary_multiplier = Gusto::CompanyBenefits::BenefitTypeRequirementsCoverageSalaryMultiplier.from_json(json_object: coverage_salary_multiplier) else coverage_salary_multiplier = nil end unless parsed_json["coverage_amount"].nil? coverage_amount = parsed_json["coverage_amount"].to_json coverage_amount = Gusto::CompanyBenefits::BenefitTypeRequirementsCoverageAmount.from_json(json_object: coverage_amount) else coverage_amount = nil end new( employee_deduction: employee_deduction, contribution: contribution, deduct_as_percentage: deduct_as_percentage, catch_up: catch_up, limit_option: limit_option, company_contribution_annual_maximum: company_contribution_annual_maximum, coverage_salary_multiplier: coverage_salary_multiplier, coverage_amount: coverage_amount, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
144 145 146 147 148 149 150 151 152 153 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 144 def self.validate_raw(obj:) obj.employee_deduction.nil? || Gusto::CompanyBenefits::BenefitTypeRequirementsEmployeeDeduction.validate_raw(obj: obj.employee_deduction) obj.contribution.nil? || Gusto::CompanyBenefits::BenefitTypeRequirementsContribution.validate_raw(obj: obj.contribution) obj.deduct_as_percentage.nil? || Gusto::CompanyBenefits::BenefitTypeRequirementsDeductAsPercentage.validate_raw(obj: obj.deduct_as_percentage) obj.catch_up.nil? || Gusto::CompanyBenefits::BenefitTypeRequirementsCatchUp.validate_raw(obj: obj.catch_up) obj.limit_option.nil? || Gusto::CompanyBenefits::BenefitTypeRequirementsLimitOption.validate_raw(obj: obj.limit_option) obj.company_contribution_annual_maximum.nil? || Gusto::CompanyBenefits::BenefitTypeRequirementsCompanyContributionAnnualMaximum.validate_raw(obj: obj.company_contribution_annual_maximum) obj.coverage_salary_multiplier.nil? || Gusto::CompanyBenefits::BenefitTypeRequirementsCoverageSalaryMultiplier.validate_raw(obj: obj.coverage_salary_multiplier) obj.coverage_amount.nil? || Gusto::CompanyBenefits::BenefitTypeRequirementsCoverageAmount.validate_raw(obj: obj.coverage_amount) end |
Instance Method Details
#to_json ⇒ String
135 136 137 |
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements.rb', line 135 def to_json @_field_set&.to_json end |