Class: Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItemContributionValueTiersTiersItem

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

Overview

A single tier of a tiered matching scheme.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rate: OMIT, threshold: OMIT, threshold_delta: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItemContributionValueTiersTiersItem

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



39
40
41
42
43
44
45
46
47
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item_contribution_value_tiers_tiers_item.rb', line 39

def initialize(rate: OMIT, threshold: OMIT, threshold_delta: OMIT, additional_properties: nil)
  @rate = rate if rate != OMIT
  @threshold = threshold if threshold != OMIT
  @threshold_delta = threshold_delta if threshold_delta != OMIT
  @additional_properties = additional_properties
  @_field_set = { "rate": rate, "threshold": threshold, "threshold_delta": threshold_delta }.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



21
22
23
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item_contribution_value_tiers_tiers_item.rb', line 21

def additional_properties
  @additional_properties
end

#rateObject (readonly)

will match.



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

def rate
  @rate
end

#thresholdObject (readonly)

match employee deductions from 0% up to and including 5% of payroll.



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

def threshold
  @threshold
end

#threshold_deltaObject (readonly)

threshold. In the first tier, this is equivalent to threshold.



19
20
21
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item_contribution_value_tiers_tiers_item.rb', line 19

def threshold_delta
  @threshold_delta
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItemContributionValueTiersTiersItem



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item_contribution_value_tiers_tiers_item.rb', line 53

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  rate = parsed_json["rate"]
  threshold = parsed_json["threshold"]
  threshold_delta = parsed_json["threshold_delta"]
  new(
    rate: rate,
    threshold: threshold,
    threshold_delta: threshold_delta,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


80
81
82
83
84
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item_contribution_value_tiers_tiers_item.rb', line 80

def self.validate_raw(obj:)
  obj.rate&.is_a?(String) != false || raise("Passed value for field obj.rate is not the expected type, validation failed.")
  obj.threshold&.is_a?(String) != false || raise("Passed value for field obj.threshold is not the expected type, validation failed.")
  obj.threshold_delta&.is_a?(String) != false || raise("Passed value for field obj.threshold_delta is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


71
72
73
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item_contribution_value_tiers_tiers_item.rb', line 71

def to_json
  @_field_set&.to_json
end