Class: Gusto::Employees::Benefits::BenefitsUpdateRequestContributionValueItem
- Inherits:
-
Object
- Object
- Gusto::Employees::Benefits::BenefitsUpdateRequestContributionValueItem
- Defined in:
- lib/fern_gusto/employees/benefits/types/benefits_update_request_contribution_value_item.rb
Overview
A single tier of a tiered matching scheme.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#rate ⇒ Object
readonly
will match.
-
#threshold ⇒ Object
readonly
match employee deductions from 0% up to and including 5% of payroll.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::Employees::Benefits::BenefitsUpdateRequestContributionValueItem
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(rate: OMIT, threshold: OMIT, additional_properties: nil) ⇒ Gusto::Employees::Benefits::BenefitsUpdateRequestContributionValueItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(rate: OMIT, threshold: OMIT, additional_properties: nil) ⇒ Gusto::Employees::Benefits::BenefitsUpdateRequestContributionValueItem
36 37 38 39 40 41 42 43 |
# File 'lib/fern_gusto/employees/benefits/types/benefits_update_request_contribution_value_item.rb', line 36 def initialize(rate: OMIT, threshold: OMIT, additional_properties: nil) @rate = rate if rate != OMIT @threshold = threshold if threshold != OMIT @additional_properties = additional_properties @_field_set = { "rate": rate, "threshold": threshold }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/fern_gusto/employees/benefits/types/benefits_update_request_contribution_value_item.rb', line 20 def additional_properties @additional_properties end |
#rate ⇒ Object (readonly)
will match.
12 13 14 |
# File 'lib/fern_gusto/employees/benefits/types/benefits_update_request_contribution_value_item.rb', line 12 def rate @rate end |
#threshold ⇒ Object (readonly)
match employee deductions from 0% up to and including 5% of payroll.
18 19 20 |
# File 'lib/fern_gusto/employees/benefits/types/benefits_update_request_contribution_value_item.rb', line 18 def threshold @threshold end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Employees::Benefits::BenefitsUpdateRequestContributionValueItem
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/fern_gusto/employees/benefits/types/benefits_update_request_contribution_value_item.rb', line 49 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"] new( rate: rate, threshold: threshold, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
73 74 75 76 |
# File 'lib/fern_gusto/employees/benefits/types/benefits_update_request_contribution_value_item.rb', line 73 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.") end |
Instance Method Details
#to_json ⇒ String
64 65 66 |
# File 'lib/fern_gusto/employees/benefits/types/benefits_update_request_contribution_value_item.rb', line 64 def to_json @_field_set&.to_json end |