Class: Gusto::HolidayPayPolicy

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

Overview

Representation of a Holiday Pay Policy

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version:, company_uuid:, federal_holidays:, employees:, additional_properties: nil) ⇒ Gusto::HolidayPayPolicy

Parameters:

  • company_uuid (String)

    A unique identifier for the company owning the holiday pay policy

  • federal_holidays (Array<Gusto::HolidayPayPolicyFederalHolidaysItem>)

    List of the eleven supported federal holidays and their details

  • employees (Array<Gusto::HolidayPayPolicyEmployeesItem>)

    List of employee uuids under a time off policy

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



36
37
38
39
40
41
42
43
# File 'lib/fern_gusto/types/holiday_pay_policy.rb', line 36

def initialize(version:, company_uuid:, federal_holidays:, employees:, additional_properties: nil)
  @version = version
  @company_uuid = company_uuid
  @federal_holidays = federal_holidays
  @employees = employees
  @additional_properties = additional_properties
  @_field_set = { "version": version, "company_uuid": company_uuid, "federal_holidays": federal_holidays, "employees": employees }
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/holiday_pay_policy.rb', line 21

def additional_properties
  @additional_properties
end

#company_uuidString (readonly)

Returns A unique identifier for the company owning the holiday pay policy.

Returns:

  • (String)

    A unique identifier for the company owning the holiday pay policy



15
16
17
# File 'lib/fern_gusto/types/holiday_pay_policy.rb', line 15

def company_uuid
  @company_uuid
end

#employeesArray<Gusto::HolidayPayPolicyEmployeesItem> (readonly)

Returns List of employee uuids under a time off policy.

Returns:



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

def employees
  @employees
end

#federal_holidaysArray<Gusto::HolidayPayPolicyFederalHolidaysItem> (readonly)

Returns List of the eleven supported federal holidays and their details.

Returns:



17
18
19
# File 'lib/fern_gusto/types/holiday_pay_policy.rb', line 17

def federal_holidays
  @federal_holidays
end

#versionObject (readonly)

information on how to use this field.



13
14
15
# File 'lib/fern_gusto/types/holiday_pay_policy.rb', line 13

def version
  @version
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::HolidayPayPolicy

Parameters:

  • json_object (String)

Returns:



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/fern_gusto/types/holiday_pay_policy.rb', line 48

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  version = parsed_json["version"]
  company_uuid = parsed_json["company_uuid"]
  federal_holidays = parsed_json["federal_holidays"]&.map do | item |
  item = item.to_json
  Gusto::HolidayPayPolicyFederalHolidaysItem.from_json(json_object: item)
end
  employees = parsed_json["employees"]&.map do | item |
  item = item.to_json
  Gusto::HolidayPayPolicyEmployeesItem.from_json(json_object: item)
end
  new(
    version: version,
    company_uuid: company_uuid,
    federal_holidays: federal_holidays,
    employees: employees,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


81
82
83
84
85
86
# File 'lib/fern_gusto/types/holiday_pay_policy.rb', line 81

def self.validate_raw(obj:)
  obj.version.is_a?(String) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
  obj.company_uuid.is_a?(String) != false || raise("Passed value for field obj.company_uuid is not the expected type, validation failed.")
  obj.federal_holidays.is_a?(Array) != false || raise("Passed value for field obj.federal_holidays is not the expected type, validation failed.")
  obj.employees.is_a?(Array) != false || raise("Passed value for field obj.employees is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


72
73
74
# File 'lib/fern_gusto/types/holiday_pay_policy.rb', line 72

def to_json
  @_field_set&.to_json
end