Class: Gusto::CompanyBenefits::BenefitSummary
- Inherits:
-
Object
- Object
- Gusto::CompanyBenefits::BenefitSummary
- Defined in:
- lib/fern_gusto/company_benefits/types/benefit_summary.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#company_benefit_contribution ⇒ Object
readonly
and benefit type.
-
#company_benefit_deduction ⇒ Object
readonly
and benefit type.
-
#description ⇒ String
readonly
Description of the benefit.
- #employees ⇒ Gusto::CompanyBenefits::BenefitSummaryEmployees readonly
-
#end_date ⇒ String
readonly
The end date of benefit summary.
-
#start_date ⇒ String
readonly
The start date of benefit summary.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(start_date: OMIT, end_date: OMIT, description: OMIT, company_benefit_deduction: OMIT, company_benefit_contribution: OMIT, employees: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefits::BenefitSummary constructor
- #to_json ⇒ String
Constructor Details
#initialize(start_date: OMIT, end_date: OMIT, description: OMIT, company_benefit_deduction: OMIT, company_benefit_contribution: OMIT, employees: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefits::BenefitSummary
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fern_gusto/company_benefits/types/benefit_summary.rb', line 42 def initialize(start_date: OMIT, end_date: OMIT, description: OMIT, company_benefit_deduction: OMIT, company_benefit_contribution: OMIT, employees: OMIT, additional_properties: nil) @start_date = start_date if start_date != OMIT @end_date = end_date if end_date != OMIT @description = description if description != OMIT @company_benefit_deduction = company_benefit_deduction if company_benefit_deduction != OMIT @company_benefit_contribution = company_benefit_contribution if company_benefit_contribution != OMIT @employees = employees if employees != OMIT @additional_properties = additional_properties @_field_set = { "start_date": start_date, "end_date": end_date, "description": description, "company_benefit_deduction": company_benefit_deduction, "company_benefit_contribution": company_benefit_contribution, "employees": employees }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
25 26 27 |
# File 'lib/fern_gusto/company_benefits/types/benefit_summary.rb', line 25 def additional_properties @additional_properties end |
#company_benefit_contribution ⇒ Object (readonly)
and benefit type.
21 22 23 |
# File 'lib/fern_gusto/company_benefits/types/benefit_summary.rb', line 21 def company_benefit_contribution @company_benefit_contribution end |
#company_benefit_deduction ⇒ Object (readonly)
and benefit type.
18 19 20 |
# File 'lib/fern_gusto/company_benefits/types/benefit_summary.rb', line 18 def company_benefit_deduction @company_benefit_deduction end |
#description ⇒ String (readonly)
Returns Description of the benefit.
15 16 17 |
# File 'lib/fern_gusto/company_benefits/types/benefit_summary.rb', line 15 def description @description end |
#employees ⇒ Gusto::CompanyBenefits::BenefitSummaryEmployees (readonly)
23 24 25 |
# File 'lib/fern_gusto/company_benefits/types/benefit_summary.rb', line 23 def employees @employees end |
#end_date ⇒ String (readonly)
Returns The end date of benefit summary.
13 14 15 |
# File 'lib/fern_gusto/company_benefits/types/benefit_summary.rb', line 13 def end_date @end_date end |
#start_date ⇒ String (readonly)
Returns The start date of benefit summary.
11 12 13 |
# File 'lib/fern_gusto/company_benefits/types/benefit_summary.rb', line 11 def start_date @start_date end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::CompanyBenefits::BenefitSummary
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/fern_gusto/company_benefits/types/benefit_summary.rb', line 58 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) start_date = parsed_json["start_date"] end_date = parsed_json["end_date"] description = parsed_json["description"] company_benefit_deduction = parsed_json["company_benefit_deduction"] company_benefit_contribution = parsed_json["company_benefit_contribution"] unless parsed_json["employees"].nil? employees = parsed_json["employees"].to_json employees = Gusto::CompanyBenefits::BenefitSummaryEmployees.from_json(json_object: employees) else employees = nil end new( start_date: start_date, end_date: end_date, description: description, company_benefit_deduction: company_benefit_deduction, company_benefit_contribution: company_benefit_contribution, employees: employees, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
94 95 96 97 98 99 100 101 |
# File 'lib/fern_gusto/company_benefits/types/benefit_summary.rb', line 94 def self.validate_raw(obj:) obj.start_date&.is_a?(String) != false || raise("Passed value for field obj.start_date is not the expected type, validation failed.") obj.end_date&.is_a?(String) != false || raise("Passed value for field obj.end_date is not the expected type, validation failed.") obj.description&.is_a?(String) != false || raise("Passed value for field obj.description 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.employees.nil? || Gusto::CompanyBenefits::BenefitSummaryEmployees.validate_raw(obj: obj.employees) end |
Instance Method Details
#to_json ⇒ String
85 86 87 |
# File 'lib/fern_gusto/company_benefits/types/benefit_summary.rb', line 85 def to_json @_field_set&.to_json end |